Skip to content

Commit

Permalink
checking for flakiness of index pattern filter test (#144180)
Browse files Browse the repository at this point in the history
* checking for flakiness of index pattern filter test

* added a small code change to check if the popover is open
  • Loading branch information
rashmivkulkarni authored Oct 31, 2022
1 parent 4695c9a commit e92b384
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 3 additions & 4 deletions test/functional/apps/management/_index_pattern_filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const retry = getService('retry');
const PageObjects = getPageObjects(['settings']);
const esArchiver = getService('esArchiver');

// Failing: See https://github.com/elastic/kibana/issues/143109
describe.skip('index pattern filter', function describeIndexTests() {
describe('index pattern filter', function describeIndexTests() {
before(async function () {
await esArchiver.emptyKibanaIndex();
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.uiSettings.replace({});
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
Expand All @@ -30,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

afterEach(async function () {
await PageObjects.settings.removeIndexPattern();
await kibanaServer.savedObjects.cleanStandardList();
});

it('should filter indexed fields', async function () {
Expand Down
14 changes: 10 additions & 4 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,11 @@ export class SettingsPageObject extends FtrService {
}

async clearFieldTypeFilter(type: string) {
await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown');
await this.retry.try(async () => {
await this.testSubjects.existOrFail('indexedFieldTypeFilterDropdown-popover');
await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown');
await this.find.byCssSelector(
'.euiPopover-isOpen[data-test-subj="indexedFieldTypeFilterDropdown-popover"]'
);
});
await this.retry.try(async () => {
await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}-checked`);
Expand All @@ -319,8 +321,12 @@ export class SettingsPageObject extends FtrService {
}

async setFieldTypeFilter(type: string) {
await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown');
await this.testSubjects.existOrFail('indexedFieldTypeFilterDropdown-popover');
await this.retry.try(async () => {
await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown');
await this.find.byCssSelector(
'.euiPopover-isOpen[data-test-subj="indexedFieldTypeFilterDropdown-popover"]'
);
});
await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}`);
await this.testSubjects.click(`indexedFieldTypeFilterDropdown-option-${type}`);
await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}-checked`);
Expand Down

0 comments on commit e92b384

Please sign in to comment.