Skip to content

Commit

Permalink
[Discover] Unskip "classic doc table" flaky test (#140786)
Browse files Browse the repository at this point in the history
* [Discover] Unskip flaky test

* [Discover] Fix async tests

* [Discover] Try again

* [Discover] Try again

* [Discover] Try again

* [Discover] Try again

* [Discover] Try to skip a subtest

* [Discover] Try to skip a subtest

* [Discover] Try to modify the test

* [Discover] Add some logging

* [Discover] Return the async

* [Discover] Wait for ui

* [Discover] Suppress tooltips

* [Discover] Suppress tooltips

* [Discover] Fix api usage

* [Discover] Cleanup

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
jughosta and kibanamachine authored Oct 28, 2022
1 parent ba227dc commit 48e1b5c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions test/functional/apps/discover/classic/_doc_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);
const defaultSettings = {
defaultIndex: 'logstash-*',
hideAnnouncements: true,
};
const testSubjects = getService('testSubjects');

// FLAKY Chrome 103+ https://github.com/elastic/kibana/issues/138652
describe.skip('discover doc table', function describeIndexTests() {
describe('discover doc table', function describeIndexTests() {
const rowsHardLimit = 500;

before(async function () {
log.debug('load kibana index with default index pattern');
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');

// and load a set of makelogs data
Expand All @@ -42,6 +42,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

after(async function () {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json');
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.uiSettings.replace({});
});

Expand Down Expand Up @@ -140,7 +142,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(skipButtonText === activeElementText).to.be(true);
});

describe('expand a document row', function () {
describe('expand a document row', async function () {
const rowToInspect = 1;
beforeEach(async function () {
// close the toggle if open
Expand Down Expand Up @@ -194,16 +196,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(defaultMessageElResubmit).to.be.ok();
});
});

it('should show allow toggling columns from the expanded document', async function () {
await PageObjects.discover.clickNewSearchButton();
await testSubjects.click('dscExplorerCalloutClose');
await retry.try(async function () {
await docTable.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });

// add columns
const fields = ['_id', '_index', 'agent'];
for (const field of fields) {
await testSubjects.click(`toggleColumnButton-${field}`);
await testSubjects.click(`tableDocViewRow-${field}`); // to suppress the appeared tooltip
}

const headerWithFields = await docTable.getHeaderFields();
Expand All @@ -212,6 +215,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// remove columns
for (const field of fields) {
await testSubjects.click(`toggleColumnButton-${field}`);
await testSubjects.click(`tableDocViewRow-${field}`);
}

const headerWithoutFields = await docTable.getHeaderFields();
Expand All @@ -220,7 +224,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});

describe('add and remove columns', function () {
describe('add and remove columns', async function () {
const extraColumns = ['phpmemory', 'ip'];

afterEach(async function () {
Expand All @@ -234,6 +238,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
for (const column of extraColumns) {
await PageObjects.discover.clearFieldSearchInput();
await PageObjects.discover.findFieldByName(column);
await retry.waitFor('field to appear', async function () {
return await testSubjects.exists(`field-${column}`);
});
await PageObjects.discover.clickFieldListItemAdd(column);
await PageObjects.header.waitUntilLoadingHasFinished();
// test the header now
Expand All @@ -247,7 +254,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
for (const column of extraColumns) {
await PageObjects.discover.clearFieldSearchInput();
await PageObjects.discover.findFieldByName(column);
log.debug(`add a ${column} column`);
await retry.waitFor('field to appear', async function () {
return await testSubjects.exists(`field-${column}`);
});
await PageObjects.discover.clickFieldListItemAdd(column);
await PageObjects.header.waitUntilLoadingHasFinished();
}
Expand Down

0 comments on commit 48e1b5c

Please sign in to comment.