stabilize flaky embeddables/adding_children take 2 (#68873)

* wait for loading indicator to be deleted

* improve with retry

* Update test/examples/embeddables/adding_children.ts

Co-authored-by: Spencer <email@spalger.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Anton Dosov 2020-06-16 10:42:37 +02:00 committed by GitHub
parent 833ce08259
commit 721125772f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,7 @@ import { PluginFunctionalProviderContext } from 'test/plugin_functional/services
export default function ({ getService }: PluginFunctionalProviderContext) {
const testSubjects = getService('testSubjects');
const flyout = getService('flyout');
const retry = getService('retry');
describe('creating and adding children', () => {
before(async () => {
@ -33,8 +34,15 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
it('Can create a new child', async () => {
await testSubjects.click('embeddablePanelToggleMenuIcon');
await testSubjects.click('embeddablePanelAction-ACTION_ADD_PANEL');
await testSubjects.click('createNew');
// this seem like an overkill, but clicking this button which opens context menu was flaky
await testSubjects.waitForEnabled('createNew');
await retry.waitFor('createNew popover opened', async () => {
await testSubjects.click('createNew');
return await testSubjects.exists('createNew-TODO_EMBEDDABLE');
});
await testSubjects.click('createNew-TODO_EMBEDDABLE');
await testSubjects.setValue('taskInputField', 'new task');
await testSubjects.click('createTodoEmbeddable');
const tasks = await testSubjects.getVisibleTextAll('todoEmbeddableTask');
@ -44,6 +52,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
it('Can add a child backed off a saved object', async () => {
await testSubjects.click('embeddablePanelToggleMenuIcon');
await testSubjects.click('embeddablePanelAction-ACTION_ADD_PANEL');
await testSubjects.waitForDeleted('savedObjectFinderLoadingIndicator');
await testSubjects.click('savedObjectTitleGarbage');
await testSubjects.moveMouseTo('euiFlyoutCloseButton');
await flyout.ensureClosed('dashboardAddPanel');