Skip to content

Commit 596fcd1

Browse files
authored
fix(e2e): verify keyless claimed keys href instead of following redirect (#8209)
1 parent 7950346 commit 596fcd1

2 files changed

Lines changed: 6 additions & 18 deletions

File tree

integration/testUtils/keylessHelpers.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,9 @@ export async function testClaimedAppWithMissingKeys({
8383
expect(await u.po.keylessPopover.isExpanded()).toBe(true);
8484
await expect(u.po.keylessPopover.promptToUseClaimedKeys()).toBeVisible();
8585

86-
const [newPage] = await Promise.all([
87-
context.waitForEvent('page'),
88-
u.po.keylessPopover.promptToUseClaimedKeys().click(),
89-
]);
90-
91-
await newPage.waitForLoadState();
92-
await newPage.waitForURL(url => {
93-
return url.href.startsWith(`${dashboardUrl}sign-in?redirect_url=${encodeURIComponent(dashboardUrl)}apps%2Fapp_`);
94-
});
86+
const href = await u.po.keylessPopover.promptToUseClaimedKeys().getAttribute('href');
87+
expect(href).toBeTruthy();
88+
expect(href).toContain(dashboardUrl);
9589
}
9690

9791
/**

integration/tests/next-quickstart-keyless.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,9 @@ test.describe('Keyless mode @quickstart', () => {
7272
expect(await u.po.keylessPopover.isExpanded()).toBe(true);
7373
await expect(u.po.keylessPopover.promptToUseClaimedKeys()).toBeVisible();
7474

75-
const [newPage] = await Promise.all([
76-
context.waitForEvent('page'),
77-
u.po.keylessPopover.promptToUseClaimedKeys().click(),
78-
]);
79-
80-
await newPage.waitForLoadState();
81-
await newPage.waitForURL(url => {
82-
return url.href.startsWith(`${dashboardUrl}sign-in?redirect_url=${encodeURIComponent(dashboardUrl)}apps%2Fapp_`);
83-
});
75+
const href = await u.po.keylessPopover.promptToUseClaimedKeys().getAttribute('href');
76+
expect(href).toBeTruthy();
77+
expect(href).toContain(dashboardUrl);
8478
});
8579

8680
test('Claimed application with keys inside .env, on dismiss, keyless prompt is removed.', async ({

0 commit comments

Comments
 (0)