[8.2] [Discover] Fix modify the time range test (#130880) (#133621)

* [Discover] Fix modify the time range test (#130880)

* [Discover] unskip tests for check flakyness

* [Discover] fix the test

* [Discover] update expected string

* [Discover] open close full screen mode for data grid when needed

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d5ae7f33b7)

* [Discover] remove redundant substring
This commit is contained in:
Dmitry Tomashevich 2022-06-06 17:42:14 +03:00 committed by GitHub
parent 3b12ddc9d1
commit 0a9ddce98a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -25,8 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
defaultIndex: 'logstash-*',
};
// FLAKY: https://github.com/elastic/kibana/issues/130694
describe.skip('discover test', function describeIndexTests() {
describe('discover test', function describeIndexTests() {
before(async function () {
log.debug('load kibana index with default index pattern');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
@ -96,8 +95,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(time.start).to.be('Sep 21, 2015 @ 12:00:00.000');
expect(time.end).to.be('Sep 21, 2015 @ 15:00:00.000');
await retry.waitForWithTimeout(
'doc table to contain the right search result',
1000,
'table to contain the right search result',
3000,
async () => {
const rowData = await PageObjects.discover.getDocTableField(1);
log.debug(`The first timestamp value in doc table: ${rowData}`);

View file

@ -280,8 +280,10 @@ export class DiscoverPageObject extends FtrService {
);
return await fields[usedCellIdx].getVisibleText();
}
await this.testSubjects.click('dataGridFullScreenButton');
const row = await this.dataGrid.getRow({ rowIndex: index - 1 });
const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText()));
const result = await Promise.all(row.map(async (cell) => (await cell.getVisibleText()).trim()));
await this.testSubjects.click('dataGridFullScreenButton');
return result[usedCellIdx];
}