[Discover] Improve brushing test (#97830)

This commit is contained in:
Matthias Wilhelm 2021-06-29 18:33:27 +02:00 committed by GitHub
parent 7ff28959b1
commit 1d99cae32b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,6 +120,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
return actualCount === expectedCount;
});
const prevRowData = await PageObjects.discover.getDocTableField(1);
log.debug(`The first timestamp value in doc table before brushing: ${prevRowData}`);
await PageObjects.discover.brushHistogram();
await PageObjects.discover.waitUntilSearchingHasFinished();
await retry.waitFor('chart rendering complete after being brushed', async () => {
@ -133,12 +135,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours();
expect(Math.round(newDurationHours)).to.be(26);
await retry.waitFor('doc table to contain the right search result', async () => {
await retry.waitFor('doc table containing the documents of the brushed range', async () => {
const rowData = await PageObjects.discover.getDocTableField(1);
log.debug(`The first timestamp value in doc table: ${rowData}`);
const dateParsed = Date.parse(rowData);
// compare against the parsed date of Sep 20, 2015 @ 17:30:00.000 and Sep 20, 2015 @ 23:30:00.000
return dateParsed >= 1442770200000 && dateParsed <= 1442791800000;
log.debug(`The first timestamp value in doc table after brushing: ${rowData}`);
return prevRowData !== rowData;
});
});