stepful / cyperful

Interactive system testing UI for capybara
MIT License
325 stars 6 forks source link

README: use new Selenium driver syntax. #6

Closed MikeMcQuaid closed 4 months ago

MikeMcQuaid commented 4 months ago

Avoids deprecation warnings:

2024-05-20 14:14:07 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger:
  https://selenium.dev/documentation/webdriver/troubleshooting/logging

2024-05-20 14:14:07 WARN Selenium [DEPRECATION] DriverFinder.path(options, service_class) is deprecated. Use DriverFinder.new(options, service).driver_path instead.

I also personally found the screen size declaration to be not useful (possibly doing nothing) so it could maybe be removed too.

wyattades commented 4 months ago

can you point me to the docs @MikeMcQuaid? I see the rails docs still use the old syntax https://guides.rubyonrails.org/testing.html#changing-the-default-settings

MikeMcQuaid commented 4 months ago

@wyattades No documentation links, I'm afraid. I'd used this syntax because I wanted to get console.log assertions which required:

    # Need to pass headless=new to Chrome to get console logs on latest Chrome versions.
    Capybara.register_driver :selenium_chrome_headless_new do |app|
      options = Selenium::WebDriver::Chrome::Options.new(args: ["headless=new"])
      Capybara::Selenium::Driver.new(app, browser: :chrome, options:)
    end

This was before I tried Cyperful, noticed you get deprecation warnings that the above syntax did not get.

The closest relevant docs I can find are https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings

MikeMcQuaid commented 4 months ago

@wyattades Any more thoughts here? No hard feelings if you want to close this out, just want to try and get this either merged or closed.