Update getDashboardIdFromCurrentUrl to handle a url with no query params (#15323) (#15415)

* add some retries, waiting for the loading indicator to be hidden once is not enough

* test to see if looping over the flaky test 25 times will trigger it on jenkins

* Try again to semi-reliably report on jenkins

* Attempt to fix invalid id coming out of getDashboardIdFromCurrentUrl

* Clean up to submit attempted flaky test failure fix

clean up
This commit is contained in:
Stacey Gammon 2017-12-05 18:27:30 -05:00 committed by GitHub
parent 52f4123788
commit a1a7379937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -35,6 +35,7 @@ export default function ({ getService, getPageObjects }) {
});
describe('6.0 urls', () => {
it('loads an unsaved dashboard', async function () {
const url = `${kibanaBaseUrl}#/dashboard?${urlQuery}`;
@ -51,11 +52,10 @@ export default function ({ getService, getPageObjects }) {
it('loads a saved dashboard', async function () {
await PageObjects.dashboard.saveDashboard('saved with colors', { storeTimeWithDashboard: true });
await PageObjects.header.clickToastOK();
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
const url = `${kibanaBaseUrl}#/dashboard/${id}`;
await remote.get(url, true);
await PageObjects.header.waitUntilLoadingHasFinished();

View file

@ -85,7 +85,11 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
const urlSubstring = 'kibana#/dashboard/';
const startOfIdIndex = currentUrl.indexOf(urlSubstring) + urlSubstring.length;
const endIndex = currentUrl.indexOf('?');
return currentUrl.substring(startOfIdIndex, endIndex);
const id = currentUrl.substring(startOfIdIndex, endIndex < 0 ? currentUrl.length : endIndex);
log.debug(`Dashboard id extracted from ${currentUrl} is ${id}`);
return id;
}
/**