Skip to content

Commit d3b35ef

Browse files
bwaldermanjimevans
authored andcommitted
[dotnet] Remove Edge Legacy options.
Signed-off-by: Jim Evans <[email protected]>
1 parent 9b1d5f2 commit d3b35ef

File tree

8 files changed

+17
-442
lines changed

8 files changed

+17
-442
lines changed

dotnet/src/webdriver/Edge/EdgeDriver.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public EdgeDriver()
4040
/// </summary>
4141
/// <param name="options">The <see cref="EdgeOptions"/> to be used with the Edge driver.</param>
4242
public EdgeDriver(EdgeOptions options)
43-
: this(EdgeDriverService.CreateDefaultServiceFromOptions(options), options)
43+
: this(EdgeDriverService.CreateDefaultService(), options)
4444
{
4545
}
4646

@@ -49,7 +49,7 @@ public EdgeDriver(EdgeOptions options)
4949
/// </summary>
5050
/// <param name="service">The <see cref="EdgeDriverService"/> used to initialize the driver.</param>
5151
public EdgeDriver(EdgeDriverService service)
52-
: this(service, new EdgeOptions() { UseChromium = service.UsingChromium })
52+
: this(service, new EdgeOptions())
5353
{
5454
}
5555

@@ -82,7 +82,7 @@ public EdgeDriver(string edgeDriverDirectory, EdgeOptions options)
8282
/// <param name="options">The <see cref="EdgeOptions"/> to be used with the Edge driver.</param>
8383
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
8484
public EdgeDriver(string edgeDriverDirectory, EdgeOptions options, TimeSpan commandTimeout)
85-
: this(EdgeDriverService.CreateDefaultServiceFromOptions(edgeDriverDirectory, options), options, commandTimeout)
85+
: this(EdgeDriverService.CreateDefaultService(edgeDriverDirectory), options, commandTimeout)
8686
{
8787
}
8888

dotnet/src/webdriver/Edge/EdgeDriverService.cs

Lines changed: 12 additions & 261 deletions
Large diffs are not rendered by default.

dotnet/src/webdriver/Edge/EdgeOptions.cs

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,14 @@ public class EdgeOptions : ChromiumOptions
4747
{
4848
private const string DefaultBrowserNameValue = "MicrosoftEdge";
4949
private const string WebViewBrowserNameValue = "webview2";
50-
51-
// Engine switching
52-
private const string UseChromiumCapability = "ms:edgeChromium";
53-
private bool useChromium = true;
54-
5550
private const string EdgeOptionsCapabilityName = "edgeOptions";
5651

57-
// Edge Legacy options
58-
private const string UseInPrivateBrowsingCapability = "ms:inPrivate";
59-
private const string ExtensionPathsCapability = "ms:extensionPaths";
60-
private const string StartPageCapability = "ms:startPage";
61-
62-
private bool useInPrivateBrowsing;
63-
private string startPage;
64-
private List<string> extensionPaths = new List<string>();
65-
66-
// Additional Edge-specific Chromium options
67-
private bool useWebView;
68-
6952
/// <summary>
7053
/// Initializes a new instance of the <see cref="EdgeOptions"/> class.
7154
/// </summary>
7255
public EdgeOptions() : base()
7356
{
7457
this.BrowserName = DefaultBrowserNameValue;
75-
this.AddKnownCapabilityName(UseChromiumCapability, "UseChromium property");
76-
this.AddKnownCapabilityName(UseInPrivateBrowsingCapability, "UseInPrivateBrowsing property");
77-
this.AddKnownCapabilityName(StartPageCapability, "StartPage property");
78-
this.AddKnownCapabilityName(ExtensionPathsCapability, "AddExtensionPaths method");
79-
}
80-
81-
/// <summary>
82-
/// Gets or sets a value indicating whether to launch Edge Chromium. Defaults to using Edge Legacy.
83-
/// </summary>
84-
public bool UseChromium
85-
{
86-
get { return this.useChromium; }
87-
set { this.useChromium = value; }
8858
}
8959

9060
/// <summary>
@@ -112,110 +82,5 @@ public bool UseWebView
11282
get { return this.BrowserName == WebViewBrowserNameValue; }
11383
set { this.BrowserName = value ? WebViewBrowserNameValue : DefaultBrowserNameValue; }
11484
}
115-
116-
117-
/// <summary>
118-
/// Gets or sets a value indicating whether the browser should be launched using
119-
/// InPrivate browsing.
120-
/// </summary>
121-
public bool UseInPrivateBrowsing
122-
{
123-
get { return this.useInPrivateBrowsing; }
124-
set { this.useInPrivateBrowsing = value; }
125-
}
126-
127-
/// <summary>
128-
/// Gets or sets the URL of the page with which the browser will be navigated to on launch.
129-
/// </summary>
130-
public string StartPage
131-
{
132-
get { return this.startPage; }
133-
set { this.startPage = value; }
134-
}
135-
136-
/// <summary>
137-
/// Adds a path to an extension that is to be used with the Edge Legacy driver.
138-
/// </summary>
139-
/// <param name="extensionPath">The full path and file name of the extension.</param>
140-
public void AddExtensionPath(string extensionPath)
141-
{
142-
if (string.IsNullOrEmpty(extensionPath))
143-
{
144-
throw new ArgumentException("extensionPath must not be null or empty", "extensionPath");
145-
}
146-
147-
this.AddExtensionPaths(extensionPath);
148-
}
149-
150-
/// <summary>
151-
/// Adds a list of paths to an extensions that are to be used with the Edge Legacy driver.
152-
/// </summary>
153-
/// <param name="extensionPathsToAdd">An array of full paths with file names of extensions to add.</param>
154-
public void AddExtensionPaths(params string[] extensionPathsToAdd)
155-
{
156-
this.AddExtensionPaths(new List<string>(extensionPathsToAdd));
157-
}
158-
159-
/// <summary>
160-
/// Adds a list of paths to an extensions that are to be used with the Edge Legacy driver.
161-
/// </summary>
162-
/// <param name="extensionPathsToAdd">An <see cref="IEnumerable{T}"/> of full paths with file names of extensions to add.</param>
163-
public void AddExtensionPaths(IEnumerable<string> extensionPathsToAdd)
164-
{
165-
if (extensionPathsToAdd == null)
166-
{
167-
throw new ArgumentNullException("extensionPathsToAdd", "extensionPathsToAdd must not be null");
168-
}
169-
170-
this.extensionPaths.AddRange(extensionPathsToAdd);
171-
}
172-
173-
/// <summary>
174-
/// Returns DesiredCapabilities for Edge with these options included as
175-
/// capabilities. This copies the options. Further changes will not be
176-
/// reflected in the returned capabilities.
177-
/// </summary>
178-
/// <returns>The DesiredCapabilities for Edge with these options.</returns>
179-
public override ICapabilities ToCapabilities()
180-
{
181-
return this.useChromium ? ToChromiumCapabilities() : ToLegacyCapabilities();
182-
}
183-
184-
/// <summary>
185-
/// Adds vendor-specific capabilities for Chromium-based browsers.
186-
/// </summary>
187-
/// <param name="capabilities">The capabilities to add.</param>
188-
protected override void AddVendorSpecificChromiumCapabilities(IWritableCapabilities capabilities)
189-
{
190-
capabilities.SetCapability(EdgeOptions.UseChromiumCapability, this.useChromium);
191-
}
192-
193-
private ICapabilities ToChromiumCapabilities()
194-
{
195-
return base.ToCapabilities();
196-
}
197-
198-
private ICapabilities ToLegacyCapabilities()
199-
{
200-
IWritableCapabilities capabilities = this.GenerateDesiredCapabilities(true);
201-
capabilities.SetCapability(EdgeOptions.UseChromiumCapability, this.useChromium);
202-
203-
if (this.useInPrivateBrowsing)
204-
{
205-
capabilities.SetCapability(UseInPrivateBrowsingCapability, true);
206-
}
207-
208-
if (!string.IsNullOrEmpty(this.startPage))
209-
{
210-
capabilities.SetCapability(StartPageCapability, this.startPage);
211-
}
212-
213-
if (this.extensionPaths.Count > 0)
214-
{
215-
capabilities.SetCapability(ExtensionPathsCapability, this.extensionPaths);
216-
}
217-
218-
return capabilities.AsReadOnly();
219-
}
22085
}
22186
}

