Skip to content

Commit

Permalink
stabilize flaky embeddables/adding_children take 2 (#68873)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jun 16, 2020
1 parent 833ce08 commit 7211257
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/examples/embeddables/adding_children.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 7211257

Please sign in to comment.