Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Fix flaky saved objects tagging functional test #155974

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
'timePicker',
'discover',
]);
const retry = getService('retry');

/**
* Select tags in the searchbar's tag filter.
Expand Down Expand Up @@ -118,6 +119,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

it('allows to create a tag from the tag selector', async () => {
await PageObjects.discover.clickSaveSearchButton();
const searchName = 'search-with-new-tag';
// preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted
await retry.waitFor(
`saved search title is set to ${searchName} and save button is clickable`,
async () => {
const saveButton = await testSubjects.find('confirmSaveSavedObjectButton');
await testSubjects.setValue('savedObjectTitle', searchName);
return (await saveButton.getAttribute('disabled')) !== 'true';
}
);
await testSubjects.setValue('savedObjectTitle', 'search-with-new-tag');
await testSubjects.click('savedObjectTagSelector');
await testSubjects.click(`tagSelectorOption-action__create`);
Expand Down