Skip to content

Commit

Permalink
Adds logs for currentUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Oct 16, 2023
1 parent 2e97251 commit 78f157f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/plugin_functional/test_suites/core_plugins/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
const retry = getService('retry');
const deployment = getService('deployment');
const esArchiver = getService('esArchiver');
const log = getService('log');

function waitUntilLoadingIsDone() {
return PageObjects.header.waitUntilLoadingHasFinished();
Expand Down Expand Up @@ -52,7 +53,10 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
const waitForUrlToBe = (pathname?: string, search?: string) => {
const expectedUrl = getKibanaUrl(pathname, search);
return retry.waitFor(`Url to be ${expectedUrl}`, async () => {
return (await browser.getCurrentUrl()) === expectedUrl;
const currentUrl = await browser.getCurrentUrl();
if (currentUrl !== expectedUrl)
log.debug(`expected url to be ${expectedUrl}, got ${currentUrl}`);
return currentUrl === expectedUrl;
});
};

Expand Down Expand Up @@ -107,12 +111,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide

await waitForUrlToBe('/app/foo/home');
await loadingScreenNotShown();
try {
await testSubjects.existOrFail('fooAppHome');
} catch (err) {
const currentUrl = await browser.getCurrentUrl();
throw new Error(`Did not navigate to app root, url is ${currentUrl}`);
}
await testSubjects.existOrFail('fooAppHome');
});

it('navigates to other apps', async () => {
Expand Down

0 comments on commit 78f157f

Please sign in to comment.