cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.72k stars 3.16k forks source link

::before element #5860

Closed rloukil closed 4 years ago

rloukil commented 4 years ago

I am getting a button visible with the ::before selector. I tied to trigger mouseover in order to make it visible but didn't succeed on that. Can anyone suggest a workaround?

Current behavior:

Capture du 2019-12-03 14-06-18

Desired behavior:

Be able to test the button visibility when hovering over the div

Steps to reproduce: (app code and test code)

Versions

gabbersepp commented 4 years ago

Hey, you can try the chrome remote debugger protocol. That would require you to run your tests in chrome and not in electron. I think by using the protocol you should be able to trigger :before.

See this example: https://github.com/cypress-io/cypress-example-recipes/pull/384

jennifer-shehane commented 4 years ago

@rloukil We do not currently support testing pseudo css selectors as explained in this comment: https://github.com/cypress-io/cypress/issues/10#issuecomment-118114716 Closing as duplicate of cy.hover() support. https://github.com/cypress-io/cypress/issues/10

gappersepp example may be a workaround in your case though.