Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/e2e/events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ test.describe('events', () => {
// Verify page2 is logged in
await expect(page2.getByRole('link', {name: 'Sign In'})).toBeHidden();

// Give page2's SharedWorker time to register its SSE connection on the
// server — otherwise the logout event can race the connection and be
// silently dropped. See https://github.com/go-gitea/gitea/pull/37403
// In the future, we can set an attribute to HTML page when the connection is established,
// then here we can just wait for that attribute (it should also work for the planned WebSocket SharedWorker)
await page2.waitForTimeout(500); // eslint-disable-line playwright/no-wait-for-timeout
Comment thread
wxiaoguang marked this conversation as resolved.

// Logout from page1 — this sends a logout event to all tabs
await page1.goto('/user/logout');

Expand Down