From 57db47e1a8b7acb1a017c54afedab43d6f64fb19 Mon Sep 17 00:00:00 2001 From: Andrew Gray Date: Thu, 2 Jan 2025 15:22:18 +1100 Subject: [PATCH] target devices --- .../RequestedPlatformData.cs | 3 ++- ExternalMerlin.NUnit/RequestedPlatformData.cs | 3 ++- .../RequestedPlatformData.cs | 2 +- ExternalMerlin.TUnit/RequestedPlatformData.cs | 2 +- .../RequestedPlatformData.cs | 3 ++- ExternalMerlin.XUnit/RequestedPlatformData.cs | 3 ++- .../RequestedPlatformData.cs | 3 ++- Merlin.NUnit/RequestedPlatformData.cs | 3 ++- .../RequestedPlatformData.cs | 3 ++- .../RequestedPlatformData.cs | 2 +- Merlin.TUnit/RequestedPlatformData.cs | 2 +- .../RequestedPlatformData.cs | 3 ++- Merlin.XUnit/RequestedPlatformData.cs | 3 ++- README.md | 6 +++--- Saucery.Core/DataSources/SauceryTestData.cs | 19 ++++--------------- 15 files changed, 29 insertions(+), 31 deletions(-) diff --git a/ExternalMerlin.NUnit.RealDevices/RequestedPlatformData.cs b/ExternalMerlin.NUnit.RealDevices/RequestedPlatformData.cs index d9eda5b..679b80e 100644 --- a/ExternalMerlin.NUnit.RealDevices/RequestedPlatformData.cs +++ b/ExternalMerlin.NUnit.RealDevices/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; @@ -16,7 +17,7 @@ static RequestedPlatformData() new IOSRealDevice("iPhone 14 Pro Max", "16"), ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.RealDevice); } } /* diff --git a/ExternalMerlin.NUnit/RequestedPlatformData.cs b/ExternalMerlin.NUnit/RequestedPlatformData.cs index e837a81..c2cf34c 100644 --- a/ExternalMerlin.NUnit/RequestedPlatformData.cs +++ b/ExternalMerlin.NUnit/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; using Saucery.Core.Util; @@ -20,7 +21,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "124", SauceryConstants.SCREENRES_2560_1600) ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } } /* diff --git a/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs b/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs index 448b16b..1517539 100644 --- a/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs +++ b/ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs @@ -16,7 +16,7 @@ static RequestedPlatformData() new IOSRealDevice("iPhone 14 Pro Max", "16"), }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.RealDevice); } public static List> AllPlatforms() => GetAllPlatformsAsFunc(); diff --git a/ExternalMerlin.TUnit/RequestedPlatformData.cs b/ExternalMerlin.TUnit/RequestedPlatformData.cs index 5114b47..856c3b9 100644 --- a/ExternalMerlin.TUnit/RequestedPlatformData.cs +++ b/ExternalMerlin.TUnit/RequestedPlatformData.cs @@ -21,7 +21,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "124", SauceryConstants.SCREENRES_2560_1600) }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } public static List> AllPlatforms() => GetAllPlatformsAsFunc(); diff --git a/ExternalMerlin.XUnit.RealDevices/RequestedPlatformData.cs b/ExternalMerlin.XUnit.RealDevices/RequestedPlatformData.cs index 1e97e93..7fc4680 100644 --- a/ExternalMerlin.XUnit.RealDevices/RequestedPlatformData.cs +++ b/ExternalMerlin.XUnit.RealDevices/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; @@ -16,7 +17,7 @@ static RequestedPlatformData() new IOSRealDevice("iPhone 14 Pro Max", "16"), ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.RealDevice); } public static IEnumerable AllPlatforms => GetAllPlatforms(); diff --git a/ExternalMerlin.XUnit/RequestedPlatformData.cs b/ExternalMerlin.XUnit/RequestedPlatformData.cs index d9bea0c..73982a0 100644 --- a/ExternalMerlin.XUnit/RequestedPlatformData.cs +++ b/ExternalMerlin.XUnit/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; using Saucery.Core.Util; @@ -20,7 +21,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "124", SauceryConstants.SCREENRES_2560_1600) ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } public static IEnumerable AllPlatforms => GetAllPlatforms(); diff --git a/Merlin.NUnit.RealDevices/RequestedPlatformData.cs b/Merlin.NUnit.RealDevices/RequestedPlatformData.cs index 7cbaa02..decfba9 100644 --- a/Merlin.NUnit.RealDevices/RequestedPlatformData.cs +++ b/Merlin.NUnit.RealDevices/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; @@ -16,7 +17,7 @@ static RequestedPlatformData() new IOSRealDevice("iPhone 14 Pro Max", "16"), }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.RealDevice); } } /* diff --git a/Merlin.NUnit/RequestedPlatformData.cs b/Merlin.NUnit/RequestedPlatformData.cs index c6a8b13..4c56a91 100644 --- a/Merlin.NUnit/RequestedPlatformData.cs +++ b/Merlin.NUnit/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; using Saucery.Core.Util; @@ -32,7 +33,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_EDGE, "99", SauceryConstants.SCREENRES_800_600) }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } } /* diff --git a/Merlin.Playwright.NUnit/RequestedPlatformData.cs b/Merlin.Playwright.NUnit/RequestedPlatformData.cs index d932a2d..124ed36 100644 --- a/Merlin.Playwright.NUnit/RequestedPlatformData.cs +++ b/Merlin.Playwright.NUnit/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; using Saucery.Core.Util; @@ -31,7 +32,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_EDGE, "99", SauceryConstants.SCREENRES_800_600) ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } } /* diff --git a/Merlin.TUnit.RealDevices/RequestedPlatformData.cs b/Merlin.TUnit.RealDevices/RequestedPlatformData.cs index ca28be3..7a628e6 100644 --- a/Merlin.TUnit.RealDevices/RequestedPlatformData.cs +++ b/Merlin.TUnit.RealDevices/RequestedPlatformData.cs @@ -16,7 +16,7 @@ static RequestedPlatformData() new IOSRealDevice("iPhone 14 Pro Max", "16"), }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.RealDevice); } public static List> AllPlatforms() => GetAllPlatformsAsFunc(); diff --git a/Merlin.TUnit/RequestedPlatformData.cs b/Merlin.TUnit/RequestedPlatformData.cs index 0227d4a..31e1047 100644 --- a/Merlin.TUnit/RequestedPlatformData.cs +++ b/Merlin.TUnit/RequestedPlatformData.cs @@ -33,7 +33,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_EDGE, "99", SauceryConstants.SCREENRES_800_600) }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } public static List> AllPlatforms() => GetAllPlatformsAsFunc(); diff --git a/Merlin.XUnit.RealDevices/RequestedPlatformData.cs b/Merlin.XUnit.RealDevices/RequestedPlatformData.cs index bd5ec1b..36ac37e 100644 --- a/Merlin.XUnit.RealDevices/RequestedPlatformData.cs +++ b/Merlin.XUnit.RealDevices/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; @@ -16,7 +17,7 @@ static RequestedPlatformData() new IOSRealDevice("iPhone 14 Pro Max", "16"), ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.RealDevice); } public static IEnumerable AllPlatforms => GetAllPlatforms(); diff --git a/Merlin.XUnit/RequestedPlatformData.cs b/Merlin.XUnit/RequestedPlatformData.cs index 3a154f6..412b7bf 100644 --- a/Merlin.XUnit/RequestedPlatformData.cs +++ b/Merlin.XUnit/RequestedPlatformData.cs @@ -1,4 +1,5 @@ using Saucery.Core.DataSources; +using Saucery.Core.Dojo; using Saucery.Core.OnDemand; using Saucery.Core.OnDemand.Base; using Saucery.Core.Util; @@ -32,7 +33,7 @@ static RequestedPlatformData() new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_EDGE, "99", SauceryConstants.SCREENRES_800_600) ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } public static IEnumerable AllPlatforms => GetAllPlatforms(); diff --git a/README.md b/README.md index 4d2fe76..1660eb0 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ public class RequestedPlatformData : SauceryTestData new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "76", SauceryConstants.SCREENRES_2560_1600) ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } } ``` @@ -277,7 +277,7 @@ public class RequestedPlatformData : SauceryTestData new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "76", SauceryConstants.SCREENRES_2560_1600) ]; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } public static IEnumerable AllPlatforms => GetAllPlatforms(); @@ -407,7 +407,7 @@ public class RequestedPlatformData : SauceryTestData new DesktopPlatform(SauceryConstants.PLATFORM_WINDOWS_10, SauceryConstants.BROWSER_CHROME, "124", SauceryConstants.SCREENRES_2560_1600) }; - SetPlatforms(platforms); + SetPlatforms(platforms, PlatformFilter.Emulated); } public static List> AllPlatforms() => GetAllPlatformsAsFunc(); diff --git a/Saucery.Core/DataSources/SauceryTestData.cs b/Saucery.Core/DataSources/SauceryTestData.cs index 46173fa..bf79769 100644 --- a/Saucery.Core/DataSources/SauceryTestData.cs +++ b/Saucery.Core/DataSources/SauceryTestData.cs @@ -11,22 +11,11 @@ public class SauceryTestData : IEnumerable public IEnumerator GetEnumerator() => BrowserVersions?.GetEnumerator()!; - protected static void SetPlatforms(List platforms) - { - PlatformConfigurator platformConfigurator = new(PlatformFilter.All); - ExpandAndFilter(platforms, platformConfigurator); - //PlatformExpander expander = new(platformConfigurator, platforms); - //var expandedPlatforms = expander.Expand(); - //BrowserVersions = platformConfigurator.FilterAll(expandedPlatforms); - } + protected static void SetPlatforms(List platforms) => + ExpandAndFilter(platforms, new(PlatformFilter.All)); - protected static void SetPlatforms(List platforms, PlatformFilter filter) { - PlatformConfigurator platformConfigurator = new(filter); - ExpandAndFilter(platforms, platformConfigurator); - //PlatformExpander expander = new(platformConfigurator, platforms); - //var expandedPlatforms = expander.Expand(); - //BrowserVersions = platformConfigurator.FilterAll(expandedPlatforms); - } + protected static void SetPlatforms(List platforms, PlatformFilter filter) => + ExpandAndFilter(platforms, new(filter)); private static void ExpandAndFilter(List platforms, PlatformConfigurator platformConfigurator) {