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

Remove and address sleep statements in wp-jetpack-plans-spec.js #1737

Merged
merged 3 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -33,6 +33,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