Skip appium tests on non-windows

Already had no data, but it turns out that's an error for xunit.
This commit is contained in:
Ben Olden-Cooligan 2022-12-25 13:16:13 -08:00
parent 9bdfd873a3
commit b8f9066a07
4 changed files with 18 additions and 4 deletions

View File

@ -10,7 +10,7 @@ namespace NAPS2.App.Tests.Appium;
[Collection("appium")]
public class ImportAndSaveTests : AppiumTests
{
[VerifyTheory(AllowDebug = true)]
[VerifyTheory(AllowDebug = true, WindowsAppium = true)]
[ClassData(typeof(AppiumTestData))]
public void ImportVariousAndSavePdfWithOcr(IAppTestTarget target)
{

View File

@ -13,7 +13,7 @@ public class LanguageSelectionTests : AppiumTests
{
private static readonly HashSet<string> ExpectedMissingLanguages = new() { "bn", "hi", "id", "th", "ur" };
[VerifyTheory(AllowDebug = true)]
[VerifyTheory(AllowDebug = true, WindowsAppium = true)]
[ClassData(typeof(AppiumTestData))]
public void OpenLanguageDropdown(IAppTestTarget target)
{

View File

@ -13,7 +13,7 @@ public class ScanAndSaveTests : AppiumTests
private const string WIA_DEVICE_NAME = "";
private const string TWAIN_DEVICE_NAME = "";
[VerifyTheory(AllowDebug = true)]
[VerifyTheory(AllowDebug = true, WindowsAppium = true)]
[ClassData(typeof(AppiumTestData))]
public void ScanWiaSavePdf(IAppTestTarget target)
{
@ -48,7 +48,7 @@ public class ScanAndSaveTests : AppiumTests
AppTestHelper.AssertNoErrorLog(FolderPath);
}
[VerifyTheory(AllowDebug = true)]
[VerifyTheory(AllowDebug = true, WindowsAppium = true)]
[ClassData(typeof(AppiumTestData))]
public void ScanTwainSaveImage(IAppTestTarget target)
{

View File

@ -5,6 +5,7 @@ namespace NAPS2.App.Tests.Verification;
public sealed class VerifyTheoryAttribute : TheoryAttribute
{
private bool _allowDebug;
private bool _windowsAppium;
public VerifyTheoryAttribute()
{
@ -33,4 +34,17 @@ public sealed class VerifyTheoryAttribute : TheoryAttribute
_allowDebug = value;
}
}
public bool WindowsAppium
{
get => _windowsAppium;
set
{
if (value && Skip == null && !OperatingSystem.IsWindows())
{
Skip = "Appium tests are only supported on Windows right now.";
}
_windowsAppium = value;
}
}
}