Commit 4c8ef87
committed
fix: LoginPage checkbox methods fail with Radix UI checkboxes
The LoginPage used .check() and .uncheck() on the "Remember me" checkbox,
but these Playwright methods only work on native <input type="checkbox">
elements. The app uses @radix-ui/react-checkbox which renders as
<button role="checkbox">, causing tests to fail with:
"Error: Not a checkbox or radio input"
This prevented ALL e2e and visual tests from running, including the auth
tests that execute in CI.
Changed to use .setChecked() which works with both:
- Native <input type="checkbox"> elements
- ARIA checkboxes with role="checkbox" (Radix UI, MUI, etc.)
Changes:
- login(): Use setChecked(rememberMe) instead of conditional check()
- clearForm(): Use setChecked(false) instead of conditional uncheck()
The .isChecked() and .toBeChecked() assertions still work correctly
because they check the aria-checked attribute that Radix UI sets.1 parent 08a7b61 commit 4c8ef87
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 75 | + | |
| 76 | + | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| |||
0 commit comments