From dfacedb27bea355e3f2199d5442ac75889df132b Mon Sep 17 00:00:00 2001 From: LeeDr Date: Mon, 20 Jun 2016 11:54:48 -0500 Subject: [PATCH] Add getSpinnerDone on clickNewSearch to fix failures --- test/support/pages/visualize_page.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/support/pages/visualize_page.js b/test/support/pages/visualize_page.js index 2ac4fbb2484d6..022b94f4bdd3d 100644 --- a/test/support/pages/visualize_page.js +++ b/test/support/pages/visualize_page.js @@ -3,13 +3,16 @@ define(function (require) { var config = require('intern').config; var registerSuite = require('intern!object'); var Common = require('./common'); + var HeaderPage = require('./header_page'); var defaultTimeout = config.timeouts.default; var common; + var headerPage; function VisualizePage(remote) { this.remote = remote; common = new Common(this.remote); + headerPage = new HeaderPage(this.remote); } VisualizePage.prototype = { @@ -122,7 +125,10 @@ define(function (require) { return this.remote .setFindTimeout(defaultTimeout * 2) .findByClassName('kbn-timepicker-go') - .click(); + .click() + .then(function () { + return headerPage.getSpinnerDone(); + }); }, collapseChart: function collapseChart() { @@ -151,7 +157,10 @@ define(function (require) { return this.remote .setFindTimeout(defaultTimeout) .findByCssSelector('li[ng-click="stepTwoMode=\'new\'"]') - .click(); + .click() + .then(function () { + return headerPage.getSpinnerDone(); + }); }, setValue: function setValue(newValue) { @@ -178,7 +187,10 @@ define(function (require) { return this.remote .setFindTimeout(defaultTimeout) .findByCssSelector('li[ng-click="stepTwoMode=\'saved\'"]') - .click(); + .click() + .then(function () { + return headerPage.getSpinnerDone(); + }); }, selectSearch: function selectSearch(searchName) { @@ -282,7 +294,10 @@ define(function (require) { return this.remote .setFindTimeout(defaultTimeout) .findByCssSelector('.btn-success') - .click(); + .click() + .then(function () { + return headerPage.getSpinnerDone(); + }); },