Skip to content

Commit 460d294

Browse files
committed
Check for submit button to be disabled
1 parent 313f794 commit 460d294

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

test/functional/page_objects/discover_page.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,16 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
5151
public async saveSearch(searchName: string) {
5252
await this.clickSaveSearchButton();
5353
// preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted
54-
await retry.waitFor(`saved search can be persisted name ${searchName}`, async () => {
55-
await testSubjects.setValue('savedObjectTitle', searchName);
56-
await testSubjects.click('confirmSaveSavedObjectButton');
57-
return (await header.isGlobalLoadingIndicatorVisible()) === true;
58-
});
54+
await retry.waitFor(
55+
`saved search title is set to ${searchName} and save button is clickable`,
56+
async () => {
57+
const saveButton = await testSubjects.find('confirmSaveSavedObjectButton');
58+
await testSubjects.setValue('savedObjectTitle', searchName);
59+
return (await saveButton.getAttribute('disabled')) !== 'true';
60+
}
61+
);
62+
await testSubjects.click('confirmSaveSavedObjectButton');
63+
await header.waitUntilLoadingHasFinished();
5964
// LeeDr - this additional checking for the saved search name was an attempt
6065
// to cause this method to wait for the reloading of the page to complete so
6166
// that the next action wouldn't have to retry. But it doesn't really solve

0 commit comments

Comments
 (0)