mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Added missing selectOrderBy in visualize_page, and try loop around getting line chart data
This commit is contained in:
parent
218f29f051
commit
fb526944ff
2 changed files with 22 additions and 12 deletions
|
@ -95,18 +95,20 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.visualize.getLineChartData('fill="#57c17b"')
|
||||
.then(function showData(data) {
|
||||
PageObjects.common.debug('data=' + data);
|
||||
PageObjects.common.saveScreenshot('Visualize-line-chart');
|
||||
var tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (var x = 0; x < data.length; x++) {
|
||||
PageObjects.common.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
PageObjects.common.debug('Done');
|
||||
return PageObjects.common.try(function () {
|
||||
return PageObjects.visualize.getLineChartData('fill="#57c17b"')
|
||||
.then(function showData(data) {
|
||||
PageObjects.common.debug('data=' + data);
|
||||
PageObjects.common.saveScreenshot('Visualize-line-chart');
|
||||
var tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (var x = 0; x < data.length; x++) {
|
||||
PageObjects.common.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
PageObjects.common.debug('Done');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -247,6 +247,14 @@ export default class VisualizePage {
|
|||
.click();
|
||||
}
|
||||
|
||||
selectOrderBy(fieldValue) {
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('select[name="orderBy"] > option[value="' + fieldValue + '"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
|
||||
getInterval() {
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue