Skip to content

Commit

Permalink
restore msedgedriver functionality to Selenium Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 28, 2022
1 parent 765704f commit 4059519
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dotnet/src/webdriver/SeleniumManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public static class SeleniumManager
private static string binary;
private static readonly List<string> KnownDrivers = new List<string>() {
"geckodriver.exe",
"chromedriver.exe"
"chromedriver.exe",
"msedgedriver.exe"
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/manager/SeleniumManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private File getBinary() {
* @return the location of the driver.
*/
public String getDriverPath(String driverName) {
if (!ImmutableList.of("geckodriver", "chromedriver").contains(driverName)) {
if (!ImmutableList.of("geckodriver", "chromedriver", "msedgedriver").contains(driverName)) {
throw new WebDriverException("Unable to locate driver with name: " + driverName);
}

Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/selenium_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def driver_location(browser: str) -> str:
- browser: which browser to get the driver path for.
:Returns: The driver path to use
"""
if browser not in ("chrome", "firefox"):
if browser not in ("chrome", "firefox", "edge"):
raise WebDriverException(f"Unable to locate driver associated with browser name: {browser}")

args = (str(SeleniumManager.get_binary()), "--browser", browser)
Expand Down
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/common/selenium_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class << self
# @return [String] the path to the correct driver.
def driver_path(driver_name)
@driver_path ||= begin
unless %w[chromedriver geckodriver].include?(driver_name)
unless %w[chromedriver geckodriver msedgedriver].include?(driver_name)
msg = "Unable to locate driver with name: #{driver_name}"
raise Error::WebDriverError, msg
end
Expand Down
38 changes: 38 additions & 0 deletions rb/spec/integration/selenium/webdriver/edge/service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 Edge
describe Service, exclusive: {browser: :edge} do
let(:service) { Service.new }
let(:service_manager) { service.launch }

after { service_manager.stop }

it 'auto uses edgedriver' do
allow(Platform).to receive(:find_binary)
expect(service_manager.uri).to be_a(URI)
end
end
end # Edge
end # WebDriver
end # Selenium

0 comments on commit 4059519

Please sign in to comment.