Skip to content

Commit

Permalink
E2E tests: Handle upgrade screen (#28592)
Browse files Browse the repository at this point in the history
E2E tests might get stuck on the "Database Update Required" screen. This PR takes care of the screen by automatically clicking on update.
  • Loading branch information
david-szabo97 authored Feb 4, 2021
1 parent 90d69b2 commit ddee0f4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/e2e-test-utils/src/visit-admin-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ import { getPageError } from './get-page-error';
export async function visitAdminPage( adminPath, query ) {
await page.goto( createURL( join( 'wp-admin', adminPath ), query ) );

// Handle upgrade required screen
if ( isCurrentURL( 'wp-admin/upgrade.php' ) ) {
// Click update
await page.click( '.button.button-large.button-primary' );
// Click continue
await page.click( '.button.button-large' );
}

if ( isCurrentURL( 'wp-login.php' ) ) {
await loginUser();
await visitAdminPage( adminPath, query );
Expand Down

0 comments on commit ddee0f4

Please sign in to comment.