Skip to content

Commit

Permalink
Add db connection retry
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Oct 3, 2024
1 parent a78b728 commit 890ed10
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/e2e-test-utils-playwright/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 890ed10

Please sign in to comment.