diff --git a/ui/desktop/tests/end2end/authentication.spec.js b/ui/desktop/tests/end2end/authentication.spec.js index 553a4b5cd..9986b0773 100644 --- a/ui/desktop/tests/end2end/authentication.spec.js +++ b/ui/desktop/tests/end2end/authentication.spec.js @@ -10,7 +10,7 @@ const generateScreenshotPath = (fileName) => { return path.join(screenshotPath, fileName).concat(screenshotFormat); }; -// Todo: move this function to a test helpers file so it could be used by other tests. +// TODO: move this function to a test helpers file so it could be used by other tests. // Returns the executable path for the Boundary binary the test suite will run. const returnExecutablePath = (platform, arch) => { try { @@ -91,11 +91,12 @@ test.describe('Authentication end to end test suite', async () => { await boundaryWindow.$eval('button[type="submit"]', (element) => element.click() ); + // Check we are in Targets - await boundaryWindow.waitForSelector('h2 >> text=Targets'); - expect(await boundaryWindow.innerText('h2 >> text=Targets')).toEqual( - 'Targets ' - ); + await boundaryWindow.waitForURL('**/#/scopes/global/projects/targets'); + const windowUrl = new URL(await boundaryWindow.url()); + expect(windowUrl.hash).toEqual('#/scopes/global/projects/targets'); + // Take screenshot await boundaryWindow.screenshot({ path: generateScreenshotPath('afterLogin'), diff --git a/ui/desktop/tests/end2end/targets.spec.js b/ui/desktop/tests/end2end/targets.spec.js index 340a94d33..56411e15c 100644 --- a/ui/desktop/tests/end2end/targets.spec.js +++ b/ui/desktop/tests/end2end/targets.spec.js @@ -58,11 +58,11 @@ test.describe('Targets end to end test suite', async () => { await boundaryWindow.$eval('button[type="submit"]', (element) => element.click() ); + // Check we are in Targets - await boundaryWindow.waitForSelector('h2 >> text=Targets'); - expect(await boundaryWindow.innerText('h2 >> text=Targets')).toEqual( - 'Targets ' - ); + await boundaryWindow.waitForURL('**/#/scopes/global/projects/targets'); + const windowUrl = new URL(await boundaryWindow.url()); + expect(windowUrl.hash).toEqual('#/scopes/global/projects/targets'); // Click connect to a target await boundaryWindow.waitForSelector('table.rose-table');