Ruby 3.2.2 and Rails 7.1.2 Issues
RailsCod3rFuture opened this issue · comments
Meta
Capybara Version:
3.39.2
Driver Information (and browser if relevant):
cuprite/chrome-headless (latest)
Expected Behavior
Javascript should load alongside CSS when rendering page & elements will be accessible by capybara finders
Actual Behavior
CSS loads but Javascript doesn't and capybara is failing with the error below
Capybara::Ambiguous:
Ambiguous match, found 2 elements matching visible link or button "Element"
Steps to reproduce
- Required gems: Latest sprockets-rails, terser, sass-rails, psych < 4, capybara, cuprite, webdrivers, capybara-screenshot
- Create a test with some javascript/jquery elements
- View the screenshot and see that no js elements are hidden
I turned on JS errors and I'm getting an error for Jquery not being present.
Ferrum::JavaScriptError: ReferernceError: $ is not defined
@RailsCod3rFuture Did you solve this problem? I'm facing the same issue.
It was related to jquery not being available for cuprite. Add a reference to your jquery file for the extensions option for cuprite & any other mandatory file for your ui. Most should work after the jquery reference is set. @huynghodfords