You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(text selector): make quoted selector match by text nodes (#5603)
This change turns quoted match to be case-sensitive (as before),
but not strictly full-string for the whole element's text.
This is a fix for a case where element contains text nodes and child elements:
```html
<div>text1<span>child node</span>text2</div>
```
We now match this div by `text="text1"` and `text="text2"`.
Copy file name to clipboardExpand all lines: docs/src/selectors.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ Text selector has a few variations:
148
148
page.click("text=Log in")
149
149
```
150
150
151
-
-`text="Log in"`- text body can be escaped with single or double quotes forfull-string case-sensitive match. For example `text="Log"` does not match `<button>Login</button>` but instead matches `<span>Log</span>`.
151
+
-`text="Log in"`- text body can be escaped with single or double quotes for case-sensitive match. For example `text="Log"` does not match `<button>login</button>` but instead matches `<span>Login</span>`.
152
152
153
153
Quoted body follows the usual escaping rules, e.g. use `\"` to escape double quote in a double-quoted string: `text="foo\"bar"`.
0 commit comments