mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs(selectors.md): React selector nit (#12010)
See https://github.com/microsoft/playwright/pull/11970#discussion_r803212908. In the future, I'd like to think through some more extensive examples to make React selector best practices more explicit in the docs.
This commit is contained in:
parent
9a8e55493f
commit
00e8a6440d
@ -755,7 +755,6 @@ In react selectors, component names are transcribed with **CamelCase**.
|
|||||||
Selector examples:
|
Selector examples:
|
||||||
|
|
||||||
- match by **component**: `_react=BookItem`
|
- match by **component**: `_react=BookItem`
|
||||||
- match by component and **key**: `_react=BookItem[key = '2']`
|
|
||||||
- match by component and **exact property value**, case-sensitive: `_react=BookItem[author = "Steven King"]`
|
- match by component and **exact property value**, case-sensitive: `_react=BookItem[author = "Steven King"]`
|
||||||
- match by property value only, **case-insensitive**: `_react=[author = "steven king" i]`
|
- match by property value only, **case-insensitive**: `_react=[author = "steven king" i]`
|
||||||
- match by component and **truthy property value**: `_react=MyButton[enabled]`
|
- match by component and **truthy property value**: `_react=MyButton[enabled]`
|
||||||
@ -765,6 +764,7 @@ Selector examples:
|
|||||||
- match by **nested** property value: `_react=[some.nested.value = 12]`
|
- match by **nested** property value: `_react=[some.nested.value = 12]`
|
||||||
- match by component and property value **prefix**: `_react=BookItem[author ^= "Steven"]`
|
- match by component and property value **prefix**: `_react=BookItem[author ^= "Steven"]`
|
||||||
- match by component and property value **suffix**: `_react=BookItem[author $= "Steven"]`
|
- match by component and property value **suffix**: `_react=BookItem[author $= "Steven"]`
|
||||||
|
- match by component and **key**: `_react=BookItem[key = '2']`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user