diff --git a/test/functional/apps/dashboard/_bwc_shared_urls.js b/test/functional/apps/dashboard/_bwc_shared_urls.js index 86840b357fe8df..febaf0134834b5 100644 --- a/test/functional/apps/dashboard/_bwc_shared_urls.js +++ b/test/functional/apps/dashboard/_bwc_shared_urls.js @@ -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(); diff --git a/test/functional/page_objects/dashboard_page.js b/test/functional/page_objects/dashboard_page.js index a48c7cc5e66f78..f5d80be8e8cbe8 100644 --- a/test/functional/page_objects/dashboard_page.js +++ b/test/functional/page_objects/dashboard_page.js @@ -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; } /**