You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Allow toHaveCSS to target a pseudo-element #39873
Allow toHaveCSS to target a pseudo-element like ::after or ::before. This could a new field, e.g. pseudoElement in the options parameter for toHaveCSS and would be a parallel to the second parameter of window.getComputedStyle(element, pseudoElement).
It's not always possible to put your dynamic CSS onto an element. For instance, I'm currently working with dynamic background images that can have a dynamic opacity level. It's not possible to do this in CSS at the moment, so I'm having to fake the background using a pseudo CSS ::before element. Then, in my Playwright tests, I have to evaluate():
Activity
dgozman commentedon Apr 29, 2026
Fixed by #40092.