Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into issue/OSOE-935
Browse files Browse the repository at this point in the history
# Conflicts:
#	Lombiq.Tests.UI/CompatibilitySuppressions.xml
  • Loading branch information
Piedone committed Jan 2, 2025
2 parents fc9af11 + acf27ce commit 73d0935
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 27 deletions.
8 changes: 0 additions & 8 deletions Lombiq.Tests.UI/Attributes/InternetExplorerAttribute.cs

This file was deleted.

28 changes: 28 additions & 0 deletions Lombiq.Tests.UI/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Lombiq.Tests.UI.Attributes.InternetExplorerAttribute</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Lombiq.Tests.UI.Services.Browser.InternetExplorer</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.WebDriverFactory.CreateInternetExplorerDriverAsync(Lombiq.Tests.UI.Services.BrowserConfiguration,System.TimeSpan)</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Lombiq.Tests.UI.Services.Browser.None</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Lombiq.Tests.UI.Extensions.UITestOutputHelperExtensions</Target>
Expand Down
1 change: 0 additions & 1 deletion Lombiq.Tests.UI/Docs/Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 0 additions & 1 deletion Lombiq.Tests.UI/KillLeftoverProcesses.bat
Original file line number Diff line number Diff line change
@@ -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*"
1 change: 0 additions & 1 deletion Lombiq.Tests.UI/Lombiq.Tests.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
projects would need to add the packages too. -->
<PublishChromeDriver>true</PublishChromeDriver>
<PublishGeckoDriver>true</PublishGeckoDriver>
<PublishIEDriver>true</PublishIEDriver>
<PublishMsEdgeDriver>true</PublishMsEdgeDriver>
<IsPackable>true</IsPackable>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion Lombiq.Tests.UI/Services/AtataFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ private static async Task<Func<IWebDriver>> 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}."),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public enum Browser
Chrome,
Edge,
Firefox,
InternetExplorer,

/// <summary>
/// No browser will be used. Useful for testing things that don't require a browser, like API endpoints or running
Expand Down
14 changes: 0 additions & 14 deletions Lombiq.Tests.UI/Services/WebDriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -129,19 +128,6 @@ public static Task<Func<FirefoxDriver>> CreateFirefoxDriverAsync(BrowserConfigur
return new FirefoxDriver(options).SetCommonTimeouts(pageLoadTimeout);
}));

public static Task<Func<InternetExplorerDriver>> 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<TDriverOptions>(this TDriverOptions driverOptions)
where TDriverOptions : DriverOptions
{
Expand Down
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +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. 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 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.

Expand Down

0 comments on commit 73d0935

Please sign in to comment.