-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SO Tagging: fix flaky test and re-enable it #82930
Changes from 9 commits
d216b9e
c2d1238
374814f
db86c3b
46da2af
2909b19
d37a5b7
c77f036
5e9a93c
5861e50
61980e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,14 +98,17 @@ 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(); | ||
expect(itemNames).to.contain('My new markdown viz'); | ||
}); | ||
|
||
it('allows to assign tags to the new visualization', async () => { | ||
it('allows to create a tag from the tag selector', async () => { | ||
const { tagModal } = PageObjects.tagManagement; | ||
|
||
await PageObjects.visualize.navigateToNewVisualization(); | ||
|
@@ -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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't understand whether we can get rid of this instruction in the test suit. As suggested in #82930 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There were some rare race conditions where the elements we are manipulating in the next instructions of the test were already removed from the DOM, because we retrieved them before the table was loaded (which cause a rerender, causing some existing dom elements to be removed from the document). This additional check is meant to fix the race by waiting for the next refresh |
||
|
||
await selectFilterTags('tag-2'); | ||
const itemNames = await listingTable.getAllItemsNames(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need it?