diff --git a/packages/e2e-test-utils-playwright/src/test.ts b/packages/e2e-test-utils-playwright/src/test.ts index 6ef614024d7d97..5ba49c963989f6 100644 --- a/packages/e2e-test-utils-playwright/src/test.ts +++ b/packages/e2e-test-utils-playwright/src/test.ts @@ -144,6 +144,23 @@ const test = base.extend< page: async ( { page }, use ) => { page.on( 'console', observeConsoleLogging ); + await expect + .poll( + async () => { + const response = await page.request.get( '/' ); + const html = await response.text(); + + return html.includes( + 'Error establishing a database connection' + ); + }, + { + message: 'ensure database is connected', + timeout: 10000, + } + ) + .toBeFalsy(); + await use( page ); // Clear local storage after each test.