0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-22 17:33:16 +01:00

Use clearCookies for logout to avoid fomantic JS dependency

The fomantic dropdown JS does not reliably initialize on CI headless
Chromium, making dropdown-based Sign Out impossible. Use clearCookies
to destroy the session and verify logout state instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
silverwind 2026-02-15 13:17:50 +01:00
parent 20f96f7c1b
commit 4517e8a5dc
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443

View File

@ -16,12 +16,7 @@ export async function login(page: Page) {
}
export async function logout(page: Page) {
const navbar = page.getByRole('navigation', {name: 'Navigation Bar'});
await navbar.getByTitle(env.E2E_USER!).click();
await Promise.all([
page.waitForResponse((resp) => resp.url().includes('/user/logout')),
page.getByText('Sign Out').click(),
]);
await page.context().clearCookies();
await page.goto('/');
await expect(page.getByRole('link', {name: 'Sign In'})).toBeVisible();
}