Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Remove and address sleep statements in wp-jetpack-plans-spec.js (#1737
Browse files Browse the repository at this point in the history
)

* Add `waitTillPresentAndDisplayed` to `clickPurchaseButton` function
* Add `waitTillPresentAndDisplayed` to `clickUpgradeNudge` function
* Remove `sleep` statements
  • Loading branch information
juliaamosova authored Dec 28, 2018
1 parent 7ccfb28 commit e5f93fe
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/pages/jetpack-plans-sales-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class JetpackPlansSalesPage extends AsyncBaseContainer {

async clickPurchaseButton() {
const selector = By.css( '.cta-install #btn-mast-getstarted' );
await driverHelper.waitTillPresentAndDisplayed( this.driver, selector );
return await driverHelper.clickWhenClickable( this.driver, selector );
}
}
1 change: 1 addition & 0 deletions lib/pages/wp-admin/wp-admin-jetpack-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default class WPAdminJetpackPage extends AsyncBaseContainer {

async clickUpgradeNudge() {
const selector = By.css( '.dops-notice a[href*="upgrade"]' );
await driverHelper.waitTillPresentAndDisplayed( this.driver, selector );
return await driverHelper.clickWhenClickable( this.driver, selector );
}

Expand Down
2 changes: 0 additions & 2 deletions specs-jetpack-calypso/wp-jetpack-plans-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ describe( `[${ host }] Jetpack Plans: (${ screenSize }) @jetpack`, function() {
step( 'Can find and click Upgrade nudge button', async function() {
await driverHelper.refreshIfJNError( driver );
const jetpackDashboard = await WPAdminJetpackPage.Expect( driver );
await driver.sleep( 3000 ); // The nudge buttons are loaded after the page, and there's no good loaded status indicator to key off of
return await jetpackDashboard.clickUpgradeNudge();
} );

step( 'Can click the Proceed button', async function() {
const jetpackPlanSalesPage = await JetpackPlanSalesPage.Expect( driver );
await driver.sleep( 3000 ); // The upgrade buttons are loaded after the page, and there's no good loaded status indicator to key off of
return await jetpackPlanSalesPage.clickPurchaseButton();
} );

Expand Down

0 comments on commit e5f93fe

Please sign in to comment.