From 3254aac8d9406cd5c78cb33409fc0b5d138c75a3 Mon Sep 17 00:00:00 2001 From: Patrick Thiel Date: Fri, 13 Dec 2019 15:51:49 -0500 Subject: [PATCH 1/3] fix longview tests --- .../longview/longview-landing.page.js | 3 ++- .../longview/longview-plan-details.page.js | 16 ++++++++-------- .../specs/longview/longview-plan-details.spec.js | 7 ++++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/manager/e2e/pageobjects/longview/longview-landing.page.js b/packages/manager/e2e/pageobjects/longview/longview-landing.page.js index ef043e688be..5330397e1e4 100644 --- a/packages/manager/e2e/pageobjects/longview/longview-landing.page.js +++ b/packages/manager/e2e/pageobjects/longview/longview-landing.page.js @@ -1,4 +1,5 @@ const { assertLog } = require('../../utils/assertionLog'); +const { constants } = require('../../constants'); import Page from '../page'; class LongviewLanding extends Page { @@ -116,7 +117,7 @@ class LongviewLanding extends Page { this.deleteButton.click(); this.dialogAlert.waitForDisplayed(); this.lvDelete.click(); - this.dialogAlert.waitForDisplayed(true); + this.dialogAlert.waitForExist(constants.wait.normal, true); } deleteLVClientsAPI(token, lvClients) { diff --git a/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js b/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js index 72adf523fb0..1c3e5b73b79 100644 --- a/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js +++ b/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js @@ -49,8 +49,8 @@ class LongviewPlanDetails extends Page { isCurrentPlan(clientCount) { return $( - `[data-testid=lv-sub-table-row-longview-${clientCount}] [data-testid=current-plan]` - ).isDisplayed(); + `[data-testid="lv-sub-table-row-longview-${clientCount}"] [data-testid="current-plan"]` + ).isExisting(); } resetToFree() { @@ -104,13 +104,13 @@ class LongviewPlanDetails extends Page { expect(this.isCurrentPlan(clientCount)) .withContext(`should be current plan`) .toBe(true); - expect(planRow.$('data-qa-radio=true]')) - .withContext(`Plan radio button ${assertLog.enabled}`) - .toBe(true); + // expect(planRow.$('[data-qa-radio="true"]')) + // .withContext(`Plan radio button ${assertLog.enabled}`) + // .toBe(true); - expect(this.changePlanButton.isEnabled()) - .withContext(`Change plan button ${assertLog.notEnabled}`) - .toBe(false); + // expect(this.changePlanButton.isEnabled()) + // .withContext(`Change plan button ${assertLog.notEnabled}`) + // .toBe(false); } // Used for selecting or using any longview plan row selectLongviewPlan(clientCount) { diff --git a/packages/manager/e2e/specs/longview/longview-plan-details.spec.js b/packages/manager/e2e/specs/longview/longview-plan-details.spec.js index 89e4743487b..783e417f1cd 100644 --- a/packages/manager/e2e/specs/longview/longview-plan-details.spec.js +++ b/packages/manager/e2e/specs/longview/longview-plan-details.spec.js @@ -91,12 +91,13 @@ describe('longview suite', () => { LongviewPlan.planDetailsDisplay(); } }); + it('checks that longview plan can be changed', () => { - // checks for managed account + // // checks for managed account expect(LongviewLanding.checkForManaged(token)) .withContext(`${managedAccount}`) .toBe(false); - // Changes a plan + // // Changes a plan expect(LongviewPlan.isCurrentPlan('free')) .withContext(`free plan should be set`) .toBe(true); @@ -117,7 +118,7 @@ describe('longview suite', () => { const lvError = `Too many active Longview clients (${clientCount.length}) for the subscription selected (3). Select a larger subscription or reduce the number of Longview clients.`; LongviewPlan.lv3Plan.click(); LongviewPlan.changePlanButton.click(); - $('[data-qa-notice').waitForDisplayed(); + $('[data-qa-notice]').waitForDisplayed(); expect($('[data-qa-error="true"]').isDisplayed()) .withContext(`Client count error ${assertLog.displayed}`) .toBe(true); From c35be39c545bf7579bd38ebaf557dd2a64dedc2c Mon Sep 17 00:00:00 2001 From: Patrick Thiel Date: Fri, 13 Dec 2019 16:11:01 -0500 Subject: [PATCH 2/3] re-enable assertions --- .../longview/longview-plan-details.page.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js b/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js index 1c3e5b73b79..bbd16f1ab85 100644 --- a/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js +++ b/packages/manager/e2e/pageobjects/longview/longview-plan-details.page.js @@ -104,13 +104,13 @@ class LongviewPlanDetails extends Page { expect(this.isCurrentPlan(clientCount)) .withContext(`should be current plan`) .toBe(true); - // expect(planRow.$('[data-qa-radio="true"]')) - // .withContext(`Plan radio button ${assertLog.enabled}`) - // .toBe(true); + expect(planRow.$('[data-qa-radio="true"]').isEnabled()) + .withContext(`Plan radio button ${assertLog.enabled}`) + .toBe(true); - // expect(this.changePlanButton.isEnabled()) - // .withContext(`Change plan button ${assertLog.notEnabled}`) - // .toBe(false); + expect(this.changePlanButton.isEnabled()) + .withContext(`Change plan button ${assertLog.notEnabled}`) + .toBe(false); } // Used for selecting or using any longview plan row selectLongviewPlan(clientCount) { From 0c2c09260fe9cc0aebd23920123aa38c601c344a Mon Sep 17 00:00:00 2001 From: Patrick Thiel Date: Fri, 13 Dec 2019 16:12:47 -0500 Subject: [PATCH 3/3] add missing runner configuration --- packages/manager/e2e/config/wdio.conf.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/manager/e2e/config/wdio.conf.js b/packages/manager/e2e/config/wdio.conf.js index ceca91dd56a..eb960dcab36 100644 --- a/packages/manager/e2e/config/wdio.conf.js +++ b/packages/manager/e2e/config/wdio.conf.js @@ -85,6 +85,7 @@ exports.config = { // debug: true, // execArgv: ['--inspect=127.0.0.1:5859'], // Selenium Host/Port + runner: 'local', hostname: process.env.DOCKER ? 'selenium' : 'localhost', port: 4444, //