Skip to content

Commit

Permalink
[Discover] Fix customization flaky test (#180940)
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta authored Apr 16, 2024
1 parent 6184129 commit d769242
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
17 changes: 10 additions & 7 deletions test/examples/discover_customization_examples/customizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const dataGrid = getService('dataGrid');
const retry = getService('retry');
const defaultSettings = { defaultIndex: 'logstash-*' };

describe('Customizations', () => {
Expand Down Expand Up @@ -61,13 +62,15 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
await testSubjects.click('logsViewSelectorButton');
await testSubjects.click('logsViewSelectorOption-ASavedSearch');
await PageObjects.header.waitUntilLoadingHasFinished();
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
const expected = {
title: 'A Saved Search',
description: 'A Saved Search Description',
};
expect(title).to.eql(expected.title);
expect(description).to.eql(expected.description);
await retry.try(async () => {
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
const expected = {
title: 'A Saved Search',
description: 'A Saved Search Description',
};
expect(title).to.eql(expected.title);
expect(description).to.eql(expected.description);
});
});

it('Search bar Prepend Filters exists and should apply filter properly', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const dataGrid = getService('dataGrid');
const retry = getService('retry');
const defaultSettings = { defaultIndex: 'logstash-*' };

describe('Customizations', () => {
Expand Down Expand Up @@ -60,13 +61,15 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
await testSubjects.click('logsViewSelectorButton');
await testSubjects.click('logsViewSelectorOption-ASavedSearch');
await PageObjects.header.waitUntilLoadingHasFinished();
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
const expected = {
title: 'A Saved Search',
description: 'A Saved Search Description',
};
expect(title).to.eql(expected.title);
expect(description).to.eql(expected.description);
await retry.try(async () => {
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
const expected = {
title: 'A Saved Search',
description: 'A Saved Search Description',
};
expect(title).to.eql(expected.title);
expect(description).to.eql(expected.description);
});
});

it('Search bar Prepend Filters exists and should apply filter properly', async () => {
Expand Down

0 comments on commit d769242

Please sign in to comment.