dotnet/test/common/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ SUPPORTED_BROWSERS = [
99
("firefoxnightly", "FirefoxNightly"),
1010
("ie", "IE"),
1111
("edge", "Edge"),
12-
("edgelegacy", "EdgeLegacy"),
1312
("safari", "Safari"),
1413
("safaritechpreview", "SafariTechPreview"),
1514
]

dotnet/test/common/CustomDriverConfigs/DevChannelEdgeDriver.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public static EdgeOptions DefaultOptions
2828
// property to the below options: BinaryLocation = <path to MSEdge.exe>
2929
return new EdgeOptions()
3030
{
31-
UseChromium = true,
3231
BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge Dev\Application\msedge.exe"
3332
};
3433
}
@@ -38,7 +37,7 @@ public static EdgeDriverService DefaultService
3837
{
3938
get
4039
{
41-
EdgeDriverService service = EdgeDriverService.CreateChromiumService(ServicePath);
40+
EdgeDriverService service = EdgeDriverService.CreateDefaultService(ServicePath);
4241
return service;
4342
}
4443
}

dotnet/test/common/CustomDriverConfigs/LegacyEdgeDriver.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

dotnet/test/common/CustomDriverConfigs/StableChannelEdgeDriver.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public static EdgeOptions DefaultOptions
2828
// property to the below options: BinaryLocation = <path to MSEdge.exe>
2929
return new EdgeOptions()
3030
{
31-
UseChromium = true,
3231
BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
3332
};
3433
}
@@ -38,7 +37,7 @@ public static EdgeDriverService DefaultService
3837
{
3938
get
4039
{
41-
EdgeDriverService service = EdgeDriverService.CreateChromiumService(ServicePath);
40+
EdgeDriverService service = EdgeDriverService.CreateDefaultService(ServicePath);
4241
return service;
4342
}
4443
}

dotnet/test/common/appconfig.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@
5959
"RemoteCapabilities": "MicrosoftEdge"
6060
},
6161

62-
"EdgeLegacy": {
63-
"DriverTypeName": "OpenQA.Selenium.Edge.LegacyEdgeDriver",
64-
"AssemblyName": "WebDriver.Common.Tests",
65-
"BrowserValue": "EdgeLegacy",
66-
"RemoteCapabilities": "MicrosoftEdge"
67-
},
68-
6962
"Firefox": {
7063
"DriverTypeName": "OpenQA.Selenium.Firefox.StableChannelFirefoxDriver",
7164
"AssemblyName": "WebDriver.Common.Tests",

0 commit comments

Comments
 (0)