percy / percy-capybara

Visual testing for Capybara with Percy.
https://docs.percy.io/docs/capybara
MIT License
45 stars 23 forks source link

fix: Use `execute_script` over `evaluate_script` #147

Closed Robdel12 closed 4 years ago

Robdel12 commented 4 years ago

What is this?

This PR makes it possible (for sure) to use this package outside of Capybara (by eliminating the only Capybara specific method evaluate_script). In the future this package will likely be deprecated for a pure selenium ruby package (since this SDK implements nothing specific to Capybara).

This adds Capybara's version reporting to our UA and also checks to see if Capybara is being used. For some reason, it seems like Capybara wraps WebDriver's execute_script method and it doesn't return its value. If Capybara is being used, we'll use their evaluate_script method. Otherwise, we'll use the execute_script method like all the other selenium SDKs.