Skip to content

Commit

Permalink
update selectSiteEditor sidebar method (#57906)
Browse files Browse the repository at this point in the history
  • Loading branch information
Addison-Stavlo authored Nov 10, 2021
1 parent 46b7803 commit b5fea2b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/e2e/lib/components/sidebar-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ export default class SidebarComponent extends AsyncBaseContainer {
}

async selectSiteEditor() {
return await driverHelper.clickWhenClickable(
this.driver,
By.css( '.menu-link-text[data-e2e-sidebar*="Site Editor"]' )
);
// This menu location is being removed with 11.9. Once the new menu location under
// 'Appearance' is stable, we can remove this old menu handling.
const oldMenuSelector = By.css( '.menu-link-text[data-e2e-sidebar*="Site Editor"]' );
const isOldMenuPresent = await driverHelper.isElementLocated( this.driver, oldMenuSelector );
if ( isOldMenuPresent ) {
return await driverHelper.clickWhenClickable( this.driver, oldMenuSelector );
}

await this.expandDrawerItem( 'Appearance' );
return await this._scrollToAndClickMenuItem( 'Editor' );
}

async selectWPAdmin() {
Expand Down

0 comments on commit b5fea2b

Please sign in to comment.