quixote
quixote copied to clipboard
Test pseudo elements
Edit by jamesshore: See below for a technique for testing psuedo elements.
I'm trying to fetch ::before's css of an element but i always get the following error
"Expected one element to match '.callout .alert::before', but found 0"
this is what I'm doing
callout_icon = frame.get('.callout .alert::before');
can you help me doing this the right way
Unfortunately, there's no way to test pseudo-elements at this time.
I was able to test pseudo-elements like this
callout__primary = frame.get('.callout .primary');
expect(window.getComputedStyle(callout__primary.toDomElement(), '::before').getPropertyValue('content')).to.be('"\"')
This article helped me https://davidwalsh.name/pseudo-element
Very interesting! I'll re-open this as a feature request for the future.