Skip to content

Commit

Permalink
[Discover] Improve Discover histogram time range tests (elastic#71056)
Browse files Browse the repository at this point in the history
* Improve Discover histogram tests

* Use includes function to find a string

Co-authored-by: Elastic Machine <[email protected]>
# Conflicts:
#	test/functional/apps/discover/_discover.js
  • Loading branch information
kertal committed Jul 30, 2020
1 parent 14bfd45 commit 310779f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,22 @@ export default function ({ getService, getPageObjects }) {
});

it('should modify the time range when a bar is clicked', async function () {
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
await PageObjects.visualize.waitForVisualization();
await PageObjects.discover.clickHistogramBar(0);
await PageObjects.visualize.waitForVisualization();
const actualTimeString = await PageObjects.header.getPrettyDuration();
expect(actualTimeString).to.be('September 20th 2015, 00:00:00.000 to September 20th 2015, 03:00:00.000');
await PageObjects.timePicker.setDefaultAbsoluteRange();
await PageObjects.discover.clickHistogramBar();
const time = await PageObjects.timePicker.getTimeConfig();
expect(time.start).to.be('Sep 21, 2015 @ 09:00:00.000');
expect(time.end).to.be('Sep 21, 2015 @ 12:00:00.000');
const rowData = await PageObjects.discover.getDocTableField(1);
expect(rowData).to.have.string('Sep 21, 2015 @ 11:59:22.316');
});

// FAILING: https://github.com/elastic/kibana/issues/38361
it.skip('should modify the time range when the histogram is brushed', async function () {
it('should modify the time range when the histogram is brushed', async function () {
await PageObjects.header.setAbsoluteRange(fromTime, toTime);
await PageObjects.visualize.waitForVisualization();
await PageObjects.discover.brushHistogram(0, 1);
await PageObjects.visualize.waitForVisualization();
const actualTimeString = await PageObjects.header.getPrettyDuration();
expect(actualTimeString).to.be('September 19th 2015, 23:52:17.080 to September 20th 2015, 02:59:51.112');
expect(actualTimeString).to.be('September 19th 2015, 23:53:43.254 to September 20th 2015, 02:52:36.173');
});

it('should show correct initial chart interval of Auto', async function () {
Expand Down

0 comments on commit 310779f

Please sign in to comment.