Skip to content

Commit

Permalink
target devices
Browse files Browse the repository at this point in the history
  • Loading branch information
agray committed Jan 2, 2025
1 parent 6fcdcdd commit 57db47e
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 31 deletions.
3 changes: 2 additions & 1 deletion ExternalMerlin.NUnit.RealDevices/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Saucery.Core.DataSources;
using Saucery.Core.Dojo;
using Saucery.Core.OnDemand;
using Saucery.Core.OnDemand.Base;

Expand All @@ -16,7 +17,7 @@ static RequestedPlatformData()
new IOSRealDevice("iPhone 14 Pro Max", "16"),
];

SetPlatforms(platforms);
SetPlatforms(platforms, PlatformFilter.RealDevice);
}
}
/*
Expand Down
3 changes: 2 additions & 1 deletion ExternalMerlin.NUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
}
}
/*
Expand Down
2 changes: 1 addition & 1 deletion ExternalMerlin.TUnit.RealDevices/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static RequestedPlatformData()
new IOSRealDevice("iPhone 14 Pro Max", "16"),
};

SetPlatforms(platforms);
SetPlatforms(platforms, PlatformFilter.RealDevice);
}

public static List<Func<BrowserVersion>> AllPlatforms() => GetAllPlatformsAsFunc();
Expand Down
2 changes: 1 addition & 1 deletion ExternalMerlin.TUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Func<BrowserVersion>> AllPlatforms() => GetAllPlatformsAsFunc();
Expand Down
3 changes: 2 additions & 1 deletion ExternalMerlin.XUnit.RealDevices/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Saucery.Core.DataSources;
using Saucery.Core.Dojo;
using Saucery.Core.OnDemand;
using Saucery.Core.OnDemand.Base;

Expand All @@ -16,7 +17,7 @@ static RequestedPlatformData()
new IOSRealDevice("iPhone 14 Pro Max", "16"),
];

SetPlatforms(platforms);
SetPlatforms(platforms, PlatformFilter.RealDevice);
}

public static IEnumerable<object[]> AllPlatforms => GetAllPlatforms();
Expand Down
3 changes: 2 additions & 1 deletion ExternalMerlin.XUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<object[]> AllPlatforms => GetAllPlatforms();
Expand Down
3 changes: 2 additions & 1 deletion Merlin.NUnit.RealDevices/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Saucery.Core.DataSources;
using Saucery.Core.Dojo;
using Saucery.Core.OnDemand;
using Saucery.Core.OnDemand.Base;

Expand All @@ -16,7 +17,7 @@ static RequestedPlatformData()
new IOSRealDevice("iPhone 14 Pro Max", "16"),
};

SetPlatforms(platforms);
SetPlatforms(platforms, PlatformFilter.RealDevice);
}
}
/*
Expand Down
3 changes: 2 additions & 1 deletion Merlin.NUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
}
/*
Expand Down
3 changes: 2 additions & 1 deletion Merlin.Playwright.NUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
}
/*
Expand Down
2 changes: 1 addition & 1 deletion Merlin.TUnit.RealDevices/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static RequestedPlatformData()
new IOSRealDevice("iPhone 14 Pro Max", "16"),
};

SetPlatforms(platforms);
SetPlatforms(platforms, PlatformFilter.RealDevice);
}

public static List<Func<BrowserVersion>> AllPlatforms() => GetAllPlatformsAsFunc();
Expand Down
2 changes: 1 addition & 1 deletion Merlin.TUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Func<BrowserVersion>> AllPlatforms() => GetAllPlatformsAsFunc();
Expand Down
3 changes: 2 additions & 1 deletion Merlin.XUnit.RealDevices/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Saucery.Core.DataSources;
using Saucery.Core.Dojo;
using Saucery.Core.OnDemand;
using Saucery.Core.OnDemand.Base;

Expand All @@ -16,7 +17,7 @@ static RequestedPlatformData()
new IOSRealDevice("iPhone 14 Pro Max", "16"),
];

SetPlatforms(platforms);
SetPlatforms(platforms, PlatformFilter.RealDevice);
}

public static IEnumerable<object[]> AllPlatforms => GetAllPlatforms();
Expand Down
3 changes: 2 additions & 1 deletion Merlin.XUnit/RequestedPlatformData.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<object[]> AllPlatforms => GetAllPlatforms();
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
```
Expand Down Expand Up @@ -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<object[]> AllPlatforms => GetAllPlatforms();
Expand Down Expand Up @@ -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<Func<BrowserVersion>> AllPlatforms() => GetAllPlatformsAsFunc();
Expand Down
19 changes: 4 additions & 15 deletions Saucery.Core/DataSources/SauceryTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,11 @@ public class SauceryTestData : IEnumerable

public IEnumerator GetEnumerator() => BrowserVersions?.GetEnumerator()!;

protected static void SetPlatforms(List<SaucePlatform> 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<SaucePlatform> platforms) =>
ExpandAndFilter(platforms, new(PlatformFilter.All));

protected static void SetPlatforms(List<SaucePlatform> 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<SaucePlatform> platforms, PlatformFilter filter) =>
ExpandAndFilter(platforms, new(filter));

private static void ExpandAndFilter(List<SaucePlatform> platforms, PlatformConfigurator platformConfigurator)
{
Expand Down

0 comments on commit 57db47e

Please sign in to comment.