These are chat archives for Behat/Behat

7th
Dec 2017
gvanduijn
@gvanduijn
Dec 07 2017 14:20
Hi there is it possible to select an pseudo element in Behat with Symfony?

I am working on test scripts for a website, but I came across a pseudo element that I unfortunately cannot work around.

The HTML looks similar to the following:

<a class = 'something', href='link', data-post = 'somesortofaction' ::before <span>Remove this Item</span>
</a>

The a-element is not clickable, since in this case its exactly 0 pixels wide, so I need to use the :before pseudo-element.
Whenever I try, behat gives me back either an error if I do not use the ::before or "pseudo-elements are not supported"

I know pseudo-elements are not part of the DOM, but does anyone have a simple workaround?

Thank you so much in advance!

FlyLo11
@FlyLo11
Dec 07 2017 16:22
@gvanduijn Another option would be to just add a class or data-attribute on <span> to directly reference it