-
Notifications
You must be signed in to change notification settings - Fork 242
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
Allow client options to be passed into Jasmine #519
Conversation
I am not quite sure I understand what is failing in the tests... |
I would love to get this merged. We also would like to pass client options. In this case, ours is to use chrome headless to run the tests using something like this:
|
Ok, in order to get things working for our use case, passing in the The line in question in this PR is driver = ::Selenium::WebDriver.for(driver_options[:client_driver], driver_options[:client_driver_opts] || {}) Calling
This is trying to pass the options into this function: def self.handshake(**opts) but because the Changing the line to: driver = ::Selenium::WebDriver.for(driver_options[:client_driver], @options[:client_driver_opts] || {}) bypasses the
This can be solved by duping the options each time they are used. My guess is that Selenium modifies the object on use somehow and expects a fresh This gives us the final line (which is working for me) here: driver = ::Selenium::WebDriver.for(driver_options[:client_driver], @options[:client_driver_opts]&.dup || {}) @jsilvestri, do you want to modify your PR to match this, would you like me to open a PR to your repo to merge this change into yours, or should I just open my own PR? |
@CyborgMaster I would just open a new PR that contains all the needed changes. Then we can get some movement on this issue! If you need help with anything, don't be shy. |
I'm a little lost -- can someone explain like I'm 5? I'm slammed at work, so if you just give me a clean PR with an explanation and reasonable certainty that it takes everything needed into account I'll merge it. |
#530 opened which contains all the fixes. |
@jsilvestri @jejacks0n pull requests are all failing now because of CodeClimate changes. Can you or anyone look into this? I'd like to get #530 merged soon as I have fixes waiting for them downstream. |
@tilsammans I'm trying to fix the Code Climate situation here in #534 |
Hello ya'll, #534 fixes the build so once that's merged we can hopefully push this forward. I'd like to see people be able to use Happy Holidays! |
There's several PRs that are linking to Other PRs.. I've merged the one that fixed the build.. what's the status of other ones? |
In principle #530 contains the fixed code, but tests are now failing because the method signature changed. I don't have time in the coming weeks to install |
@tilsammans I can't tell the difference, maybe you can rebase? |
@tilsammans Yep, I've seen both but I'm clearly not in a place to tell which patch is best -- my suggestion is to rebase so the tests pass and / or explain how they defer. It's very likely someone with more context (i.e. the maintainer) can tell the difference but all your PR proclaims is that it "continues" this PR. How about elaborating on why your patch should be merged instead of this? What does it improve or how does it differ? Adding as much context as possible will help you get your patches merged in an ad-hoc open-source project such as this. |
@zzak allright: my pull request #530 contains the changes proposed by @CyborgMaster which duplicates the options. He never submitted a pull request so I did that. The tests are currently failing because the signature of the method changed. (both here and in my PR). Since I don't have |
I've been trying to get this working by using the branch, but every time, I get This works on Travis. Chromedriver is working for the Capybara Rails tests. Any ideas why I get that? Edit: I tried the branch for #530 too. Not sure what's up. |
you might need to use the chromedriver-helper gem. https://github.com/flavorjones/chromedriver-helper Just add it to your gemfile and it should work -- I'm not fully sure about this either, but I've seen that on other projects too. |
@jejacks0n I've got that (Capybara on Rails suite is using it) and tried updating it, but haven't gotten this working locally. Oddly, it works on Travis using the exact same config. |
Since I arrived here trying to get chrome headless working and concluded from this PR originally that chrome headless was not being worked on I thought I would share this update: I noticed that another PR was merged to support selenium options on master via: #537. If you install from master it looks like you can specify the to use chrome headless via config.driver_options = {
client_driver: :chrome,
selenium_options: {
options: Selenium::WebDriver::Chrome::Options.new(args: ['headless', 'disable-gpu'])
}
} I am going to try and help @jejacks0n a little here:
It sure would be great if we could get a new gem cut too. |
1d95ed2
to
d6352cb
Compare
looks like #537 properly fix this issue, please reopen if you disagree |
This addresses #518. Example usage in teaspoon_env.rb: