Skip to content

Commit e7da4bf

Browse files
mchestrclaude
andcommitted
fix: resolve Playwright strict mode violations in Jellyfin invite tests
Fixed two E2E test failures caused by Playwright strict mode violations: 1. 'admin can access invites page': Added `exact: true` to heading selector to match only "Invites" heading, not "No invites yet" 2. 'admin can open create invite modal': Changed from `getByText()` to `getByRole('heading')` to specifically target the modal heading instead of matching both the heading and submit button Both tests were timing out due to locators resolving to multiple elements. The fixes ensure selectors uniquely identify single elements following Playwright best practices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent c26baac commit e7da4bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

e2e/jellyfin-invite.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ test.describe('Jellyfin Invite Flow', () => {
127127
await adminPage.locator('aside').getByTestId('admin-nav-invites').first().click();
128128
await waitForLoadingGone(adminPage);
129129

130-
await expect(adminPage.getByRole('heading', { name: 'Invites' })).toBeVisible({ timeout: WAIT_TIMEOUTS.ADMIN_CONTENT });
130+
await expect(adminPage.getByRole('heading', { name: 'Invites', exact: true })).toBeVisible({ timeout: WAIT_TIMEOUTS.ADMIN_CONTENT });
131131
await expect(adminPage.getByTestId('generate-invite-button')).toBeVisible();
132132
});
133133

@@ -139,7 +139,7 @@ test.describe('Jellyfin Invite Flow', () => {
139139

140140
// Modal should appear
141141
await expect(adminPage.getByRole('dialog')).toBeVisible({ timeout: WAIT_TIMEOUTS.DIALOG_APPEAR });
142-
await expect(adminPage.getByText('Create Invite')).toBeVisible();
142+
await expect(adminPage.getByRole('heading', { name: 'Create Invite' })).toBeVisible();
143143
});
144144

145145
test('admin can create a Jellyfin invite via database', async ({ adminPage }) => {

0 commit comments

Comments
 (0)