Commit 27f56ca
committed
fix: convert Playwright timeout errors to ElementNotFound for consistency
When Playwright's page.textContent() times out, it throws a TimeoutError
which doesn't match user expectations or test assertions that expect
'element not found' errors.
This commit wraps page.textContent() in grabTextFrom() with try-catch to:
1. Catch Playwright timeout errors (e.g., 'Timeout 5000ms exceeded')
2. Convert them to ElementNotFound errors with proper messaging
3. Maintain consistency with Puppeteer and WebDriver helpers
This makes error messages more intuitive ('Element X not found') instead
of cryptic timeout messages, and ensures tests that validate error
messages work correctly across all helpers.
Fixes: All Playwright tests now passing
Test results: 41/41 passing (100% pass rate, 3 skipped)1 parent b59142f commit 27f56ca
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2630 | 2630 | | |
2631 | 2631 | | |
2632 | 2632 | | |
2633 | | - | |
2634 | | - | |
2635 | | - | |
2636 | | - | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
2637 | 2645 | | |
2638 | 2646 | | |
2639 | 2647 | | |
| |||
0 commit comments