Here I have a piece of code in Playwright with the ToHaveCSS function which returns the exact value of the mentioned CSS.
Locator:
locator('//label[text()=\'Chat Status\']/following-sibling::*/button')
Expected string: "rgb(40, 176, 131)"
Received string: "rgb(40, 176, 131) none repeat scroll 0% 0% / auto padding-box border-box"
As you can see the expected value matches the received value with some extra strings.
Is there any function like string.includes? Which can pass this test. I just want to validate the colour and the other stuff I don't need it. I can still copy and paste the received value to the expected string to pass it. But what if the value dynamically changes and I only want to validate the color? Are there any functions for the playwright to do this?