mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
fix deleteAllVisualizations() (#41062)
This commit is contained in:
parent
ea2cb5df88
commit
236bc83947
3 changed files with 13 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue