Skip to content

Commit

Permalink
Fix preview button in test spec 2
Browse files Browse the repository at this point in the history
  • Loading branch information
simison committed Mar 25, 2020
1 parent 03cb1f0 commit d7c034c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/e2e/lib/gutenberg/gutenberg-editor-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,20 @@ export default class GutenbergEditorComponent extends AsyncBaseContainer {
this.explicitWaitMS
);
}
await driverHelper.clickWhenClickable(

return await driverHelper.clickWhenClickable(
this.driver,
// @TODO: Update to new `.editor-post-preview__dropdown` format once we support it again
// https://github.com/Automattic/wp-calypso/issues/40401
By.css( '.editor-post-preview' ),
this.explicitWaitMS
);
const editorPostPreviewSelector = By.css( '.editor-post-preview__button-external' );
await driverHelper.waitTillPresentAndDisplayed( this.driver, editorPostPreviewSelector );
return await driverHelper.clickWhenClickable( this.driver, editorPostPreviewSelector );
// @TODO: Enable again once we support dropdown preview again
// https://github.com/Automattic/wp-calypso/issues/40401
//
// const editorPostPreviewSelector = By.css( '.editor-post-preview__button-external' );
// await driverHelper.waitTillPresentAndDisplayed( this.driver, editorPostPreviewSelector );
// return await driverHelper.clickWhenClickable( this.driver, editorPostPreviewSelector );
}

async revertToDraft() {
Expand Down

0 comments on commit d7c034c

Please sign in to comment.