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:
Ross Wollman 2022-02-10 12:27:37 -08:00 committed by GitHub
parent 9a8e55493f
commit 00e8a6440d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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']`