Mouse movement / mouseover and JavaScript evaluation in watir

I have a JavaScript heavy Rails application that I am testing in watir. I have two specific testing requirements:

  • I need to simulate a mouse move to a specific area of ​​the screen (or at least trigger an onmouseover event for a div)
  • Evaluate a JavaScript snippet after this happens to see if the flag is set correctly

I could not figure out how to do this in watir. Any ideas on how to do this?

+3
source share
2 answers

For the first question:

browser.div(:id, "some-id").fire_event "onmouseover"

I do not know how to solve the second question. You can specify watir-general .

+2

Source: https://habr.com/ru/post/1736396/


All Articles