Was having intermittent problems with errors just before or after clicking Visualize tab and started some work towards verifying the URL after the click.

This commit is contained in:
LeeDr 2015-10-19 17:34:46 -05:00 committed by Joe Fleming
parent 06ec901764
commit 05684c6326

View file

@ -1,11 +1,19 @@
// in test/support/pages/HeaderPage.js
define(function (require) {
var Common = require('./Common');
var url = require('intern/dojo/node!url');
var expect = require('intern/dojo/node!expect.js');
var common;
// the page object is created as a constructor
// so we can provide the remote Command object
// at runtime
function HeaderPage(remote) {
this.remote = remote;
common = new Common(this.remote);
}
var defaultTimeout = 5000;
@ -14,6 +22,7 @@ define(function (require) {
constructor: HeaderPage,
clickDiscover: function clickDiscover() {
common.log('Click Discover tab');
return this.remote
.setFindTimeout(defaultTimeout)
.findByCssSelector('a[href*=\'discover\']')
@ -21,15 +30,30 @@ define(function (require) {
return tab.click();
});
},
clickVisualize: function clickVisualize() {
return this.remote
.setFindTimeout(defaultTimeout)
.findByCssSelector('a[href*=\'visualize\']')
.then(function (tab) {
return tab.click();
});
var self = this.remote;
common.log('Click Visualize tab');
return common.tryForTime(5000, function () {
return self
.setFindTimeout(defaultTimeout)
.findByCssSelector('a[href*=\'visualize\']')
.then(function (tab) {
return tab.click()
.then(function checkUrl() {
return self
.getCurrentUrl()
.then(function logUrl(currentUrl) {
common.log('currentUrl = ' + currentUrl);
expect(currentUrl).to.contain('visualize');
});
});
});
});
},
clickDashboard: function clickDashboard() {
common.log('Click Dashboard tab');
return this.remote
.setFindTimeout(defaultTimeout)
.findByCssSelector('a[href*=\'dashboard\']')
@ -37,7 +61,9 @@ define(function (require) {
return tab.click();
});
},
clickSettings: function clickSettings() {
common.log('Click Settings tab');
return this.remote
.setFindTimeout(defaultTimeout)
.findByCssSelector('a[href*=\'settings\']')