fix deleteAllVisualizations() (#41062)

This commit is contained in:
Lee Drengenberg 2019-07-16 14:49:48 -05:00 committed by GitHub
parent ea2cb5df88
commit 236bc83947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

View file

@ -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);

View file

@ -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();
}

View file

@ -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) {