Skip to content
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

stabilize flaky embeddables/adding_children take 2 #68873

Merged
merged 8 commits into from
Jun 16, 2020
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