From 3b97fd2496cea7727b54a5ee80b120cf3e26147a Mon Sep 17 00:00:00 2001 From: Julia Amosova Date: Sun, 23 Dec 2018 16:30:20 +0000 Subject: [PATCH 1/3] Add `waitTillPresentAndDisplayed` to `clickPurchaseButton` function --- lib/pages/jetpack-plans-sales-page.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/jetpack-plans-sales-page.js b/lib/pages/jetpack-plans-sales-page.js index e5b54c7ca..6869774e3 100755 --- a/lib/pages/jetpack-plans-sales-page.js +++ b/lib/pages/jetpack-plans-sales-page.js @@ -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 ); } } From 9d670bffc43baecf0667af2ae716fb8baaa69280 Mon Sep 17 00:00:00 2001 From: Julia Amosova Date: Sun, 23 Dec 2018 16:31:05 +0000 Subject: [PATCH 2/3] Add `waitTillPresentAndDisplayed` to `clickUpgradeNudge` function --- lib/pages/wp-admin/wp-admin-jetpack-page.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/wp-admin/wp-admin-jetpack-page.js b/lib/pages/wp-admin/wp-admin-jetpack-page.js index 58da80100..959ed6336 100644 --- a/lib/pages/wp-admin/wp-admin-jetpack-page.js +++ b/lib/pages/wp-admin/wp-admin-jetpack-page.js @@ -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 ); } From ec8430a1929561364b3df62d55691930f9a7f723 Mon Sep 17 00:00:00 2001 From: Julia Amosova Date: Sun, 23 Dec 2018 16:32:22 +0000 Subject: [PATCH 3/3] Remove `sleep` statements --- specs-jetpack-calypso/wp-jetpack-plans-spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/specs-jetpack-calypso/wp-jetpack-plans-spec.js b/specs-jetpack-calypso/wp-jetpack-plans-spec.js index 3fa63a873..3a990b498 100755 --- a/specs-jetpack-calypso/wp-jetpack-plans-spec.js +++ b/specs-jetpack-calypso/wp-jetpack-plans-spec.js @@ -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(); } );