Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Selenium::WebDriver::SeleniumManager.binary errors if cannot find spec filure #14925

Open
voxik opened this issue Dec 20, 2024 · 2 comments

Comments

@voxik
Copy link

voxik commented Dec 20, 2024

What happened?

Trying to execute the Ruby selenium-webdroverhe test suite, I observe Selenium::WebDriver::SeleniumManager.binary errors if cannot find spec error.

Reading the code, I can't see that File.exist?, which is stubbed by the test case, would be anywhere as part of the Selenium::WebDriver::SeleniumManager.binary call. But then why you don't see the failure upstream? Sorry, I cannot wrap my head about the usage of Bazel and where I could spot the error in GH actions 🤷

How can we reproduce the issue?

$ rspec spec/unit/selenium/webdriver/common/selenium_manager_spec.rb:61
Run options: include {:locations=>{"./spec/unit/selenium/webdriver/common/selenium_manager_spec.rb"=>[61]}}

Selenium::WebDriver::SeleniumManager
  .binary
    errors if cannot find (FAILED - 1)

Failures:

  1) Selenium::WebDriver::SeleniumManager.binary errors if cannot find
     Failure/Error: expect { described_class.send(:binary) }.to raise_error(Error::WebDriverError, /not a file/)
       expected Selenium::WebDriver::Error::WebDriverError with message matching /not a file/ but nothing was raised
     # ./spec/unit/selenium/webdriver/common/selenium_manager_spec.rb:64:in `block (3 levels) in <module:WebDriver>'
     # /usr/share/gems/gems/webmock-3.23.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <top (required)>'

Finished in 0.00954 seconds (files took 0.201 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/unit/selenium/webdriver/common/selenium_manager_spec.rb:61 # Selenium::WebDriver::SeleniumManager.binary errors if cannot find

Operating System

Fedora Rawhide

Selenium version

Ruby 3.3.6, selenium-webdriver 4.27.0

Copy link

@voxik, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@voxik
Copy link
Author

voxik commented Dec 20, 2024

Ah, I got the problem. The repo does not contain any binary in the bin directory, while the gem ships the binaries. But then the File.exist? stub is completely useless and the test case is a bit bogus.

allow(File).to receive(:exist?).with(a_string_including('selenium-manager')).and_return(false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant