I have an HTML5 canvas element that triggers different actions depending on where it is clicked.
Is there any way I can simulate this behavior in my test specs using Capybara
Had a look at the click code on Capybara & noticed you can pass x & y co-ordinates to where you want to click: https://github.com/teamcapybara/capybara/blob/8f86f46d2c486aa27045f853ff7696f5aa34dcf4/lib/capybara/node/element.rb#L157-L174
This is working for me on capybara:
page.find('#canvas-id').click([], { x: 50, y: 80 })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With