Skip to content

Commit

Permalink
Made the send_keys helper work in selenium as well as cuprite
Browse files Browse the repository at this point in the history
A few of the test helpers use the `type` helper method but in selenium it raises this error:

     NoMethodError:
       undefined method `keyboard' for #<Selenium::WebDriver::Chrome::Driver:0x000000013ebbb950>

I've changed this to do the same thing (type in the focused element) but in a way that should work in every capybara driver.
  • Loading branch information
iainbeeston committed Oct 10, 2024
1 parent 5a60b49 commit 9be468c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/avo/test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def tag_suggestions(field:, input:)
end

def type(...)
page.driver.browser.keyboard.type(...)
page.send_keys(...)
end

def accept_custom_alert(&block)
Expand Down

0 comments on commit 9be468c

Please sign in to comment.