Skip to content

Commit

Permalink
Update getDashboardIdFromCurrentUrl to handle a url with no query par…
Browse files Browse the repository at this point in the history
…ams (elastic#15323) (elastic#15414)

* 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
  • Loading branch information
stacey-gammon committed Dec 5, 2017
1 parent a2bfdb7 commit b489f46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/_bwc_shared_urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Expand All @@ -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();

Expand Down
6 changes: 5 additions & 1 deletion test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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;
}

/**
Expand Down

0 comments on commit b489f46

Please sign in to comment.