Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test pseudo elements #53

Open
hrishikeshpotdar91 opened this issue May 8, 2019 · 3 comments
Open

Test pseudo elements #53

hrishikeshpotdar91 opened this issue May 8, 2019 · 3 comments

Comments

@hrishikeshpotdar91
Copy link

hrishikeshpotdar91 commented May 8, 2019

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

@jamesshore
Copy link
Owner

Unfortunately, there's no way to test pseudo-elements at this time.

@hrishikeshpotdar91
Copy link
Author

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

@jamesshore
Copy link
Owner

Very interesting! I'll re-open this as a feature request for the future.

@jamesshore jamesshore reopened this May 10, 2019
@jamesshore jamesshore changed the title how to test pseudo elements? Test pseudo elements May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants