Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-663: Remove references to Internet Explorer in Lombiq.UITestingToolbox #437

Merged
merged 8 commits into from
Dec 30, 2024
8 changes: 0 additions & 8 deletions Lombiq.Tests.UI/Attributes/InternetExplorerAttribute.cs

This file was deleted.

32 changes: 32 additions & 0 deletions Lombiq.Tests.UI/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/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>
</Suppressions>
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 @@ -92,7 +92,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 @@ -19,7 +19,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
Loading