-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace IIE with Selenium in minimaltest.core
SHDocVw.InternetExplorer was always brittle and required the now per default blocked 127.0.0.1 instead of localhost. With update 1909(?) it even ignores the .Visible property, which re-triggers issue #3. The new iselenium/iselenium.core extensions mirror the now deprecated and unmaintainable iie/iie.core test API as closely as possible with the NuGet Selenium.WebDriver.
- Loading branch information
1 parent
fa30be9
commit be6a26a
Showing
33 changed files
with
883 additions
and
48 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Enter.ascx.cs" Inherits="asp.calculator.View.Enter" %> | ||
<p> | ||
<asp:TextBox ID="operandTextBox" runat="server" EnableViewState="false" | ||
size="15em" MaxLength="20"></asp:TextBox> | ||
<asp:textbox id="operandTextBox" runat="server" enableviewstate="false" | ||
size="15em" maxlength="20"></asp:textbox> | ||
</p> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using OpenQA.Selenium.IE; | ||
using System; | ||
|
||
namespace iselenium | ||
{ | ||
[Obsolete("Replaced by SeleniumTest<InternetExplorerDriver>")] | ||
public class IETest : SeleniumTest<InternetExplorerDriver> | ||
{ | ||
} | ||
|
||
[Obsolete("Replaced by SeleniumTest<InternetExplorerDriver, TController>")] | ||
public class IETest<TController> : SeleniumTest<InternetExplorerDriver, TController> | ||
{ | ||
} | ||
} |
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,13 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using System; | ||
|
||
namespace iselenium | ||
{ | ||
[Obsolete("Replaced by ISeleniumMiddleware")] | ||
public class IIEMiddleware : ISeleniumMiddleware | ||
{ | ||
public IIEMiddleware(RequestDelegate next) : base(next) | ||
{ | ||
} | ||
} | ||
} |
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,25 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using System.Threading.Tasks; | ||
|
||
namespace iselenium | ||
{ | ||
public class ISeleniumMiddleware | ||
{ | ||
protected readonly RequestDelegate _next; | ||
|
||
public ISeleniumMiddleware(RequestDelegate next) | ||
{ | ||
_next = next; | ||
} | ||
|
||
public async Task Invoke(HttpContext context) | ||
{ | ||
// Application_BeginRequest | ||
|
||
await _next(context); | ||
|
||
// Application_EndRequest | ||
SeleniumExtension.StatusCode = context.Response.StatusCode; | ||
} | ||
} | ||
} |
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,22 @@ | ||
using asplib.Controllers; | ||
using OpenQA.Selenium; | ||
|
||
namespace iselenium | ||
{ | ||
/// <summary> | ||
/// Minimal base class for IE tests with a [OneTimeSetUp]/[OneTimeTearDown] | ||
/// pair for starting/stopping Internet Explorer and a static Controller | ||
/// accessor. | ||
/// </summary> | ||
public abstract class SeleniumTest<TWebDriver, TController> : SeleniumTest<TWebDriver> | ||
where TWebDriver : IWebDriver, new() | ||
{ | ||
/// <summary> | ||
/// Typed accessor for the controller under test | ||
/// </summary> | ||
protected TController Controller | ||
{ | ||
get { return (TController)StaticControllerExtension.GetController(); } | ||
} | ||
} | ||
} |
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,39 @@ | ||
using asplib.Controllers; | ||
using NUnit.Framework; | ||
using OpenQA.Selenium; | ||
using OpenQA.Selenium.IE; | ||
|
||
namespace iselenium | ||
{ | ||
/// <summary> | ||
/// Base class for Browser tests with accessors for ISmcControl | ||
/// </summary> | ||
[TestFixture] | ||
public abstract class SmcTest<TWebDriver, TController, FSMContext, TState> : StorageTest<TController> | ||
where TWebDriver : IWebDriver, new() | ||
where TController : SmcController<FSMContext, TState> | ||
where FSMContext : statemap.FSMContext | ||
where TState : statemap.State | ||
{ | ||
protected FSMContext Fsm | ||
{ | ||
get { return this.Controller.Fsm; } | ||
} | ||
|
||
protected TState State | ||
{ | ||
get { return this.Controller.State; } | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Base class for IE tests with accessors for ISmcControl | ||
/// </summary> | ||
[TestFixture] | ||
public abstract class SmcTest<C, F, S> : SmcTest<InternetExplorerDriver, C, F, S> | ||
where C : SmcController<F, S> | ||
where F : statemap.FSMContext | ||
where S : statemap.State | ||
{ | ||
} | ||
} |
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,51 @@ | ||
using asplib.Model.Db; | ||
using NUnit.Framework; | ||
using OpenQA.Selenium; | ||
using OpenQA.Selenium.IE; | ||
using System.Collections.Generic; | ||
|
||
namespace iselenium | ||
{ | ||
/// <summary> | ||
/// Base class for Browser tests with a [OneTimeSetUp] / [OneTimeTearDown] pair | ||
/// for Storage.Database which cleans up newly added Main rows. | ||
/// Call SetUpStorage() to configure the storage for that specific test suite. | ||
/// Provides accessors for IStorageControl | ||
[TestFixture] | ||
public abstract class StorageTest<TWebDriver, TController> : SeleniumTest<TWebDriver, TController>, IDeleteNewRows | ||
where TWebDriver : IWebDriver, new() | ||
{ | ||
/// <summary> | ||
/// IDeleteNewRows | ||
/// </summary> | ||
public List<(string, string, object)> MaxIds { get; set; } | ||
|
||
/// <summary> | ||
/// Remember the last row in [Main] before the tests started | ||
/// </summary> | ||
[OneTimeSetUp] | ||
public void OneTimeSetUpDatabase() | ||
{ | ||
this.SelectMaxId(ASP_DBEntities.ConnectionString, "Main", "mainid"); | ||
} | ||
|
||
/// <summary> | ||
/// Delete any rows in [Main] that have been added since the test start | ||
/// </summary> | ||
[OneTimeTearDown] | ||
public void OneTimeTearDownDatabase() | ||
{ | ||
this.DeleteNewRows(ASP_DBEntities.ConnectionString); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Base class for IE tests with a [OneTimeSetUp] / [OneTimeTearDown] pair | ||
/// for Storage.Database which cleans up newly added Main rows. | ||
/// Call SetUpStorage() to configure the storage for that specific test suite. | ||
/// Provides accessors for IStorageControl | ||
[TestFixture] | ||
public abstract class StorageTest<C> : StorageTest<InternetExplorerDriver, C>, IDeleteNewRows | ||
{ | ||
} | ||
} |
Oops, something went wrong.