mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
SO Tagging: fix flaky test and re-enable it (#82930)
* fix flaky test and re-enable it
* wait for table to load before to perform operations
* move everything out of ciGroup2 for flaky test runner
* add debug block for flaky runner
* use correct vis name
* remove test sync
* Revert "move everything out of ciGroup2 for flaky test runner"
This reverts commit db86c3b5
This commit is contained in:
parent
cc0d6c1b1f
commit
b3eefb97da
3 changed files with 41 additions and 3 deletions
|
@ -62,6 +62,20 @@ export function ListingTableProvider({ getService, getPageObjects }: FtrProvider
|
|||
return visualizationNames;
|
||||
}
|
||||
|
||||
public async waitUntilTableIsLoaded() {
|
||||
return retry.try(async () => {
|
||||
const isLoaded = await find.existsByDisplayedByCssSelector(
|
||||
'[data-test-subj="itemsInMemTable"]:not(.euiBasicTable-loading)'
|
||||
);
|
||||
|
||||
if (isLoaded) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error('Waiting');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigates through all pages on Landing page and returns array of items names
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const listingTable = getService('listingTable');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const find = getService('find');
|
||||
const PageObjects = getPageObjects(['dashboard', 'tagManagement', 'common']);
|
||||
const PageObjects = getPageObjects(['dashboard', 'tagManagement', 'common', 'header']);
|
||||
|
||||
/**
|
||||
* Select tags in the searchbar's tag filter.
|
||||
|
@ -31,6 +31,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
// click elsewhere to close the filter dropdown
|
||||
const searchFilter = await find.byCssSelector('main .euiFieldSearch');
|
||||
await searchFilter.click();
|
||||
// wait until the table refreshes
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
};
|
||||
|
||||
describe('dashboard integration', () => {
|
||||
|
@ -47,6 +49,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
beforeEach(async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
});
|
||||
|
||||
it('allows to manually type tag filter query', async () => {
|
||||
|
@ -96,6 +99,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
|
||||
await selectFilterTags('tag-1');
|
||||
const itemNames = await listingTable.getAllItemsNames();
|
||||
expect(itemNames).to.contain('my-new-dashboard');
|
||||
|
@ -128,8 +133,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(await tagModal.isOpened()).to.be(false);
|
||||
|
||||
await PageObjects.dashboard.clickSave();
|
||||
await PageObjects.common.waitForSaveModalToClose();
|
||||
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
|
||||
await selectFilterTags('my-new-tag');
|
||||
const itemNames = await listingTable.getAllItemsNames();
|
||||
expect(itemNames).to.contain('dashboard-with-new-tag');
|
||||
|
@ -140,6 +148,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
beforeEach(async () => {
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
});
|
||||
|
||||
it('allows to select tags for an existing dashboard', async () => {
|
||||
|
@ -152,6 +161,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
|
||||
await selectFilterTags('tag-3');
|
||||
const itemNames = await listingTable.getAllItemsNames();
|
||||
expect(itemNames).to.contain('dashboard 4 with real data (tag-1)');
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const listingTable = getService('listingTable');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const find = getService('find');
|
||||
const PageObjects = getPageObjects(['visualize', 'tagManagement', 'visEditor']);
|
||||
const PageObjects = getPageObjects(['visualize', 'tagManagement', 'visEditor', 'common']);
|
||||
|
||||
/**
|
||||
* Select tags in the searchbar's tag filter.
|
||||
|
@ -31,6 +31,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
// click elsewhere to close the filter dropdown
|
||||
const searchFilter = await find.byCssSelector('main .euiFieldSearch');
|
||||
await searchFilter.click();
|
||||
// wait until the table refreshes
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
};
|
||||
|
||||
const selectSavedObjectTags = async (...tagNames: string[]) => {
|
||||
|
@ -56,6 +58,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
describe('listing', () => {
|
||||
beforeEach(async () => {
|
||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
});
|
||||
|
||||
it('allows to manually type tag filter query', async () => {
|
||||
|
@ -83,7 +86,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('creating', () => {
|
||||
it.skip('allows to assign tags to the new visualization', async () => {
|
||||
it('allows to assign tags to the new visualization', async () => {
|
||||
await PageObjects.visualize.navigateToNewVisualization();
|
||||
|
||||
await PageObjects.visualize.clickMarkdownWidget();
|
||||
|
@ -95,7 +98,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await selectSavedObjectTags('tag-1');
|
||||
|
||||
await testSubjects.click('confirmSaveSavedObjectButton');
|
||||
await PageObjects.common.waitForSaveModalToClose();
|
||||
|
||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
|
||||
await selectFilterTags('tag-1');
|
||||
const itemNames = await listingTable.getAllItemsNames();
|
||||
|
@ -133,7 +139,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(await tagModal.isOpened()).to.be(false);
|
||||
|
||||
await testSubjects.click('confirmSaveSavedObjectButton');
|
||||
await PageObjects.common.waitForSaveModalToClose();
|
||||
|
||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
|
||||
await selectFilterTags('my-new-tag');
|
||||
const itemNames = await listingTable.getAllItemsNames();
|
||||
|
@ -144,6 +153,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
describe('editing', () => {
|
||||
beforeEach(async () => {
|
||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
});
|
||||
|
||||
it('allows to assign tags to an existing visualization', async () => {
|
||||
|
@ -153,7 +163,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await selectSavedObjectTags('tag-2');
|
||||
|
||||
await testSubjects.click('confirmSaveSavedObjectButton');
|
||||
await PageObjects.common.waitForSaveModalToClose();
|
||||
|
||||
await PageObjects.visualize.gotoVisualizationLandingPage();
|
||||
await listingTable.waitUntilTableIsLoaded();
|
||||
|
||||
await selectFilterTags('tag-2');
|
||||
const itemNames = await listingTable.getAllItemsNames();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue