From 78261d2373c91b85194a13e0227f8c491bd34b20 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 17 Jun 2021 15:08:05 -0700 Subject: [PATCH] docs: clarify that attribute selectors are not CSS (#7210) --- docs/src/selectors.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/selectors.md b/docs/src/selectors.md index a5da2f721b..36135313cd 100644 --- a/docs/src/selectors.md +++ b/docs/src/selectors.md @@ -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') :::