-
-
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.
Refactoring .NET driver Options classes to descend from common class
This commit introduces a common base class for driver-specific type-safe Options classes (e.g., ChromeOptions, InternetExplorerOptions, etc.). This will help pave the way to eliminate needing to know the name or expected type of arbitrary capabilities in a future release.
- Loading branch information
Showing
10 changed files
with
123 additions
and
51 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 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// <copyright file="DriverOptions.cs" company="WebDriver Committers"> | ||
// 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. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OpenQA.Selenium | ||
{ | ||
/// <summary> | ||
/// Base class for managing options specific to a browser driver. | ||
/// </summary> | ||
public abstract class DriverOptions | ||
{ | ||
/// <summary> | ||
/// Provides a means to add additional capabilities not yet added as type safe options | ||
/// for the specific browser driver. | ||
/// </summary> | ||
/// <param name="capabilityName">The name of the capability to add.</param> | ||
/// <param name="capabilityValue">The value of the capability to add.</param> | ||
/// <exception cref="ArgumentException"> | ||
/// thrown when attempting to add a capability for which there is already a type safe option, or | ||
/// when <paramref name="capabilityName"/> is <see langword="null"/> or the empty string. | ||
/// </exception> | ||
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object)"/> | ||
/// where <paramref name="capabilityName"/> has already been added will overwrite the | ||
/// existing value with the new value in <paramref name="capabilityValue"/>. | ||
/// </remarks> | ||
public abstract void AddAdditionalCapability(string capabilityName, object capabilityValue); | ||
|
||
/// <summary> | ||
/// Returns DesiredCapabilities for the specific browser driver with these | ||
/// options included ascapabilities. This does not copy the options. Further | ||
/// changes will be reflected in the returned capabilities. | ||
/// </summary> | ||
/// <returns>The DesiredCapabilities for browser driver with these options.</returns> | ||
public abstract ICapabilities ToCapabilities(); | ||
} | ||
} |
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 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 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 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 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 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 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 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