3

I have very simple react component and this component returns div:

return(< div className="item"
onClick={ this._onClick }
onMouseEnter={ this._onMouseEnter }
onMouseLeave={ this._onMouseLeave } >...< /div>);

(sorry for weird < and > formatting)

And I use selenium for testing (nightwatchjs framework), so when I write in my test

client.click(".item");

it works perfectly, I see that _onClick() method is called, but when I try to hover over the element and I write

client.moveToElement(".item");

or

client.moveToElement(".item", 1 ,1);

It doesn't work :( , _onMouseEnter() method isn't called.

So - how do you test any hover actions on react components?

marcinpl87
  • 1,276
  • 1
  • 10
  • 10

0 Answers0