titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

Make WSL detection more generic #187

Closed rbclark closed 3 years ago

rbclark commented 3 years ago

On WSL2, the contents of /proc/version seem to have changed slightly, the command currently in webdrivers currently returns false:

irb(main):001:0> File.open('/proc/version').read.include?('Microsoft')
=> false
irb(main):002:0> File.open('/proc/version').read.downcase.include?('microsoft')
=> true

Full contents for completeness:

irb(main):003:0> File.open('/proc/version').read
=> "Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020\n"

Unfortunately this does not seem to fix all of the issues, although I am unsure if the rest of the issues are in the webdrivers gem or not. I am still receiving a Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver 127.0.0.1:9515 error when trying to run on WSL2 with a pretty barebones Rails system test setup.

kapoorlakshya commented 3 years ago

@rbclark Thanks for your contribution! Will try to release all the recent changes this weekend.