-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[rb] Allow driver path to be set using ENV variables #14287
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
Merged
p0deje
merged 22 commits into
SeleniumHQ:trunk
from
aguspe:rb_use_env_var_for_driver_location
Sep 16, 2024
Merged
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d3af87c
Add ENV variables for path
aguspe 1a24735
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe 910f297
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe 4ba0c7e
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe 3242228
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe 13f0336
Update RBS and gecko driver
aguspe e0be315
Update RBS and tests
aguspe 154e35c
Remove firefox guard
aguspe 8bd44c2
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe a2152ec
Merge branch 'rb_use_env_var_for_driver_location' of github.com:agusp…
aguspe 09d6cb1
Update environment to be working now
aguspe b0f0277
Remove extra spaces
aguspe d57095b
update rbs
aguspe 01860f6
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe d207384
Move tests from integration to unit tests
aguspe 18a140a
Update specs and add service environment variable
aguspe 37d9145
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe 9975b39
Move the integration tests to unit tests
aguspe e982b78
Merge remote-tracking branch 'origin/rb_use_env_var_for_driver_locati…
aguspe 510b50e
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe b14883d
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe a6a1720
Merge branch 'trunk' into rb_use_env_var_for_driver_location
aguspe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Licensed to the Software Freedom Conservancy (SFC) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The SFC licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| require_relative '../spec_helper' | ||
|
|
||
| module Selenium | ||
| module WebDriver | ||
| module IE | ||
| describe Service, exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :ie}] do | ||
| let(:service) { described_class.new } | ||
| let(:service_manager) { service.launch } | ||
|
|
||
| after { service_manager.stop } | ||
|
|
||
| it 'auto uses iedriver' do | ||
| service.executable_path = DriverFinder.new(Options.new, described_class.new).driver_path | ||
|
|
||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
|
|
||
| it 'can be started outside driver' do | ||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
|
|
||
| it 'uses the path from the environment' do | ||
| ENV['SE_IEIDRIVER'] = DriverFinder.new(Options.new, described_class.new).driver_path | ||
|
|
||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
|
|
||
| it 'updates the path after setting the environment variable' do | ||
| ENV['SE_IEIDRIVER'] = '/foo/bar' | ||
| service.executable_path = DriverFinder.new(Options.new, described_class.new).driver_path | ||
|
|
||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
| end | ||
| end # IE | ||
| end # WebDriver | ||
| end # Selenium |
56 changes: 56 additions & 0 deletions
56
rb/spec/integration/selenium/webdriver/safari/service_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Licensed to the Software Freedom Conservancy (SFC) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The SFC licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| require_relative '../spec_helper' | ||
|
|
||
| module Selenium | ||
| module WebDriver | ||
| module Safari | ||
| describe Service, exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :safari}] do | ||
| let(:service) { described_class.new } | ||
| let(:service_manager) { service.launch } | ||
|
|
||
| after { service_manager.stop } | ||
|
|
||
| it 'auto uses safaridriver' do | ||
| service.executable_path = DriverFinder.new(Options.new, described_class.new).driver_path | ||
|
|
||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
|
|
||
| it 'can be started outside driver' do | ||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
|
|
||
| it 'uses the path from the environment' do | ||
| ENV['SE_SAFARIDRIVER'] = DriverFinder.new(Options.new, described_class.new).driver_path | ||
|
|
||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
|
|
||
| it 'updates the path after setting the environment variable' do | ||
| ENV['SE_SAFARIDRIVER'] = '/foo/bar' | ||
| service.executable_path = DriverFinder.new(Options.new, described_class.new).driver_path | ||
|
|
||
| expect(service_manager.uri).to be_a(URI) | ||
| end | ||
| end | ||
| end # Safari | ||
| end # WebDriver | ||
| end # Selenium |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.