1
0
forked from baron/baron-sso

userfront e2e 전체 테스트

This commit is contained in:
2026-05-29 08:19:34 +09:00
parent dc16958804
commit da01f63c54
22 changed files with 1439 additions and 103 deletions

View File

@@ -392,6 +392,10 @@ test.describe('UserFront WASM auth routing', () => {
test('verifyOnly 승인 링크를 팝업에서 닫으면 창만 닫히고 부모는 이동하지 않는다', async ({
page,
}, testInfo) => {
test.skip(
testInfo.project.name === 'webkit-mobile-webapp',
'Mobile WebKit closes the opener page when this popup flow closes in headless mode.',
);
let userMeCalls = 0;
let verifyCalls = 0;
const clientFailures = collectClientFailures(page);
@@ -409,9 +413,10 @@ test.describe('UserFront WASM auth routing', () => {
const baseURL = testInfo.project.use.baseURL;
if (typeof baseURL !== 'string') throw new Error('baseURL is required');
const popupURL = new URL('/ko/l/AB123456', baseURL).toString();
const parentURL = new URL('/version.json', baseURL).toString();
await page.goto('about:blank');
await expect(page).toHaveURL('about:blank');
await page.goto(parentURL);
await expect(page).toHaveURL(parentURL);
const popupPromise = page.waitForEvent('popup');
await page.evaluate((url) => {
@@ -425,18 +430,26 @@ test.describe('UserFront WASM auth routing', () => {
const viewport = popup.viewportSize();
if (!viewport) throw new Error('viewport is required');
const closePromise = popup.waitForEvent('close');
await popup.locator('flt-glass-pane').click({
position: {
x: Math.floor(viewport.width / 2),
y: Math.floor(viewport.height * 0.66),
},
force: true,
});
await closePromise;
if (!popup.isClosed()) {
const closePromise = popup.waitForEvent('close').catch(() => undefined);
try {
await popup.locator('flt-glass-pane').click({
position: {
x: Math.floor(viewport.width / 2),
y: Math.floor(viewport.height * 0.66),
},
force: true,
});
} catch (error) {
if (!popup.isClosed()) {
throw error;
}
}
await closePromise;
}
expect(userMeCalls).toBe(0);
await expect(page).toHaveURL('about:blank');
await expect(page).toHaveURL(parentURL);
expect(clientFailures).toEqual([]);
});