mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Add more test stability and helpful debug output to try to catch issue with panel controls (#15392)
This commit is contained in:
parent
fde70d663d
commit
f839564d91
3 changed files with 12 additions and 4 deletions
|
@ -63,19 +63,19 @@ export default function ({ getService, getPageObjects }) {
|
|||
const currentUrl = await remote.getCurrentUrl();
|
||||
// the second parameter of true will include the timestamp in the url and trigger a hard refresh.
|
||||
await remote.get(currentUrl.toString(), true);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
await PageObjects.dashboard.showPanelEditControlsDropdownMenu();
|
||||
const editLinkExists = await testSubjects.exists('dashboardPanelEditLink');
|
||||
const removeExists = await testSubjects.exists('dashboardPanelRemoveIcon');
|
||||
|
||||
expect(editLinkExists).to.equal(true);
|
||||
|
||||
const removeExists = await testSubjects.exists('dashboardPanelRemoveIcon');
|
||||
expect(removeExists).to.equal(true);
|
||||
|
||||
// Get rid of the timestamp in the url.
|
||||
await remote.get(currentUrl.toString(), false);
|
||||
});
|
||||
|
||||
|
||||
describe('on an expanded panel', function () {
|
||||
it('are hidden in view mode', async function () {
|
||||
await PageObjects.dashboard.saveDashboard(dashboardName);
|
||||
|
|
|
@ -466,7 +466,14 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
|
|||
log.debug('showPanelEditControlsDropdownMenu');
|
||||
const editLinkExists = await testSubjects.exists('dashboardPanelEditLink');
|
||||
if (editLinkExists) return;
|
||||
await testSubjects.click('dashboardPanelToggleMenuIcon');
|
||||
|
||||
await retry.try(async () => {
|
||||
await testSubjects.click('dashboardPanelToggleMenuIcon');
|
||||
const editLinkExists = await testSubjects.exists('dashboardPanelEditLink');
|
||||
if (!editLinkExists) {
|
||||
throw new Error('No edit link exists, toggle menu not open. Try again.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async clickDashboardPanelEditLink() {
|
||||
|
|
|
@ -27,6 +27,7 @@ export function TestSubjectsProvider({ getService }) {
|
|||
}
|
||||
|
||||
async click(selector, timeout = defaultFindTimeout) {
|
||||
log.debug(`TestSubjects.click(${selector})`);
|
||||
return await retry.try(async () => {
|
||||
const element = await this.find(selector, timeout);
|
||||
await remote.moveMouseTo(element);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue