Skip to content

Commit 1f0f3b6

Browse files
author
Triona Doyle
committed
address additional coderabbit feedback..
Signed-off-by: Triona Doyle <tekton@example.com>
1 parent 5e7ca0c commit 1f0f3b6

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

test/ui-e2e/.auth/setup.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ setup('authenticate to OpenShift Cluster', async ({ page, baseURL }) => {
3535
console.log(`IDP selection screen detected. Selecting provider: "${idpName}"`);
3636

3737
//look for the specific IDP
38-
const idpLink = page.getByRole('link', { name: new RegExp(idpName, 'i') });
38+
const idpLink = page.getByRole('link', { name: idpName, exact: true });
3939

4040
await idpLink.waitFor({ state: 'visible', timeout: TIMEOUTS.short });
4141
await idpLink.click();
@@ -58,17 +58,21 @@ setup('authenticate to OpenShift Cluster', async ({ page, baseURL }) => {
5858
await passwordInput.fill(process.env.CLUSTER_PASSWORD);
5959
await page.getByRole('button', { name: /Log in/i }).click();
6060

61-
//handle the OpenShift 4.x Welcome Tour modal if it appears
61+
//handle the OpenShift 4.x Welcome Tour modal if it appears
6262
try {
6363
const skipTourButton = page.getByRole('button', { name: /skip tour/i });
6464
//wait up to 5 seconds for the modal to pop up
6565
await skipTourButton.waitFor({ state: 'visible', timeout: TIMEOUTS.short });
6666
await skipTourButton.click();
6767
console.log('Dismissed the OpenShift Welcome Tour modal.');
68-
} catch (error) {
69-
//if it doesn't appear within 5 seconds, it's an older cluster or already dismissed
70-
//safely ignore the error and move on
71-
console.debug('welcome tour modal did not appear, continuing...');
68+
} catch (error) {r
69+
if (error instanceof Error && error.name === 'TimeoutError') {
70+
//safely ignore the timeout and move on
71+
console.log('welcome tour modal did not appear, continuing...');
72+
} else {
73+
//throw any other unexpected errors (like browser crashes or network drops)
74+
throw error;
75+
}
7276
}
7377

7478
//save the auth state

0 commit comments

Comments
 (0)