Skip to content

Commit

Permalink
Don't setup load promises before navigation; Playwright doesn't work …
Browse files Browse the repository at this point in the history
…that way
  • Loading branch information
Mark George committed Dec 15, 2021
1 parent 36fc009 commit edea4ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions tools/e2e-commons/pages/wp-admin/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ export default class WPLoginPage extends WpPage {
await this.fill( '#user_login', credentials.username );
await this.fill( '#user_pass', credentials.password );

const navigationPromise = this.waitForDomContentLoaded();
await this.click( '#wp-submit' );
await navigationPromise;
await this.waitForDomContentLoaded();

try {
await this.waitForElementToBeHidden( this.selectors[ 0 ] );
Expand Down
6 changes: 2 additions & 4 deletions tools/e2e-commons/pages/wp-admin/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ export default class PluginsPage extends WpPage {

async deactivatePlugin( pluginSlug ) {
const selector = `tr[data-slug='${ pluginSlug }'] a[href*='=deactivate']`;
const navigationPromise = this.waitForLoad();
await this.click( selector );
await navigationPromise;
await this.waitForLoad();
}

async activatePlugin( pluginSlug ) {
const selector = `tr[data-slug='${ pluginSlug }'] a[href*='=activate']`;
const navigationPromise = this.waitForLoad();
await this.click( selector );
await navigationPromise;
await this.waitForLoad();
}

async isFullScreenPopupShown() {
Expand Down
3 changes: 1 addition & 2 deletions tools/e2e-commons/pages/wp-admin/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ export default class ThemesPage extends WpPage {

async activateTheme( themeSlug ) {
const selector = `div[data-slug='${ themeSlug }'] a[href*='=activate']`;
const navigationPromise = this.waitForLoad();
await this.click( selector );
await navigationPromise;
await this.waitForLoad();
}
}

0 comments on commit edea4ec

Please sign in to comment.