1

Scenario:

I have something similar:

<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Using g to inherit presentation attributes -->
  <g fill="white" stroke="green" stroke-width="5">
    <circle cx="40" cy="40" r="25" />
    <circle cx="60" cy="60" r="25" />
  </g>
</svg>

Hovering over svg will show a tooltip and I need to test whether tooltip is displayed and the content is correct.

Any suggestions? Tried trigger(mouseover) which in not working.

2

I had the same issue, using 'mousemove' instead of 'mouseover' worked for me.

cy.get('g circle').each((circ) => {
  cy.get(circ).trigger('mousemove', { force: true })
    .wait(100)
    .get('table tbody tr td').each((data) => {
      cy.log(data.text())
    })
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.