From 705d43bf0ab323228e5023fc0b6cd28d013919f9 Mon Sep 17 00:00:00 2001 From: James Croft Date: Mon, 11 Mar 2024 21:18:11 +0000 Subject: [PATCH] Update templates --- .../GlobalUsings.cs | 4 ++- .../Legerity.Templates.Android.NUnit.csproj | 18 +++++++++---- .../Pages/SamplePage.cs | 2 +- .../Tests/SampleTests.cs | 3 ++- .../GlobalUsings.cs | 4 ++- ...erity.Templates.CrossPlatform.NUnit.csproj | 26 ++++++++++++++----- .../Pages/SamplePage.cs | 8 +++--- .../Tests/SampleTests.cs | 2 +- .../GlobalUsings.cs | 4 ++- .../Legerity.Templates.IOS.NUnit.csproj | 18 +++++++++---- .../Pages/SamplePage.cs | 2 +- .../Tests/SampleTests.cs | 2 +- .../GlobalUsings.cs | 4 ++- .../Legerity.Templates.Web.NUnit.csproj | 22 +++++++++++----- .../Pages/SamplePage.cs | 2 +- .../Tests/SampleTests.cs | 2 +- .../GlobalUsings.cs | 4 ++- .../Legerity.Templates.Windows.NUnit.csproj | 23 +++++++++++----- .../Pages/SamplePage.cs | 2 +- .../Tests/SampleTests.cs | 2 +- 20 files changed, 105 insertions(+), 49 deletions(-) diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/GlobalUsings.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/GlobalUsings.cs index afa4133d..c7f7e880 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/GlobalUsings.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/GlobalUsings.cs @@ -3,4 +3,6 @@ global using Legerity; global using Legerity.Android; global using Legerity.Pages; -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; +global using OpenQA.Selenium; +global using OpenQA.Selenium.Remote; \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Legerity.Templates.Android.NUnit.csproj b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Legerity.Templates.Android.NUnit.csproj index efa8cc8a..d691b7aa 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Legerity.Templates.Android.NUnit.csproj +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Legerity.Templates.Android.NUnit.csproj @@ -7,15 +7,23 @@ - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Pages/SamplePage.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Pages/SamplePage.cs index 7bf57ade..5cced7e8 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Pages/SamplePage.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Pages/SamplePage.cs @@ -10,7 +10,7 @@ public SamplePage() { } - public SamplePage(RemoteWebDriver app) + public SamplePage(WebDriver app) : base(app, BaseTestClass.ImplicitWait) { } diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Tests/SampleTests.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Tests/SampleTests.cs index 00939a73..50f2279a 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Tests/SampleTests.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Android.NUnit/Tests/SampleTests.cs @@ -1,6 +1,7 @@ namespace Legerity.Templates.Android.NUnit.Tests; using Legerity.Templates.Android.NUnit.Pages; +using OpenQA.Selenium; using OpenQA.Selenium.Remote; [TestFixtureSource(nameof(PlatformOptions))] @@ -14,7 +15,7 @@ public SampleTests(AppManagerOptions options) [Test] public void ShouldLoadPage() { - RemoteWebDriver app = this.StartApp(); + WebDriver app = this.StartApp(); new SamplePage(app).VerifyPageLoaded(); } } \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/GlobalUsings.cs b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/GlobalUsings.cs index 6f44aebe..b4af81b4 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/GlobalUsings.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/GlobalUsings.cs @@ -6,4 +6,6 @@ global using Legerity.Web; global using Legerity.Windows; global using Legerity.Pages; -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; +global using OpenQA.Selenium; +global using OpenQA.Selenium.Remote; \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Legerity.Templates.CrossPlatform.NUnit.csproj b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Legerity.Templates.CrossPlatform.NUnit.csproj index baa1bcbd..5469c5c2 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Legerity.Templates.CrossPlatform.NUnit.csproj +++ b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Legerity.Templates.CrossPlatform.NUnit.csproj @@ -7,19 +7,31 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Pages/SamplePage.cs b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Pages/SamplePage.cs index 69d04e92..7f52dede 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Pages/SamplePage.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Pages/SamplePage.cs @@ -13,7 +13,7 @@ public SamplePage() { } - public SamplePage(RemoteWebDriver app) + public SamplePage(WebDriver app) : base(app, BaseTestClass.ImplicitWait) { } @@ -33,9 +33,9 @@ private By DetermineTrait() { return this.App switch { - WindowsDriver => WindowsByExtras.AutomationId("sampleButton"), - AndroidDriver => By.Id("sampleButton"), - IOSDriver => By.Name("sampleButton"), + WindowsDriver => WindowsByExtras.AutomationId("sampleButton"), + AndroidDriver => By.Id("sampleButton"), + IOSDriver => By.Name("sampleButton"), _ => By.TagName("button") }; } diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Tests/SampleTests.cs b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Tests/SampleTests.cs index e44c529d..bbd1b8d5 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Tests/SampleTests.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.CrossPlatform.NUnit/Tests/SampleTests.cs @@ -14,7 +14,7 @@ public SampleTests(AppManagerOptions options) [Test] public void ShouldLoadPage() { - RemoteWebDriver app = this.StartApp(); + WebDriver app = this.StartApp(); new SamplePage(app).VerifyPageLoaded(); } } \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/GlobalUsings.cs b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/GlobalUsings.cs index 9d31f4dc..87d28eb6 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/GlobalUsings.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/GlobalUsings.cs @@ -3,4 +3,6 @@ global using Legerity; global using Legerity.IOS; global using Legerity.Pages; -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; +global using OpenQA.Selenium; +global using OpenQA.Selenium.Remote; \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Legerity.Templates.IOS.NUnit.csproj b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Legerity.Templates.IOS.NUnit.csproj index 99d2cae5..dcff7999 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Legerity.Templates.IOS.NUnit.csproj +++ b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Legerity.Templates.IOS.NUnit.csproj @@ -7,15 +7,23 @@ - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Pages/SamplePage.cs b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Pages/SamplePage.cs index c1655896..e21890d4 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Pages/SamplePage.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Pages/SamplePage.cs @@ -10,7 +10,7 @@ public SamplePage() { } - public SamplePage(RemoteWebDriver app) + public SamplePage(WebDriver app) : base(app, BaseTestClass.ImplicitWait) { } diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Tests/SampleTests.cs b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Tests/SampleTests.cs index 236d677d..f5a626ad 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Tests/SampleTests.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.IOS.NUnit/Tests/SampleTests.cs @@ -14,7 +14,7 @@ public SampleTests(AppManagerOptions options) [Test] public void ShouldLoadPage() { - RemoteWebDriver app = this.StartApp(); + WebDriver app = this.StartApp(); new SamplePage(app).VerifyPageLoaded(); } } \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/GlobalUsings.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/GlobalUsings.cs index 2ac570eb..0d499602 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/GlobalUsings.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/GlobalUsings.cs @@ -3,4 +3,6 @@ global using Legerity; global using Legerity.Pages; global using Legerity.Web; -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; +global using OpenQA.Selenium; +global using OpenQA.Selenium.Remote; \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Legerity.Templates.Web.NUnit.csproj b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Legerity.Templates.Web.NUnit.csproj index 7c56cc4c..303fe09d 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Legerity.Templates.Web.NUnit.csproj +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Legerity.Templates.Web.NUnit.csproj @@ -1,4 +1,4 @@ - + net6.0;net7.0;net8.0 @@ -7,16 +7,24 @@ - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Pages/SamplePage.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Pages/SamplePage.cs index fe592dfc..5fd6db90 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Pages/SamplePage.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Pages/SamplePage.cs @@ -10,7 +10,7 @@ public SamplePage() { } - public SamplePage(RemoteWebDriver app) + public SamplePage(WebDriver app) : base(app, BaseTestClass.ImplicitWait) { } diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Tests/SampleTests.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Tests/SampleTests.cs index a756c39b..43a6b4cd 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Tests/SampleTests.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Web.NUnit/Tests/SampleTests.cs @@ -15,7 +15,7 @@ public SampleTests(AppManagerOptions options) [Test] public void ShouldLoadPage() { - RemoteWebDriver app = this.StartApp(); + WebDriver app = this.StartApp(); new SamplePage(app).VerifyPageLoaded(); } } \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/GlobalUsings.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/GlobalUsings.cs index 4ee19433..0eadd8a0 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/GlobalUsings.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/GlobalUsings.cs @@ -3,4 +3,6 @@ global using Legerity; global using Legerity.Pages; global using Legerity.Windows; -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; +global using OpenQA.Selenium; +global using OpenQA.Selenium.Remote; \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Legerity.Templates.Windows.NUnit.csproj b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Legerity.Templates.Windows.NUnit.csproj index ac494b0c..a328ae5e 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Legerity.Templates.Windows.NUnit.csproj +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Legerity.Templates.Windows.NUnit.csproj @@ -1,4 +1,4 @@ - + net6.0;net7.0;net8.0 @@ -7,16 +7,25 @@ - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Pages/SamplePage.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Pages/SamplePage.cs index 0e06d6e5..42f3a60a 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Pages/SamplePage.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Pages/SamplePage.cs @@ -10,7 +10,7 @@ public SamplePage() { } - public SamplePage(RemoteWebDriver app) + public SamplePage(WebDriver app) : base(app, BaseTestClass.ImplicitWait) { } diff --git a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Tests/SampleTests.cs b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Tests/SampleTests.cs index 1b6e7369..c90dd5f9 100644 --- a/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Tests/SampleTests.cs +++ b/tools/Legerity.Templates/templates/Legerity.Templates.Windows.NUnit/Tests/SampleTests.cs @@ -14,7 +14,7 @@ public SampleTests(AppManagerOptions options) [Test] public void ShouldLoadPage() { - RemoteWebDriver app = this.StartApp(); + WebDriver app = this.StartApp(); new SamplePage(app).VerifyPageLoaded(); } } \ No newline at end of file