Skip to content

Commit

Permalink
[Lens] Increase timings for drag and drop tests (#101380)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Jun 7, 2021
1 parent 17e488e commit f5dc9d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/lens/drag_and_drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'Unique count of @message.raw [2]',
]);
});
it('should duplicate the column when dragging to empty dimension in the same group', async () => {
it('should move duplicated column to non-compatible dimension group', async () => {
await PageObjects.lens.dragDimensionToDimension(
'lnsXY_yDimensionPanel > lns-dimensionTrigger',
'lnsXY_xDimensionPanel > lns-empty-dimension'
Expand Down
17 changes: 17 additions & 0 deletions x-pack/test/functional/page_objects/lens_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
testSubjects.getCssSelector(`lnsFieldListPanelField-${field}`),
testSubjects.getCssSelector('lnsWorkspace')
);
await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},

Expand All @@ -183,6 +184,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
testSubjects.getCssSelector(`lnsFieldListPanelField-${field}`),
testSubjects.getCssSelector('lnsGeoFieldWorkspace')
);
await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},

Expand Down Expand Up @@ -246,6 +248,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
await browser.pressKeys(reverse ? browser.keys.LEFT : browser.keys.RIGHT);
}
await browser.pressKeys(browser.keys.ENTER);
await this.waitForLensDragDropToFinish();

await PageObjects.header.waitUntilLoadingHasFinished();
},
Expand All @@ -270,6 +273,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
}
await browser.pressKeys(browser.keys.ENTER);

await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},
/**
Expand All @@ -292,9 +296,19 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
}
await browser.pressKeys(browser.keys.ENTER);

await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},

async waitForLensDragDropToFinish() {
await retry.try(async () => {
const exists = await find.existsByCssSelector('.lnsDragDrop-isActiveGroup');
if (exists) {
throw new Error('UI still in drag/drop mode');
}
});
},

/**
* Drags field to dimension trigger
*
Expand All @@ -306,6 +320,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
testSubjects.getCssSelector(`lnsFieldListPanelField-${field}`),
testSubjects.getCssSelector(dimension)
);
await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},

Expand All @@ -320,6 +335,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
testSubjects.getCssSelector(from),
testSubjects.getCssSelector(to)
);
await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},

Expand All @@ -333,6 +349,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
const dragging = `[data-test-subj='${dimension}']:nth-of-type(${startIndex}) .lnsDragDrop`;
const dropping = `[data-test-subj='${dimension}']:nth-of-type(${endIndex}) [data-test-subj='lnsDragDrop-reorderableDropLayer'`;
await browser.html5DragAndDrop(dragging, dropping);
await this.waitForLensDragDropToFinish();
await PageObjects.header.waitUntilLoadingHasFinished();
},

Expand Down

0 comments on commit f5dc9d1

Please sign in to comment.