diff --git a/ExternalMerlin.TUnit.RealDevices/ClickLinkTests.cs b/ExternalMerlin.TUnit.RealDevices/ClickLinkTests.cs new file mode 100644 index 0000000..32f2eb1 --- /dev/null +++ b/ExternalMerlin.TUnit.RealDevices/ClickLinkTests.cs @@ -0,0 +1,31 @@ +using ExternalMerlin.TUnit.RealDevices; +using Saucery.Core.Dojo; +using Saucery.Tests.Common.PageObjects; +using Saucery.TUnit; +using Shouldly; + +[assembly: ParallelLimiter] + +namespace ExternalMerlin.TUnit.RealDevices; + +public class ClickLinkTests : SauceryTBase +{ + [Test] + [MethodDataSource(typeof(RequestedPlatformData), nameof(RequestedPlatformData.AllPlatforms))] + public async Task ClickLinkTest(BrowserVersion requestedPlatform) + { + InitialiseDriver(requestedPlatform); + + var guineaPigPage = new GuineaPigPage(SauceryDriver(), "https://saucelabs.com/"); + + guineaPigPage.ClickLink(SauceryDriver()); + + // verify the browser was navigated to the correct page + Driver!.Url.ShouldContain("saucelabs.com/test-guinea-pig2.html"); + } +} +/* +* Copyright Andrew Gray, SauceForge +* Date: 7th December 2024 +* +*/ \ No newline at end of file diff --git a/ExternalMerlin.TUnit.RealDevices/DataDrivenTests.cs b/ExternalMerlin.TUnit.RealDevices/DataDrivenTests.cs new file mode 100644 index 0000000..6a32a72 --- /dev/null +++ b/ExternalMerlin.TUnit.RealDevices/DataDrivenTests.cs @@ -0,0 +1,38 @@ +using Saucery.Core.Dojo; +using Saucery.Tests.Common.PageObjects; +using Saucery.TUnit; + +namespace ExternalMerlin.TUnit.RealDevices; + +public class DataDrivenTests : SauceryTBase +{ + [Test] + [MethodDataSource(nameof(AllCombinations), Arguments = [new[] { 4, 5 }])] + public Task DataDrivenTest(BrowserVersion requestedPlatform, int data) + { + InitialiseDriver(requestedPlatform); + + var guineaPigPage = new GuineaPigPage(SauceryDriver(), "https://saucelabs.com/"); + + guineaPigPage.TypeField(SauceryDriver(), "comments", data.ToString()); + + return Task.CompletedTask; + } + + public static IEnumerable<(BrowserVersion, int)> AllCombinations(int[] data) + { + foreach (var browserVersion in RequestedPlatformData.AllPlatformsAsList()) + { + foreach (var datum in data) + { + yield return (browserVersion, datum); + } + } + } +} + +/* +* Copyright Andrew Gray, SauceForge +* Date: 7th December 2024 +* +*/ \ No newline at end of file diff --git a/ExternalMerlin.TUnit.RealDevices/ExternalMerlin.TUnit.RealDevices.csproj b/ExternalMerlin.TUnit.RealDevices/ExternalMerlin.TUnit.RealDevices.csproj index 125f4c9..4cb7bcf 100644 --- a/ExternalMerlin.TUnit.RealDevices/ExternalMerlin.TUnit.RealDevices.csproj +++ b/ExternalMerlin.TUnit.RealDevices/ExternalMerlin.TUnit.RealDevices.csproj @@ -6,4 +6,12 @@ enable + + + + + + + + diff --git a/ExternalMerlin.TUnit.RealDevices/MyParallelLimit.cs b/ExternalMerlin.TUnit.RealDevices/MyParallelLimit.cs new file mode 100644 index 0000000..10abc46 --- /dev/null +++ b/ExternalMerlin.TUnit.RealDevices/MyParallelLimit.cs @@ -0,0 +1,8 @@ +using TUnit.Core.Interfaces; + +namespace ExternalMerlin.TUnit.RealDevices; + +public record MyParallelLimit : IParallelLimit +{ + public int Limit => 3; +} diff --git a/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs b/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs new file mode 100644 index 0000000..6484659 --- /dev/null +++ b/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs @@ -0,0 +1,34 @@ +using Saucery.Core.DataSources; +using Saucery.Core.Dojo; +using Saucery.Core.OnDemand; +using Saucery.Core.OnDemand.Base; +using Saucery.Core.Util; + +namespace ExternalMerlin.TUnit.RealDevices; + +public class RequestedPlatformData : SauceryTestData +{ + static RequestedPlatformData() + { + var platforms = new List + { + //Emulated Mobile Platforms + new AndroidPlatform("Google Pixel 8 Pro GoogleAPI Emulator", "15.0", SauceryConstants.DEVICE_ORIENTATION_PORTRAIT), + new IOSPlatform("iPhone 14 Pro Max Simulator", "16.2", SauceryConstants.DEVICE_ORIENTATION_LANDSCAPE), + + //Desktop Platforms + new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_11, SauceryConstants.BROWSER_CHROME, "123"), + new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "124", SauceryConstants.SCREENRES_2560_1600) + }; + + SetPlatforms(platforms); + } + + public static List> AllPlatforms() => GetAllPlatformsAsFunc(); + public static List AllPlatformsAsList() => GetAllPlatformsAsList(); +} +/* +* Copyright Andrew Gray, SauceForge +* Date: 12th July 2024 +* +*/ \ No newline at end of file diff --git a/ExternalMerlin.TUnit/ClickLinkTests.cs b/ExternalMerlin.TUnit/ClickLinkTests.cs new file mode 100644 index 0000000..49ecead --- /dev/null +++ b/ExternalMerlin.TUnit/ClickLinkTests.cs @@ -0,0 +1,31 @@ +using ExternalMerlin.TUnit; +using Saucery.Core.Dojo; +using Saucery.Tests.Common.PageObjects; +using Saucery.TUnit; +using Shouldly; + +[assembly: ParallelLimiter] + +namespace ExternalMerlin.TUnit; + +public class ClickLinkTests : SauceryTBase +{ + [Test] + [MethodDataSource(typeof(RequestedPlatformData), nameof(RequestedPlatformData.AllPlatforms))] + public async Task ClickLinkTest(BrowserVersion requestedPlatform) + { + InitialiseDriver(requestedPlatform); + + var guineaPigPage = new GuineaPigPage(SauceryDriver(), "https://saucelabs.com/"); + + guineaPigPage.ClickLink(SauceryDriver()); + + // verify the browser was navigated to the correct page + Driver!.Url.ShouldContain("saucelabs.com/test-guinea-pig2.html"); + } +} +/* +* Copyright Andrew Gray, SauceForge +* Date: 7th December 2024 +* +*/ \ No newline at end of file diff --git a/ExternalMerlin.TUnit/DataDrivenTests.cs b/ExternalMerlin.TUnit/DataDrivenTests.cs new file mode 100644 index 0000000..0f63be1 --- /dev/null +++ b/ExternalMerlin.TUnit/DataDrivenTests.cs @@ -0,0 +1,36 @@ +using Saucery.Core.Dojo; +using Saucery.Tests.Common.PageObjects; +using Saucery.TUnit; + +namespace ExternalMerlin.TUnit; + +public class DataDrivenTests : SauceryTBase +{ + [Test] + [MethodDataSource(nameof(AllCombinations), Arguments = [new[] { 4, 5 }])] + public async Task DataDrivenTest(BrowserVersion requestedPlatform, int data) + { + InitialiseDriver(requestedPlatform); + + var guineaPigPage = new GuineaPigPage(SauceryDriver(), "https://saucelabs.com/"); + + guineaPigPage.TypeField(SauceryDriver(), "comments", data.ToString()); + } + + public static IEnumerable<(BrowserVersion, int)> AllCombinations(int[] data) + { + foreach (var browserVersion in RequestedPlatformData.AllPlatformsAsList()) + { + foreach (var datum in data) + { + yield return (browserVersion, datum); + } + } + } +} + +/* +* Copyright Andrew Gray, SauceForge +* Date: 7th December 2024 +* +*/ \ No newline at end of file diff --git a/ExternalMerlin.TUnit/ExternalMerlin.TUnit.csproj b/ExternalMerlin.TUnit/ExternalMerlin.TUnit.csproj index 125f4c9..4cb7bcf 100644 --- a/ExternalMerlin.TUnit/ExternalMerlin.TUnit.csproj +++ b/ExternalMerlin.TUnit/ExternalMerlin.TUnit.csproj @@ -6,4 +6,12 @@ enable + + + + + + + + diff --git a/ExternalMerlin.TUnit/MyParallelLimit.cs b/ExternalMerlin.TUnit/MyParallelLimit.cs new file mode 100644 index 0000000..0214c40 --- /dev/null +++ b/ExternalMerlin.TUnit/MyParallelLimit.cs @@ -0,0 +1,8 @@ +using TUnit.Core.Interfaces; + +namespace ExternalMerlin.TUnit; + +public record MyParallelLimit : IParallelLimit +{ + public int Limit => 3; +} diff --git a/ExternalMerlin.TUnit/RequestedPlatformData.cs b/ExternalMerlin.TUnit/RequestedPlatformData.cs new file mode 100644 index 0000000..fb8057c --- /dev/null +++ b/ExternalMerlin.TUnit/RequestedPlatformData.cs @@ -0,0 +1,34 @@ +using Saucery.Core.DataSources; +using Saucery.Core.Dojo; +using Saucery.Core.OnDemand; +using Saucery.Core.OnDemand.Base; +using Saucery.Core.Util; + +namespace ExternalMerlin.TUnit; + +public class RequestedPlatformData : SauceryTestData +{ + static RequestedPlatformData() + { + var platforms = new List + { + //Emulated Mobile Platforms + new AndroidPlatform("Google Pixel 8 Pro GoogleAPI Emulator", "15.0", SauceryConstants.DEVICE_ORIENTATION_PORTRAIT), + new IOSPlatform("iPhone 14 Pro Max Simulator", "16.2", SauceryConstants.DEVICE_ORIENTATION_LANDSCAPE), + + //Desktop Platforms + new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_11, SauceryConstants.BROWSER_CHROME, "123"), + new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "124", SauceryConstants.SCREENRES_2560_1600) + }; + + SetPlatforms(platforms); + } + + public static List> AllPlatforms() => GetAllPlatformsAsFunc(); + public static List AllPlatformsAsList() => GetAllPlatformsAsList(); +} +/* +* Copyright Andrew Gray, SauceForge +* Date: 12th July 2024 +* +*/ \ No newline at end of file diff --git a/Merlin.TUnit.RealDevices/DataDrivenTests.cs b/Merlin.TUnit.RealDevices/DataDrivenTests.cs index 434abae..7c596b5 100644 --- a/Merlin.TUnit.RealDevices/DataDrivenTests.cs +++ b/Merlin.TUnit.RealDevices/DataDrivenTests.cs @@ -7,14 +7,16 @@ namespace Merlin.TUnit.RealDevices; public class DataDrivenTests : SauceryTBase { [Test] - [MethodDataSource(nameof(AllCombinations), Arguments = [ new[] { 4, 5 } ])] - public async Task DataDrivenTest(BrowserVersion requestedPlatform, int data) + [MethodDataSource(nameof(AllCombinations), Arguments = [new[] { 4, 5 }])] + public Task DataDrivenTest(BrowserVersion requestedPlatform, int data) { InitialiseDriver(requestedPlatform); var guineaPigPage = new GuineaPigPage(SauceryDriver(), "https://saucelabs.com/"); guineaPigPage.TypeField(SauceryDriver(), "comments", data.ToString()); + + return Task.CompletedTask; } public static IEnumerable<(BrowserVersion, int)> AllCombinations(int[] data) diff --git a/Merlin.TUnit.RealDevices/Merlin.TUnit.RealDevices.csproj b/Merlin.TUnit.RealDevices/Merlin.TUnit.RealDevices.csproj index 8a71d1d..b6e6fea 100644 --- a/Merlin.TUnit.RealDevices/Merlin.TUnit.RealDevices.csproj +++ b/Merlin.TUnit.RealDevices/Merlin.TUnit.RealDevices.csproj @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Merlin.TUnit/DataDrivenTests.cs b/Merlin.TUnit/DataDrivenTests.cs index 91b487a..ea10ef8 100644 --- a/Merlin.TUnit/DataDrivenTests.cs +++ b/Merlin.TUnit/DataDrivenTests.cs @@ -7,14 +7,16 @@ namespace Merlin.TUnit; public class DataDrivenTests : SauceryTBase { [Test] - [MethodDataSource(nameof(AllCombinations), Arguments = [ new[] { 4, 5 } ])] - public async Task DataDrivenTest(BrowserVersion requestedPlatform, int data) + [MethodDataSource(nameof(AllCombinations), Arguments = [new[] { 4, 5 }])] + public Task DataDrivenTest(BrowserVersion requestedPlatform, int data) { InitialiseDriver(requestedPlatform); var guineaPigPage = new GuineaPigPage(SauceryDriver(), "https://saucelabs.com/"); guineaPigPage.TypeField(SauceryDriver(), "comments", data.ToString()); + + return Task.CompletedTask; } public static IEnumerable<(BrowserVersion, int)> AllCombinations(int[] data) diff --git a/Merlin.TUnit/Merlin.TUnit.csproj b/Merlin.TUnit/Merlin.TUnit.csproj index cf7f6e8..564ca00 100644 --- a/Merlin.TUnit/Merlin.TUnit.csproj +++ b/Merlin.TUnit/Merlin.TUnit.csproj @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Sandbox.TUnit/Sandbox.TUnit.csproj b/Sandbox.TUnit/Sandbox.TUnit.csproj index ee905ce..8cdf143 100644 --- a/Sandbox.TUnit/Sandbox.TUnit.csproj +++ b/Sandbox.TUnit/Sandbox.TUnit.csproj @@ -8,7 +8,7 @@ - + diff --git a/Saucery.Core/DataSources/SauceryTestData.cs b/Saucery.Core/DataSources/SauceryTestData.cs index 3a17663..2b58ac6 100644 --- a/Saucery.Core/DataSources/SauceryTestData.cs +++ b/Saucery.Core/DataSources/SauceryTestData.cs @@ -2,7 +2,6 @@ using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; using System.Collections; -using System.Linq; namespace Saucery.Core.DataSources; diff --git a/Saucery.Core/Dojo/PlatformConfigurator.cs b/Saucery.Core/Dojo/PlatformConfigurator.cs index 9258f1e..d3c50eb 100644 --- a/Saucery.Core/Dojo/PlatformConfigurator.cs +++ b/Saucery.Core/Dojo/PlatformConfigurator.cs @@ -54,20 +54,19 @@ private void ConstructRealDevices() { var supportedRealDevices = RealDeviceAcquirer.AcquireRealDevicePlatforms(); - foreach(var sp in supportedRealDevices!) { + foreach (var sp in supportedRealDevices!) + { AvailableRealDevices.AddRealPlatform(sp); } } - private static List FilterSupportedPlatforms(List supportedPlatforms) - { - List filteredPlatforms = + private static List FilterSupportedPlatforms(List supportedPlatforms) => [ - //Not filtered for Min and Max Versions yet - .. FindLinuxPlatforms(supportedPlatforms), - .. FindWindowsPlatforms(supportedPlatforms), - .. FindMacPlatforms(supportedPlatforms, [ - SauceryConstants.PLATFORM_MAC_1010, + ..FindLinuxPlatforms(supportedPlatforms), + ..FindWindowsPlatforms(supportedPlatforms), + ..FindMacPlatforms(supportedPlatforms, + [ + SauceryConstants.PLATFORM_MAC_1010, SauceryConstants.PLATFORM_MAC_1011, SauceryConstants.PLATFORM_MAC_1012, SauceryConstants.PLATFORM_MAC_1013, @@ -75,133 +74,121 @@ .. FindMacPlatforms(supportedPlatforms, [ SauceryConstants.PLATFORM_MAC_1015, SauceryConstants.PLATFORM_MAC_11, SauceryConstants.PLATFORM_MAC_12, - SauceryConstants.PLATFORM_MAC_13 ]), - .. FindMobilePlatforms(supportedPlatforms, ["iphone", "ipad"]), - .. FindMobilePlatforms(supportedPlatforms, ["android"]), + SauceryConstants.PLATFORM_MAC_13 + ]), + ..FindMobilePlatforms(supportedPlatforms, ["iphone", "ipad"]), + ..FindMobilePlatforms(supportedPlatforms, ["android"]) ]; - return filteredPlatforms; - } - internal int FindMaxBrowserVersion(SaucePlatform platform) { - //Desktop Platform Only var availablePlatform = AvailablePlatforms.Find(p => p.Name.Equals(platform.Os)); var browser = availablePlatform?.Browsers.Find(b => b.Name.Equals(platform.Browser)); var numericBrowserVersions = browser?.BrowserVersions - .Where(x => - x.Name!.Any(char.IsNumber) && + .Where(x => + x.Name!.Any(char.IsNumber) && x.Name != SauceryConstants.BROWSER_VERSION_LATEST_MINUS1); var browserVersion = numericBrowserVersions? - .Aggregate((maxItem, nextItem) => - int.Parse(maxItem.Name!) > int.Parse(nextItem.Name!) - ? maxItem + .Aggregate((maxItem, nextItem) => + int.Parse(maxItem.Name!) > int.Parse(nextItem.Name!) + ? maxItem : nextItem); return int.Parse(browserVersion?.Name!); } - private static List FindLinuxPlatforms(List platforms) => - platforms.FindAll(p => - p.Os! == "Linux" && - p.automation_backend!.Equals("webdriver") && - p.device! == null); + private static List FindLinuxPlatforms(List platforms) => + platforms.FindAll(p => + p.Os == "Linux" && + p.automation_backend!.Equals("webdriver") && + p.device == null); - private static List FindWindowsPlatforms(List platforms) => - platforms.FindAll(p => - p.Os!.Contains("Windows") && + private static List FindWindowsPlatforms(List platforms) => + platforms.FindAll(p => + p.Os!.Contains("Windows") && p.automation_backend!.Equals("webdriver")); - private static List FindMacPlatforms(List platforms, IReadOnlyCollection oses) => - platforms.FindAll(p => - oses.Any(o => o.Equals(p.Os)) && - p.automation_backend!.Equals("webdriver") && - !p.api_name!.Equals("ipad") && + private static List FindMacPlatforms(List platforms, IReadOnlyCollection oses) => + platforms.FindAll(p => + oses.Any(o => o.Equals(p.Os)) && + p.automation_backend!.Equals("webdriver") && + !p.api_name!.Equals("ipad") && !p.api_name.Equals("iphone")); - private static List FindMobilePlatforms(List platforms, IReadOnlyCollection apis) => - platforms.FindAll(p => - apis.Any(a => a.Equals(p.api_name)) && + private static List FindMobilePlatforms(List platforms, IReadOnlyCollection apis) => + platforms.FindAll(p => + apis.Any(a => a.Equals(p.api_name)) && p.automation_backend!.Equals("appium")); public void AddLatestBrowserVersion(string version) { - foreach (var b in AvailablePlatforms - .SelectMany(p => - p.Browsers.Where(b => - p.BrowsersWithLatestVersion != null && + foreach (var browser in AvailablePlatforms + .SelectMany(p => + p.Browsers.Where(b => + p.BrowsersWithLatestVersion != null && p.BrowsersWithLatestVersion.Contains(b.Name)))) { - b.BrowserVersions.Add(new BrowserVersion(b, version, version, null, null)); + browser.BrowserVersions.Add(new BrowserVersion(browser, version, version, null, null)); } } public List FilterAll(List platforms) { - var bvs = (from p in platforms - let bv = Filter(p) - where bv != null - select bv) - .ToList(); - Console.WriteLine(SauceryConstants.NUM_VALID_PLATFORMS, bvs.Count, platforms.Count); - - return bvs; + var browserVersions = platforms + .Select(Filter) + .Where(bv => bv != null) + .ToList(); + + Console.WriteLine(SauceryConstants.NUM_VALID_PLATFORMS, browserVersions.Count, platforms.Count); + + return browserVersions!; } public BrowserVersion? Filter(SaucePlatform platform) { - if(platform.IsARealDevice()) { - return ValidateReal(platform) != null - ? new BrowserVersion(platform) + if (platform.IsARealDevice()) + { + return ValidateReal(platform) != null + ? new BrowserVersion(platform) : null; } - var bv = Validate(platform); - if(bv != null) { - bv.ScreenResolution = platform.ScreenResolution; - bv.DeviceOrientation = platform.DeviceOrientation; + var browserVersion = Validate(platform); + if (browserVersion != null) + { + browserVersion.ScreenResolution = platform.ScreenResolution; + browserVersion.DeviceOrientation = platform.DeviceOrientation; } - return bv; + return browserVersion; } public BrowserVersion? Validate(SaucePlatform requested) { requested.Classify(); - BrowserVersion? browserVersion; - switch (requested.PlatformType) + BrowserVersion? browserVersion = requested.PlatformType switch { - case PlatformType.Chrome: - case PlatformType.Edge: - case PlatformType.Firefox: - case PlatformType.IE: - case PlatformType.Safari: - browserVersion = AvailablePlatforms.FindDesktopBrowser(requested); - break; - case PlatformType.Android: - browserVersion = AvailablePlatforms.FindAndroidBrowser(requested); - break; - case PlatformType.Apple: - browserVersion = AvailablePlatforms.FindIOSBrowser(requested); - break; - default: - Console.WriteLine("Requested Platform Not Found: {0}", requested.LongName); - return null; - } + PlatformType.Chrome or + PlatformType.Edge or + PlatformType.Firefox or + PlatformType.IE or + PlatformType.Safari => AvailablePlatforms.FindDesktopBrowser(requested), + PlatformType.Android => AvailablePlatforms.FindAndroidBrowser(requested), + PlatformType.Apple => AvailablePlatforms.FindIOSBrowser(requested), + _ => null + }; return browserVersion?.Classify(); } - public PlatformBase? ValidateReal(SaucePlatform requested) { + public PlatformBase? ValidateReal(SaucePlatform requested) + { requested.Classify(); - switch(requested.PlatformType) { - case PlatformType.Android: - return AvailableRealDevices.FindAndroidPlatform(requested); - case PlatformType.Apple: - return AvailableRealDevices.FindIOSPlatform(requested); - default: - Console.WriteLine("Requested Real Platform Not Found: {0}", requested.LongName); - return null; - } + return requested.PlatformType switch + { + PlatformType.Android => AvailableRealDevices.FindAndroidPlatform(requested), + PlatformType.Apple => AvailableRealDevices.FindIOSPlatform(requested), + _ => null + }; } -} \ No newline at end of file +} diff --git a/Saucery.Core/Options/OptionFactory.cs b/Saucery.Core/Options/OptionFactory.cs index 99bfeff..641cd8b 100644 --- a/Saucery.Core/Options/OptionFactory.cs +++ b/Saucery.Core/Options/OptionFactory.cs @@ -15,41 +15,43 @@ public class OptionFactory(BrowserVersion bv) : IDisposable if (!BrowserVersion.IsAMobileDevice()) { DebugMessages.PrintHaveDesktopPlatform(); - return (GetDesktopOptions(testName), bv); + return (GetDesktopOptions(testName), BrowserVersion); } //Mobile Device - if(BrowserVersion.IsARealDevice()) + if (BrowserVersion.IsARealDevice()) { - if(BrowserVersion.PlatformType.Equals(OnDemand.PlatformType.Apple)) { + if (BrowserVersion.PlatformType.Equals(OnDemand.PlatformType.Apple)) + { DebugMessages.PrintHaveApplePlatform(true); return (new RealDeviceIOSCreator() .Create(BrowserVersion, testName) - .GetOpts(BrowserVersion.PlatformType), - bv); + .GetOpts(BrowserVersion.PlatformType), + BrowserVersion); } DebugMessages.PrintHaveAndroidPlatform(true); return (new RealDeviceAndroidCreator() .Create(BrowserVersion, testName) - .GetOpts(BrowserVersion.PlatformType), - bv); + .GetOpts(BrowserVersion.PlatformType), + BrowserVersion); } //Emulated Mobile Platform - if(BrowserVersion.PlatformType.Equals(OnDemand.PlatformType.Apple)) { + if (BrowserVersion.PlatformType.Equals(OnDemand.PlatformType.Apple)) + { DebugMessages.PrintHaveApplePlatform(false); return (new EmulatedIOSCreator() .Create(BrowserVersion, testName) - .GetOpts(BrowserVersion.PlatformType), - bv); + .GetOpts(BrowserVersion.PlatformType), + BrowserVersion); } DebugMessages.PrintHaveAndroidPlatform(false); return (new EmulatedAndroidCreator() .Create(BrowserVersion, testName) - .GetOpts(BrowserVersion.PlatformType), - bv); + .GetOpts(BrowserVersion.PlatformType), + BrowserVersion); } private DriverOptions? GetDesktopOptions(string testName) => BrowserVersion.BrowserName.ToLower() switch @@ -62,13 +64,13 @@ public class OptionFactory(BrowserVersion bv) : IDisposable _ => new ChromeCreator().Create(BrowserVersion, testName).GetOpts(BrowserVersion.PlatformType), }; - public bool IsApple() => + public bool IsApple() => BrowserVersion.PlatformType.Equals(OnDemand.PlatformType.Apple); - public bool IsAndroid() => + public bool IsAndroid() => BrowserVersion.PlatformType.Equals(OnDemand.PlatformType.Android); - public void Dispose() => + public void Dispose() => GC.SuppressFinalize(this); } /* diff --git a/Saucery.TUnit/Saucery.TUnit.csproj b/Saucery.TUnit/Saucery.TUnit.csproj index 512c317..89facb2 100644 --- a/Saucery.TUnit/Saucery.TUnit.csproj +++ b/Saucery.TUnit/Saucery.TUnit.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/Saucery.TUnit/SauceryTBase.cs b/Saucery.TUnit/SauceryTBase.cs index ce332a9..9176d90 100644 --- a/Saucery.TUnit/SauceryTBase.cs +++ b/Saucery.TUnit/SauceryTBase.cs @@ -7,7 +7,6 @@ namespace Saucery.TUnit; -//public class SauceryTBase //: IClassFixture public class SauceryTBase : BaseFixture { private string? _testName; @@ -62,11 +61,6 @@ public void TearDown() } } - //protected SauceryTBase(ITestOutputHelper outputHelper, BaseFixture baseFixture) : base(outputHelper) - //{ - // _outputHelper = outputHelper; - //} - private static string GetTestName() => TestContext.Current?.TestDetails.TestName ?? ""; protected static IEnumerable GetAllCombinations(object[] data) {