From d9045c4c5f9c87135f578babf07dfb07af4f1ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Sat, 28 Dec 2024 19:55:40 +0100 Subject: [PATCH 01/11] Removing InternetExplorer attribute and other IE methods and references. --- .../Attributes/InternetExplorerAttribute.cs | 8 -------- Lombiq.Tests.UI/Docs/Tools.md | 1 - Lombiq.Tests.UI/Services/AtataFactory.cs | 1 - .../OrchardCoreUITestExecutorConfiguration.cs | 1 - Lombiq.Tests.UI/Services/WebDriverFactory.cs | 13 ------------- 5 files changed, 24 deletions(-) delete mode 100644 Lombiq.Tests.UI/Attributes/InternetExplorerAttribute.cs diff --git a/Lombiq.Tests.UI/Attributes/InternetExplorerAttribute.cs b/Lombiq.Tests.UI/Attributes/InternetExplorerAttribute.cs deleted file mode 100644 index 28642cb76..000000000 --- a/Lombiq.Tests.UI/Attributes/InternetExplorerAttribute.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Lombiq.Tests.UI.Services; - -namespace Lombiq.Tests.UI.Attributes; - -public sealed class InternetExplorerAttribute : BrowserAttributeBase -{ - protected override Browser Browser => Browser.InternetExplorer; -} diff --git a/Lombiq.Tests.UI/Docs/Tools.md b/Lombiq.Tests.UI/Docs/Tools.md index e0b87edc6..4d551e317 100644 --- a/Lombiq.Tests.UI/Docs/Tools.md +++ b/Lombiq.Tests.UI/Docs/Tools.md @@ -5,7 +5,6 @@ - Chrome needs to be installed on your machine, the latest version. If you also want to test other browsers then install the latest version of each of them: - For Edge only the new Chromium-based Edge is supported that you can download from [here](https://www.microsoft.com/en-us/edge). - For Firefox it needs to be installed too. - - For IE you'll need to do [some manual configuration](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration) in the browser. - Browser driver setup is automated with [Atata.WebDriverSetup](https://github.com/atata-framework/atata-webdriversetup). - There are multiple recording tools available for Selenium but the "official" one which works pretty well is [Selenium IDE](https://www.selenium.dev/selenium-ide/) (which is a Chrome/Firefox extension). To fine-tune XPath queries and CSS selectors and also to record tests check out [ChroPath](https://chrome.google.com/webstore/detail/chropath/ljngjbnaijcbncmcnjfhigebomdlkcjo/) (the [Xpath cheat sheet](https://devhints.io/xpath) is a great resource too, and [XmlToolBox](https://xmltoolbox.appspot.com/xpath_generator.html) can help you with quick XPath queries). - Accessibility checking can be done with [axe](https://github.com/dequelabs/axe-core) via [Selenium.Axe for .NET](https://github.com/TroyWalshProf/SeleniumAxeDotnet). diff --git a/Lombiq.Tests.UI/Services/AtataFactory.cs b/Lombiq.Tests.UI/Services/AtataFactory.cs index b90f73981..8348a86a8 100644 --- a/Lombiq.Tests.UI/Services/AtataFactory.cs +++ b/Lombiq.Tests.UI/Services/AtataFactory.cs @@ -92,7 +92,6 @@ private static async Task> CreateDriverFactoryAsync( Browser.Chrome => await WebDriverFactory.CreateChromeDriverAsync(browserConfiguration, pageLoadTimeout), Browser.Edge => await WebDriverFactory.CreateEdgeDriverAsync(browserConfiguration, pageLoadTimeout), Browser.Firefox => await WebDriverFactory.CreateFirefoxDriverAsync(browserConfiguration, pageLoadTimeout), - Browser.InternetExplorer => await WebDriverFactory.CreateInternetExplorerDriverAsync(browserConfiguration, pageLoadTimeout), _ => throw new InvalidOperationException($"Unknown browser: {browserConfiguration.Browser}."), }; } diff --git a/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs b/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs index 54cff1c0a..8ebc53883 100644 --- a/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs +++ b/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs @@ -19,7 +19,6 @@ public enum Browser Chrome, Edge, Firefox, - InternetExplorer, /// /// No browser will be used. Useful for testing things that don't require a browser, like API endpoints or running diff --git a/Lombiq.Tests.UI/Services/WebDriverFactory.cs b/Lombiq.Tests.UI/Services/WebDriverFactory.cs index d76022f87..9a2a0b89c 100644 --- a/Lombiq.Tests.UI/Services/WebDriverFactory.cs +++ b/Lombiq.Tests.UI/Services/WebDriverFactory.cs @@ -129,19 +129,6 @@ public static Task> CreateFirefoxDriverAsync(BrowserConfigur return new FirefoxDriver(options).SetCommonTimeouts(pageLoadTimeout); })); - public static Task> CreateInternetExplorerDriverAsync( - BrowserConfiguration configuration, TimeSpan pageLoadTimeout) => - CreateDriverAsync(BrowserNames.InternetExplorer, () => Task.FromResult(() => - { - var options = new InternetExplorerOptions().SetCommonOptions(); - - // IE doesn't support this. - options.AcceptInsecureCertificates = false; - configuration.BrowserOptionsConfigurator?.Invoke(options); - - return new InternetExplorerDriver(options).SetCommonTimeouts(pageLoadTimeout); - })); - private static TDriverOptions SetCommonOptions(this TDriverOptions driverOptions) where TDriverOptions : DriverOptions { From c2dafe6a0516c9f1bc830d498cac78dbd59dea9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Sat, 28 Dec 2024 22:24:14 +0100 Subject: [PATCH 02/11] Setting 4 as value for None in Browser enum; removing using for IE selenium driver. --- .../Services/OrchardCoreUITestExecutorConfiguration.cs | 3 ++- Lombiq.Tests.UI/Services/WebDriverFactory.cs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs b/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs index 8ebc53883..ab816c068 100644 --- a/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs +++ b/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs @@ -24,7 +24,8 @@ public enum Browser /// No browser will be used. Useful for testing things that don't require a browser, like API endpoints or running /// security scans. /// - None, + /// Due to removal of one browser, None needs to keep value of 4. + None = 4, } public class OrchardCoreUITestExecutorConfiguration diff --git a/Lombiq.Tests.UI/Services/WebDriverFactory.cs b/Lombiq.Tests.UI/Services/WebDriverFactory.cs index 9a2a0b89c..695aa248c 100644 --- a/Lombiq.Tests.UI/Services/WebDriverFactory.cs +++ b/Lombiq.Tests.UI/Services/WebDriverFactory.cs @@ -6,7 +6,6 @@ using OpenQA.Selenium.Chromium; using OpenQA.Selenium.Edge; using OpenQA.Selenium.Firefox; -using OpenQA.Selenium.IE; using System; using System.Collections.Generic; using System.IO; From 1f073ac5e2275db82db9dd96ada2e4d7f6b1116b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Sat, 28 Dec 2024 22:29:52 +0100 Subject: [PATCH 03/11] Removing PublishIEDriver property from the project file. --- Lombiq.Tests.UI/Lombiq.Tests.UI.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj b/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj index 924385452..219239468 100644 --- a/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj +++ b/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj @@ -8,7 +8,6 @@ projects would need to add the packages too. --> true true - true true true From 0c4b31eadccc9b3b5c787b7c301ce9fa962eaf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Sat, 28 Dec 2024 22:43:05 +0100 Subject: [PATCH 04/11] Removing IE from KillLeftoverProcesses. --- Lombiq.Tests.UI/KillLeftoverProcesses.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/Lombiq.Tests.UI/KillLeftoverProcesses.bat b/Lombiq.Tests.UI/KillLeftoverProcesses.bat index 2f3e5092a..c8356aabd 100644 --- a/Lombiq.Tests.UI/KillLeftoverProcesses.bat +++ b/Lombiq.Tests.UI/KillLeftoverProcesses.bat @@ -1,6 +1,5 @@ taskkill /f /im "dotnet.exe" taskkill /f /im "chromedriver.exe" taskkill /f /im "geckodriver.exe" -taskkill /f /im "IEDriverServer.exe" taskkill /f /im "msedgedriver.exe" taskkill /f /im "Lombiq.UITestingToolbox.AppUnderTest*" From a108ab436d5d3e5033f764ce2971f0ae2bb0648b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Sun, 29 Dec 2024 19:29:21 +0100 Subject: [PATCH 05/11] Adding Compatibilty suppresion for removed IE stuff. --- Lombiq.Tests.UI/CompatibilitySuppressions.xml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Lombiq.Tests.UI/CompatibilitySuppressions.xml diff --git a/Lombiq.Tests.UI/CompatibilitySuppressions.xml b/Lombiq.Tests.UI/CompatibilitySuppressions.xml new file mode 100644 index 000000000..dcf9e5d65 --- /dev/null +++ b/Lombiq.Tests.UI/CompatibilitySuppressions.xml @@ -0,0 +1,25 @@ + + + + + CP0001 + T:Lombiq.Tests.UI.Attributes.InternetExplorerAttribute + lib/net8.0/Lombiq.Tests.UI.dll + lib/net8.0/Lombiq.Tests.UI.dll + true + + + CP0002 + F:Lombiq.Tests.UI.Services.Browser.InternetExplorer + lib/net8.0/Lombiq.Tests.UI.dll + lib/net8.0/Lombiq.Tests.UI.dll + true + + + CP0002 + M:Lombiq.Tests.UI.Services.WebDriverFactory.CreateInternetExplorerDriverAsync(Lombiq.Tests.UI.Services.BrowserConfiguration,System.TimeSpan) + lib/net8.0/Lombiq.Tests.UI.dll + lib/net8.0/Lombiq.Tests.UI.dll + true + + \ No newline at end of file From e892e4f6875653fd1a636e6378b65dda3dae1732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Sun, 29 Dec 2024 19:46:44 +0100 Subject: [PATCH 06/11] Adding Compatibilty suppresion for warning about changed value of None member in Browser enum. --- Lombiq.Tests.UI/CompatibilitySuppressions.xml | 7 +++++++ .../Services/OrchardCoreUITestExecutorConfiguration.cs | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Lombiq.Tests.UI/CompatibilitySuppressions.xml b/Lombiq.Tests.UI/CompatibilitySuppressions.xml index dcf9e5d65..0e0d08d29 100644 --- a/Lombiq.Tests.UI/CompatibilitySuppressions.xml +++ b/Lombiq.Tests.UI/CompatibilitySuppressions.xml @@ -22,4 +22,11 @@ lib/net8.0/Lombiq.Tests.UI.dll true + + CP0011 + F:Lombiq.Tests.UI.Services.Browser.None + lib/net8.0/Lombiq.Tests.UI.dll + lib/net8.0/Lombiq.Tests.UI.dll + true + \ No newline at end of file diff --git a/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs b/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs index ab816c068..8ebc53883 100644 --- a/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs +++ b/Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs @@ -24,8 +24,7 @@ public enum Browser /// No browser will be used. Useful for testing things that don't require a browser, like API endpoints or running /// security scans. /// - /// Due to removal of one browser, None needs to keep value of 4. - None = 4, + None, } public class OrchardCoreUITestExecutorConfiguration From f3a7d1ad83aa281645afec7fd1b3c30dea6ca72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Domonkos?= Date: Mon, 30 Dec 2024 22:12:45 +0100 Subject: [PATCH 07/11] Adding demo video about testing time-dependent functionalities and headless Orchard Core using the Lombiq UI Testing Toolbox to the docs --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index 5c61c89d8..daba9dc4f 100644 --- a/Readme.md +++ b/Readme.md @@ -27,6 +27,7 @@ Highlights: - If your app uses a camera, a fake video capture source in Chrome is supported. [Here's a demo video of the feature](https://www.youtube.com/watch?v=sGcD0eJ2ytc), and check out the docs [here](Lombiq.Tests.UI/Docs/FakeVideoCaptureSource.md). - Interactive mode for debugging the app while the test is paused. [Here's a demo of the feature](Lombiq.Tests.UI.Samples/Tests/InteractiveModeTests.cs), and a [demo video here](https://www.youtube.com/watch?v=ItNltaruWTY). - Security scanning with [Zed Attack Proxy (ZAP)](https://www.zaproxy.org/), the world's most widely used web app security scanner, right from UI tests. See a demo video [here](https://www.youtube.com/watch?v=iUYivLkFbY4). +- Testing time-dependent functionalities and headless Orchard Core using the Lombiq UI Testing Toolbox. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). See a demo video of the project [here](https://www.youtube.com/watch?v=mEUg6-pad-E), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). We also had an Orchard Harvest 2024 talk about security scanning [here](https://www.youtube.com/watch?v=FsOpo8EA4wE). Also, see our [Testing Toolbox](https://github.com/Lombiq/Testing-Toolbox) for similar features for lower-level tests. From d50bb7c19316a733e3c9addf2cc08c832a2660eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 30 Dec 2024 22:50:38 +0100 Subject: [PATCH 08/11] Clarification --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index daba9dc4f..a8eb3091e 100644 --- a/Readme.md +++ b/Readme.md @@ -27,7 +27,7 @@ Highlights: - If your app uses a camera, a fake video capture source in Chrome is supported. [Here's a demo video of the feature](https://www.youtube.com/watch?v=sGcD0eJ2ytc), and check out the docs [here](Lombiq.Tests.UI/Docs/FakeVideoCaptureSource.md). - Interactive mode for debugging the app while the test is paused. [Here's a demo of the feature](Lombiq.Tests.UI.Samples/Tests/InteractiveModeTests.cs), and a [demo video here](https://www.youtube.com/watch?v=ItNltaruWTY). - Security scanning with [Zed Attack Proxy (ZAP)](https://www.zaproxy.org/), the world's most widely used web app security scanner, right from UI tests. See a demo video [here](https://www.youtube.com/watch?v=iUYivLkFbY4). -- Testing time-dependent functionalities and headless Orchard Core using the Lombiq UI Testing Toolbox. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). +- Testing time-dependent functionalities with a time shifting clock. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). See a demo video of the project [here](https://www.youtube.com/watch?v=mEUg6-pad-E), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). We also had an Orchard Harvest 2024 talk about security scanning [here](https://www.youtube.com/watch?v=FsOpo8EA4wE). Also, see our [Testing Toolbox](https://github.com/Lombiq/Testing-Toolbox) for similar features for lower-level tests. From dd54a4bcca4661229c6009aba4d95d6b09e8ff73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 30 Dec 2024 22:54:11 +0100 Subject: [PATCH 09/11] Mentioning headless frontend --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index a8eb3091e..5e1ab7177 100644 --- a/Readme.md +++ b/Readme.md @@ -27,7 +27,7 @@ Highlights: - If your app uses a camera, a fake video capture source in Chrome is supported. [Here's a demo video of the feature](https://www.youtube.com/watch?v=sGcD0eJ2ytc), and check out the docs [here](Lombiq.Tests.UI/Docs/FakeVideoCaptureSource.md). - Interactive mode for debugging the app while the test is paused. [Here's a demo of the feature](Lombiq.Tests.UI.Samples/Tests/InteractiveModeTests.cs), and a [demo video here](https://www.youtube.com/watch?v=ItNltaruWTY). - Security scanning with [Zed Attack Proxy (ZAP)](https://www.zaproxy.org/), the world's most widely used web app security scanner, right from UI tests. See a demo video [here](https://www.youtube.com/watch?v=iUYivLkFbY4). -- Testing time-dependent functionalities with a time shifting clock. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). +- Testing time-dependent functionalities with a time shifting clock, and testing a headless app with a separate frontend. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). See a demo video of the project [here](https://www.youtube.com/watch?v=mEUg6-pad-E), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). We also had an Orchard Harvest 2024 talk about security scanning [here](https://www.youtube.com/watch?v=FsOpo8EA4wE). Also, see our [Testing Toolbox](https://github.com/Lombiq/Testing-Toolbox) for similar features for lower-level tests. From d48378f2d5c8c1c3008153a1c0627c597c6d2446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 30 Dec 2024 22:57:40 +0100 Subject: [PATCH 10/11] Highlighting headless app testing and JavaScript tests separately --- Readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 5e1ab7177..7acb78807 100644 --- a/Readme.md +++ b/Readme.md @@ -27,7 +27,9 @@ Highlights: - If your app uses a camera, a fake video capture source in Chrome is supported. [Here's a demo video of the feature](https://www.youtube.com/watch?v=sGcD0eJ2ytc), and check out the docs [here](Lombiq.Tests.UI/Docs/FakeVideoCaptureSource.md). - Interactive mode for debugging the app while the test is paused. [Here's a demo of the feature](Lombiq.Tests.UI.Samples/Tests/InteractiveModeTests.cs), and a [demo video here](https://www.youtube.com/watch?v=ItNltaruWTY). - Security scanning with [Zed Attack Proxy (ZAP)](https://www.zaproxy.org/), the world's most widely used web app security scanner, right from UI tests. See a demo video [here](https://www.youtube.com/watch?v=iUYivLkFbY4). -- Testing time-dependent functionalities with a time shifting clock, and testing a headless app with a separate frontend. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). +- Testing time-dependent functionalities with a time shifting clock. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). +- Testing a headless app with a separate frontend. See a demo video [here](https://youtu.be/eK2C9BW98sM?si=Ehd_bbieXKOwm7vc&t=225). +- Writing tests not just in .NET but also in JavaScript. See a demo video [here](https://youtu.be/eK2C9BW98sM?si=m0TXkBVRsFGD8lfr&t=415). See a demo video of the project [here](https://www.youtube.com/watch?v=mEUg6-pad-E), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). We also had an Orchard Harvest 2024 talk about security scanning [here](https://www.youtube.com/watch?v=FsOpo8EA4wE). Also, see our [Testing Toolbox](https://github.com/Lombiq/Testing-Toolbox) for similar features for lower-level tests. From 23906883c63bbd5b2daa0d19310528dc00ebdb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 30 Dec 2024 22:58:00 +0100 Subject: [PATCH 11/11] Mentioning Selenium --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 7acb78807..570d7c200 100644 --- a/Readme.md +++ b/Readme.md @@ -29,7 +29,7 @@ Highlights: - Security scanning with [Zed Attack Proxy (ZAP)](https://www.zaproxy.org/), the world's most widely used web app security scanner, right from UI tests. See a demo video [here](https://www.youtube.com/watch?v=iUYivLkFbY4). - Testing time-dependent functionalities with a time shifting clock. See a demo video [here](https://www.youtube.com/watch?v=eK2C9BW98sM). - Testing a headless app with a separate frontend. See a demo video [here](https://youtu.be/eK2C9BW98sM?si=Ehd_bbieXKOwm7vc&t=225). -- Writing tests not just in .NET but also in JavaScript. See a demo video [here](https://youtu.be/eK2C9BW98sM?si=m0TXkBVRsFGD8lfr&t=415). +- Writing Selenium tests not just in .NET but also in JavaScript. See a demo video [here](https://youtu.be/eK2C9BW98sM?si=m0TXkBVRsFGD8lfr&t=415). See a demo video of the project [here](https://www.youtube.com/watch?v=mEUg6-pad-E), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). We also had an Orchard Harvest 2024 talk about security scanning [here](https://www.youtube.com/watch?v=FsOpo8EA4wE). Also, see our [Testing Toolbox](https://github.com/Lombiq/Testing-Toolbox) for similar features for lower-level tests.