Playwright · Matcher
toHaveCSS
toHaveCSS checks that a locator's element has an expected CSS property value. It retries until the value matches or the assertion timeout is reached.
Last updated
Syntax
await expect(locator).toHaveCSS(name, value)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expectlocatorpage.locatorexpect.pollexpect.toPass