Repository navigation
Commit 1822860
fix(playwright): don't block in see() when a matched element is removed (#5746)
* fix(playwright): don't block in see() when a matched element is removed
proceedSee() read the text of each element matched by the context via
Locator.innerText(), which auto-waits for the element to be attached. If
one of the elements was removed between all() and innerText(), the step
blocked for the full helper timeout and failed, even when another matched
element contained the expected text. Read the texts with evaluateAll(),
which doesn't wait, so a removed element contributes no text.
Fixes #5745
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(playwright): don't pass see() checks on vanished or non-HTML elements
Reading texts with evaluateAll() left two false passes in proceedSee():
- When every matched element was removed after it was located, no text
was read, so seeTextEquals() asserted nothing and passed. Report the
element as not found instead.
- Non-HTML elements such as SVG have no innerText and were read as empty
text, so dontSee() passed on text that was on the page. Fall back to
textContent.
Refs #5745
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Jaromir Obr <jobr@spork.tech>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent a459969 commit 1822860
2 files changed
Lines changed: 82 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4428 | 4428 | | |
4429 | 4429 | | |
4430 | 4430 | | |
4431 | | - | |
| 4431 | + | |
| 4432 | + | |
4432 | 4433 | | |
4433 | 4434 | | |
4434 | 4435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
733 | 813 | | |
734 | 814 | | |
735 | 815 | | |
| |||
0 commit comments