Commit 6db680c
committed
fix(e2e): click before fill to ensure onFocus fires on WebKit (iPhone 11)
Playwright's fill() is supposed to focus the element before typing, but on
WebKit/Safari (used for the iPhone 11 test project), the synthetic onFocus
event is not always reliably dispatched in CI's headless environment.
The Field component tracks 'interacted' state (set on onFocus or onChange)
to decide whether to show validation errors after blur. If onFocus doesn't
fire, 'interacted' stays false and the error message never renders, causing
the E2E assertion to fail with 'element(s) not found'.
Fix: add an explicit .click() before .fill() in both validation tests. A
click is guaranteed to trigger focus events in all browsers, ensuring
'interacted' is set to true before we blur and check for the error.
Applied to both phone-number and name validation tests for consistency.1 parent b07b417 commit 6db680c
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
0 commit comments