0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-24 04:02:38 +02:00

Wait for logout response before verifying sign-out

The link-action handler does an async fetch POST then a form-based
redirect chain which can be slow on CI. Wait for the /user/logout
response to confirm session destruction, then navigate to verify.

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

View File

@ -17,6 +17,11 @@ export async function login(page: Page) {
export async function logout(page: Page) {
const navbar = page.getByRole('navigation', {name: 'Navigation Bar'});
await clickDropdownItem(page, navbar.getByTitle(env.E2E_USER!), 'Sign Out');
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.goto('/');
await expect(page.getByRole('link', {name: 'Sign In'})).toBeVisible();
}