Add more test stability and helpful debug output to try to catch issue with panel controls (#15392)

This commit is contained in:
Stacey Gammon 2017-12-04 17:21:38 -05:00 committed by GitHub
parent fde70d663d
commit f839564d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View file

@ -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);

View file

@ -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() {

View file

@ -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);