-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dotnet] remove hard coded service parameters from test environment (#…
…12343) [dotnet] remove hard coded service parameters from test environment setup
- Loading branch information
1 parent
7589a65
commit 3fbd0e5
Showing
21 changed files
with
63 additions
and
443 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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
19 changes: 6 additions & 13 deletions
19
dotnet/test/common/CustomDriverConfigs/DevChannelChromeDriver.cs
This file contains 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 |
---|---|---|
@@ -1,28 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OpenQA.Selenium.Chrome | ||
{ | ||
public class DevChannelChromeDriver : ChromeDriver | ||
{ | ||
public DevChannelChromeDriver(ChromeDriverService service) | ||
: this(service, DefaultOptions) | ||
public DevChannelChromeDriver() | ||
: base(DefaultOptions) | ||
{ | ||
} | ||
|
||
public DevChannelChromeDriver(ChromeDriverService service, ChromeOptions options) | ||
: base(service, options) | ||
// Required for dynamic setting with `EnvironmentManager.Instance.CreateDriverInstance(options)` | ||
public DevChannelChromeDriver(ChromeOptions options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public static ChromeOptions DefaultOptions | ||
{ | ||
// The below path to the Chrome Developer Channel executable is obviously hard-coded. | ||
// On non-Windows OSes, and for custom install locations, you will need to add a | ||
// property to the below options: BinaryLocation = <path to Chrome.exe> | ||
get { return new ChromeOptions() { BinaryLocation = @"C:\Program Files (x86)\Google\Chrome Dev\Application\chrome.exe", AcceptInsecureCertificates = true }; } | ||
get { return new ChromeOptions() { BrowserVersion = "dev" }; } | ||
} | ||
} | ||
} |
40 changes: 5 additions & 35 deletions
40
dotnet/test/common/CustomDriverConfigs/DevChannelEdgeDriver.cs
This file contains 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 |
---|---|---|
@@ -1,51 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OpenQA.Selenium.Edge | ||
{ | ||
public class DevChannelEdgeDriver : EdgeDriver | ||
{ | ||
private static string servicePath = string.Empty; | ||
|
||
public DevChannelEdgeDriver() | ||
: this(DefaultService, DefaultOptions) | ||
: base(DefaultOptions) | ||
{ | ||
} | ||
|
||
public DevChannelEdgeDriver(EdgeDriverService service, EdgeOptions options) | ||
: base(service, options) | ||
// Required for dynamic setting with `EnvironmentManager.Instance.CreateDriverInstance(options)` | ||
public DevChannelEdgeDriver(EdgeOptions options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public static EdgeOptions DefaultOptions | ||
{ | ||
get { | ||
// The below path to the Edge Developer Channel executable is obviously hard-coded. | ||
// On non-Windows OSes, and for custom install locations, you will need to add a | ||
// property to the below options: BinaryLocation = <path to MSEdge.exe> | ||
return new EdgeOptions() | ||
{ | ||
BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge Dev\Application\msedge.exe" | ||
}; | ||
} | ||
} | ||
|
||
public static EdgeDriverService DefaultService | ||
{ | ||
get | ||
{ | ||
EdgeDriverService service = EdgeDriverService.CreateDefaultService(ServicePath); | ||
return service; | ||
} | ||
} | ||
|
||
public static string ServicePath | ||
{ | ||
get { return servicePath; } | ||
set { servicePath = value; } | ||
get { return new EdgeOptions() { BrowserVersion = "dev" }; } | ||
} | ||
} | ||
} |
43 changes: 6 additions & 37 deletions
43
dotnet/test/common/CustomDriverConfigs/EdgeInternetExplorerModeDriver.cs
This file contains 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 |
---|---|---|
@@ -1,55 +1,24 @@ | ||
using OpenQA.Selenium.Remote; | ||
|
||
namespace OpenQA.Selenium.IE | ||
{ | ||
// This is a simple wrapper class to create an InternetExplorerDriver that | ||
// uses the enables RequireWindowFocus as the default input simplation. | ||
public class EdgeInternetExplorerModeDriver : InternetExplorerDriver | ||
{ | ||
private static string servicePath = string.Empty; | ||
|
||
public EdgeInternetExplorerModeDriver(InternetExplorerDriverService service) | ||
: this(service, DefaultOptions) | ||
{ | ||
} | ||
|
||
public EdgeInternetExplorerModeDriver(InternetExplorerDriverService service, InternetExplorerOptions options) | ||
: base(service, options) | ||
public EdgeInternetExplorerModeDriver() | ||
: base(DefaultOptions) | ||
{ | ||
} | ||
|
||
public static string ServicePath | ||
// Required for dynamic setting with `EnvironmentManager.Instance.CreateDriverInstance(options)` | ||
public EdgeInternetExplorerModeDriver(InternetExplorerOptions options) | ||
: base(options) | ||
{ | ||
get { return servicePath; } | ||
set { servicePath = value; } | ||
} | ||
|
||
public static InternetExplorerDriverService DefaultService | ||
{ | ||
get | ||
{ | ||
InternetExplorerDriverService service; | ||
if (string.IsNullOrEmpty(servicePath)) | ||
{ | ||
service = InternetExplorerDriverService.CreateDefaultService(); | ||
} | ||
else | ||
{ | ||
service = InternetExplorerDriverService.CreateDefaultService(servicePath); | ||
} | ||
|
||
// For debugging purposes, one can uncomment the following lines | ||
// to generate a log from the driver executable. Please do not | ||
// commit changes to this file with these lines uncommented. | ||
// service.LogFile = @"iedriver.log"; | ||
// service.LoggingLevel = InternetExplorerDriverLogLevel.Debug; | ||
return service; | ||
} | ||
} | ||
|
||
public static InternetExplorerOptions DefaultOptions | ||
{ | ||
get { return new InternetExplorerOptions() { RequireWindowFocus = true, UsePerProcessProxy = true, AttachToEdgeChrome = true, EdgeExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" }; } | ||
get { return new InternetExplorerOptions() { RequireWindowFocus = true, UsePerProcessProxy = true, AttachToEdgeChrome = true }; } | ||
} | ||
} | ||
} |
16 changes: 6 additions & 10 deletions
16
dotnet/test/common/CustomDriverConfigs/NightlyChannelFirefoxDriver.cs
This file contains 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 |
---|---|---|
@@ -1,28 +1,24 @@ | ||
using OpenQA.Selenium.Remote; | ||
|
||
namespace OpenQA.Selenium.Firefox | ||
{ | ||
// This is a simple wrapper class to create a FirefoxDriver that | ||
// uses the Marionette implementation and has no parameters in the | ||
// constructor. | ||
public class NightlyChannelFirefoxDriver : FirefoxDriver | ||
{ | ||
public NightlyChannelFirefoxDriver(FirefoxDriverService service) | ||
: this(service, DefaultOptions) | ||
public NightlyChannelFirefoxDriver() | ||
: base(DefaultOptions) | ||
{ | ||
} | ||
|
||
public NightlyChannelFirefoxDriver(FirefoxDriverService service, FirefoxOptions options) | ||
: base(service, options) | ||
// Required for dynamic setting with `EnvironmentManager.Instance.CreateDriverInstance(options)` | ||
public NightlyChannelFirefoxDriver(FirefoxOptions options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public static FirefoxOptions DefaultOptions | ||
{ | ||
// The below path to the Firefox Nightly Channel executable is obviously hard-coded. | ||
// On non-Windows OSes, and for custom install locations, you will need to add a | ||
// property to the below options: BrowserExecutableLocation = <path to Firefox.exe> | ||
get { return new FirefoxOptions() { BrowserExecutableLocation = @"C:\Program Files\Firefox Nightly\firefox.exe", AcceptInsecureCertificates = true }; } | ||
get { return new FirefoxOptions() { BrowserVersion = "nightly" }; } | ||
} | ||
} | ||
} |
This file contains 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
15 changes: 8 additions & 7 deletions
15
dotnet/test/common/CustomDriverConfigs/StableChannelChromeDriver.cs
This file contains 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
Oops, something went wrong.