diff --git a/test/functional/apps/visualize/_visualize_listing.js b/test/functional/apps/visualize/_visualize_listing.js index fda15510b4691..51f6497f63e8e 100644 --- a/test/functional/apps/visualize/_visualize_listing.js +++ b/test/functional/apps/visualize/_visualize_listing.js @@ -35,7 +35,6 @@ export default function ({ getPageObjects }) { it('create new viz', async function () { // type markdown is used for simplicity await PageObjects.visualize.createSimpleMarkdownViz(vizName); - await PageObjects.visualize.gotoVisualizationLandingPage(); const visCount = await PageObjects.visualize.getCountOfItemsInListingTable(); expect(visCount).to.equal(1); diff --git a/test/functional/page_objects/common_page.js b/test/functional/page_objects/common_page.js index f62f9f643b465..11f44ae6442cb 100644 --- a/test/functional/page_objects/common_page.js +++ b/test/functional/page_objects/common_page.js @@ -285,7 +285,7 @@ export function CommonPageProvider({ getService, getPageObjects }) { */ async ensureModalOverlayHidden() { return retry.try(async () => { - const shown = await testSubjects.exists('modalOverlay'); + const shown = await testSubjects.exists('confirmModalTitleText'); if (shown) { throw new Error('Modal overlay is showing'); } @@ -294,6 +294,8 @@ export function CommonPageProvider({ getService, getPageObjects }) { async clickConfirmOnModal() { log.debug('Clicking modal confirm'); + // make sure this data-test-subj 'confirmModalTitleText' exists because we're going to wait for it to be gone later + await testSubjects.exists('confirmModalTitleText'); await testSubjects.click('confirmModalConfirmButton'); await this.ensureModalOverlayHidden(); } diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 56f50f1d93431..fe93c5999c90a 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -78,10 +78,17 @@ export function VisualizePageProvider({ getService, getPageObjects, updateBaseli return await this.createVisualizationPromptButton(); } + /* + This method should use retry loop to delete visualizations from multiple pages until we find the createVisualizationPromptButton. + Perhaps it *could* set the page size larger than the default 10, but it might still need to loop anyway. + */ async deleteAllVisualizations() { - await this.checkListingSelectAllCheckbox(); - await this.clickDeleteSelected(); - await PageObjects.common.clickConfirmOnModal(); + await retry.try(async () => { + await this.checkListingSelectAllCheckbox(); + await this.clickDeleteSelected(); + await PageObjects.common.clickConfirmOnModal(); + await testSubjects.find('createVisualizationPromptButton'); + }); } async createSimpleMarkdownViz(vizName) {