-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from q2ebanking/enhancement/BoaConstrictor-27…
…3_CloseWebDriver Enhancement/boa constrictor 273 close web driver
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
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,49 @@ | ||
using Boa.Constrictor.Screenplay; | ||
using OpenQA.Selenium; | ||
|
||
namespace Boa.Constrictor.Selenium | ||
{ | ||
/// <summary> | ||
/// Closes the WebDriver window or tab. | ||
/// </summary> | ||
public class CloseWebDriver : AbstractWebTask | ||
{ | ||
#region Constructors | ||
|
||
/// <summary> | ||
/// Private constructor. | ||
/// (Use static builder methods to construct.) | ||
/// </summary> | ||
private CloseWebDriver() { } | ||
|
||
#endregion | ||
|
||
#region Builder Methods | ||
|
||
/// <summary> | ||
/// Constructs the Task object. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static CloseWebDriver ForBrowser() => new CloseWebDriver(); | ||
|
||
#endregion | ||
|
||
#region Methods | ||
|
||
/// <summary> | ||
/// Closes the WebDriver window or tab. | ||
/// WARNING: You must switch back to a valid window handle in order to continue execution | ||
/// </summary> | ||
/// <param name="actor">The Screenplay Actor.</param> | ||
/// <param name="driver">The WebDriver.</param> | ||
public override void PerformAs(IActor actor, IWebDriver driver) => driver.Close(); | ||
|
||
/// <summary> | ||
/// Returns a description of the Task. | ||
/// </summary> | ||
/// <returns></returns> | ||
public override string ToString() => "close the WebDriver window or tab"; | ||
|
||
#endregion | ||
} | ||
} |
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