One new discover test for issue #5937 use back button.

This commit is contained in:
LeeDr 2016-05-31 23:36:25 -05:00
parent 9fe89d9e66
commit 43c7257b88
2 changed files with 37 additions and 3 deletions

View file

@ -152,7 +152,7 @@ import {
];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(8000);
return common.sleep(4000);
})
.then(function () {
return verifyChartData(expectedBarChartData);
@ -167,7 +167,7 @@ import {
];
return discoverPage.setChartInterval(chartInterval)
.then(function () {
return common.sleep(8000);
return common.sleep(4000);
})
.then(function () {
return verifyChartData(expectedBarChartData);
@ -188,6 +188,26 @@ import {
.catch(common.handleError(this));
});
bdd.it('browser back button should show previous interval Daily', function () {
var expectedChartInterval = 'Daily';
var expectedBarChartData = [
'133.196', '129.192', '129.724'
];
return this.remote.goBack()
.then(function () {
return common.try(function tryingForTime() {
return discoverPage.getChartInterval()
.then(function (actualInterval) {
expect(actualInterval).to.be(expectedChartInterval);
});
});
})
.then(function () {
return verifyChartData(expectedBarChartData);
})
.catch(common.handleError(this));
});
bdd.it('should show correct data for chart interval Monthly', function () {
var chartInterval = 'Monthly';
var expectedBarChartData = [ '122.535'];

View file

@ -100,7 +100,21 @@ export default (function () {
getChartInterval: function getChartInterval() {
return thisTime
.findByCssSelector('a[ng-click="toggleInterval()"]')
.getVisibleText();
.getVisibleText()
.then(function (intervalText) {
if (intervalText.length > 0) {
return intervalText;
} else {
return thisTime
.findByCssSelector('select[ng-model="state.interval"]')
.getProperty('value') // this gets 'string:d' for Daily
.then(function (selectedValue) {
return thisTime
.findByCssSelector('option[value="' + selectedValue + '"]')
.getVisibleText();
});
}
});
},
setChartInterval: function setChartInterval(interval) {