docs: clarify that attribute selectors are not CSS (#7210)

This commit is contained in:
Dmitry Gozman 2021-06-17 15:08:05 -07:00 committed by GitHub
parent 9e95e86082
commit 78261d2373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -675,6 +675,10 @@ await page.FillAsync("id=username", "value");
await page.ClickAsync("data-test-id=submit");
```
:::note
Attribute selectors are not CSS selectors, so anything CSS-specific like `:enabled` is not supported. For more features, use a proper [css] selector, e.g. `css=[data-test="login"]:enabled`.
:::
:::note
Attribute selectors pierce shadow DOM. To opt-out from this behavior, use `:light` suffix after attribute, for example `page.click('data-test-id:light=submit')
:::