diff --git a/test/e2e/app-dir/css-client-side-nav-parallel-routes/css-client-side-nav-parallel-routes.test.ts b/test/e2e/app-dir/css-client-side-nav-parallel-routes/css-client-side-nav-parallel-routes.test.ts index d1c24ab81b241..0523fe5572ea0 100644 --- a/test/e2e/app-dir/css-client-side-nav-parallel-routes/css-client-side-nav-parallel-routes.test.ts +++ b/test/e2e/app-dir/css-client-side-nav-parallel-routes/css-client-side-nav-parallel-routes.test.ts @@ -1,4 +1,5 @@ import { nextTestSetup } from 'e2e-utils' +import { retry } from 'next-test-utils' describe('css-client-side-nav-parallel-routes', () => { const { next } = nextTestSetup({ @@ -9,11 +10,15 @@ describe('css-client-side-nav-parallel-routes', () => { it('should apply styles after navigation', async () => { const browser = await next.browser('/source') await browser.elementByCss('a').click() - expect( - await browser.elementByCss('#global').getComputedCss('background-color') - ).toBe('rgb(0, 255, 0)') - expect( - await browser.elementByCss('#module').getComputedCss('background-color') - ).toBe('rgb(0, 255, 0)') + + // transition might not be instant so we wrap in retry + retry(async () => { + expect( + await browser.elementByCss('#global').getComputedCss('background-color') + ).toBe('rgb(0, 255, 0)') + expect( + await browser.elementByCss('#module').getComputedCss('background-color') + ).toBe('rgb(0, 255, 0)') + }) }) }) diff --git a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts index 6d7ae2ffdcd69..3a2cb1c6c0fc6 100644 --- a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts +++ b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts @@ -463,17 +463,14 @@ describe('app dir - metadata dynamic routes', () => { } ` - const outputBeforeFetch = next.cliOutput + '' + const originalOutputIndex = next.cliOutput.length await next.patchFile(iconFilePath, contentMissingIdProperty) await next.fetch('/metadata-base/unset/icon/100') - const outputAfterFetch = next.cliOutput + '' - const output = outputAfterFetch.replace(outputBeforeFetch, '') - try { await check(async () => { - expect(output).toContain( + expect(next.cliOutput.substring(originalOutputIndex)).toContain( `id property is required for every item returned from generateImageMetadata` ) return 'success' @@ -504,17 +501,14 @@ describe('app dir - metadata dynamic routes', () => { ] }` - const outputBeforeFetch = next.cliOutput + '' + const originalOutputIndex = next.cliOutput.length await next.patchFile(sitemapFilePath, contentMissingIdProperty) await next.fetch('/metadata-base/unset/sitemap/0') - const outputAfterFetch = next.cliOutput + '' - const output = outputAfterFetch.replace(outputBeforeFetch, '') - try { await check(async () => { - expect(output).toContain( + expect(next.cliOutput.substring(originalOutputIndex)).toContain( `id property is required for every item returned from generateSitemaps` ) return 'success'