Skip to content

fix(e2e): use exact match for Password label to prevent strict mode violation#752

Merged
ericsocrat merged 1 commit intomainfrom
fix/playwright-password-strict-mode
Mar 8, 2026
Merged

fix(e2e): use exact match for Password label to prevent strict mode violation#752
ericsocrat merged 1 commit intomainfrom
fix/playwright-password-strict-mode

Conversation

@ericsocrat
Copy link
Owner

Problem

\getByLabel('Password')\ in Playwright E2E tests matched two elements — the password input (via <label for>) and the 'Show password' toggle button (via substring match on \�ria-label='Show password'). This caused a Playwright strict mode violation that failed the Quality Gate CI check.

Introduced by PR #727 (password toggle feature).

Fix

Added { exact: true }\ to all 12 \getByLabel('Password')\ calls across 6 E2E test files. This ensures only the exact label text 'Password' is matched, excluding 'Show password'.

Files Changed

File Occurrences Fixed
\�2e/auth.setup.ts\ 1
\�2e/authenticated.spec.ts\ 3
\�2e/visual-audit.spec.ts\ 1
\�2e/screenshot-capture.spec.ts\ 1
\�2e/smoke-extended.spec.ts\ 1
\�2e/functional-onboarding.spec.ts\ 5

Verification


  • px tsc --noEmit\ — 0 errors
  • No functional test changes — only locator precision improvement

…iolation

getByLabel('Password') matched both the password input (via <label for>)
and the 'Show password' toggle button (substring match on aria-label).

Adding { exact: true } ensures only the exact label text 'Password' is
matched, fixing the Playwright strict mode error introduced by the
password toggle feature in PR #727.

12 occurrences fixed across 6 E2E test files.
Copilot AI review requested due to automatic review settings March 8, 2026 12:32
@vercel
Copy link

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryvit Ready Ready Preview, Comment Mar 8, 2026 0:34am

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Playwright strict mode violations in E2E tests caused by getByLabel("Password") matching both the password input and the “Show password” toggle button (substring match on its aria-label).

Changes:

  • Updated all E2E password locators to getByLabel("Password", { exact: true }) to ensure only the password field is targeted.
  • Applied the locator change across the affected login/signup helper flows and assertions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/e2e/auth.setup.ts Makes the auth setup login flow’s password locator exact to avoid strict mode ambiguity.
frontend/e2e/authenticated.spec.ts Updates signup form visibility assertion and signup interactions to use an exact password label match.
frontend/e2e/visual-audit.spec.ts Updates the visual audit sign-in helper to use an exact password label match.
frontend/e2e/screenshot-capture.spec.ts Updates the screenshot capture sign-in helper to use an exact password label match.
frontend/e2e/smoke-extended.spec.ts Updates the signup placeholder check to use an exact password label match.
frontend/e2e/functional-onboarding.spec.ts Updates onboarding login steps across tests to use an exact password label match.

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

Bundle Size Report

Metric Value
Main baseline 3513 KB
This PR 3513 KB
Delta +0 KB (+0.0%)
JS chunks 137
Hard limit 4000 KB

✅ Bundle size is within acceptable limits.

@ericsocrat ericsocrat merged commit d52d8aa into main Mar 8, 2026
20 of 21 checks passed
@ericsocrat ericsocrat deleted the fix/playwright-password-strict-mode branch March 8, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants