I have a button on a page which only appears when hovering over a certain element. But I can't figure out how to emulate this and then click on the link so I can cucumber test it using Capybara and Selenium.
You may want use a custom defined step for this, like:
When /^I click "([^"]*)" inside element "([^"]*)"$/ do |button, element_name|
Inside, you write something like:
begin
evaluate_script("$('#{element_name}').trigger('mouseover')")
rescue Capybara::NotSupportedByDriverError
end
And then you click that button you want :)
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