diff --git a/ExternalMerlin.XUnit/ClickLinkTests.cs b/ExternalMerlin.XUnit/ClickLinkTests.cs index 8c7aeb38..3e5aa0ac 100644 --- a/ExternalMerlin.XUnit/ClickLinkTests.cs +++ b/ExternalMerlin.XUnit/ClickLinkTests.cs @@ -1,5 +1,4 @@ using Saucery.Core.Dojo; -using Saucery.Core.OnDemand; using Saucery.Tests.Common.PageObjects; using Saucery.XUnit; using Shouldly; @@ -9,26 +8,11 @@ namespace ExternalMerlin.XUnit; public class ClickLinkTests(ITestOutputHelper output, BaseFixture baseFixture) : SauceryXBase(output, baseFixture) { - [Theory] - [MemberData(nameof(RequestedPlatformData.Platforms), MemberType = typeof(RequestedPlatformData))] - public void ClickLinkTest(string os, - string platformNameForOption, - string browserName, - string name, - string automationBackend, - string deviceName, - string recommendedAppiumVersion, - List supportedBackendVersions, - List deprecatedBackendVersions, - string testName, - string deviceOrientation, - string screenResolution, - PlatformType platformType, - List screenResolutions) + [Theory] + [MemberData(nameof(AllPlatforms))] + public void ClickLinkTest(BrowserVersion requestedPlatform) { - InitialiseDriver(new BrowserVersion(os, platformNameForOption, browserName, name, automationBackend, deviceName, recommendedAppiumVersion, - supportedBackendVersions, deprecatedBackendVersions, testName, deviceOrientation, screenResolution, - platformType, screenResolutions)); + InitialiseDriver(requestedPlatform); var guineaPigPage = new GuineaPigPage(BaseFixture.SauceryDriver(), "https://saucelabs.com/"); @@ -37,6 +21,21 @@ public void ClickLinkTest(string os, // verify the browser was navigated to the correct page BaseFixture.Driver!.Url.ShouldContain("saucelabs.com/test-guinea-pig2.html"); } + + public static IEnumerable AllPlatforms + { + get + { + List allPlatforms = []; + + foreach(var platform in RequestedPlatformData.Items) { + allPlatforms.Add([platform]); + } + + return from c in allPlatforms + select c; + } + } } /* * Copyright Andrew Gray, SauceForge diff --git a/Merlin.XUnit/ClickLinkTests.cs b/Merlin.XUnit/ClickLinkTests.cs index 169fd1b3..7ddc2de1 100644 --- a/Merlin.XUnit/ClickLinkTests.cs +++ b/Merlin.XUnit/ClickLinkTests.cs @@ -1,5 +1,4 @@ using Saucery.Core.Dojo; -using Saucery.Core.OnDemand; using Saucery.Tests.Common.PageObjects; using Saucery.XUnit; using Shouldly; @@ -10,25 +9,9 @@ namespace Merlin.XUnit; public class ClickLinkTests(ITestOutputHelper output, BaseFixture baseFixture) : SauceryXBase(output, baseFixture) //, IClassFixture { [Theory] - [MemberData(nameof(RequestedPlatformData.Platforms), MemberType = typeof(RequestedPlatformData))] - public void ClickLinkTest(string os, - string platformNameForOption, - string browserName, - string name, - string automationBackend, - string deviceName, - string recommendedAppiumVersion, - List supportedBackendVersions, - List deprecatedBackendVersions, - string testName, - string deviceOrientation, - string screenResolution, - PlatformType platformType, - List screenResolutions) - { - InitialiseDriver(new BrowserVersion(os, platformNameForOption, browserName, name, automationBackend, deviceName, recommendedAppiumVersion, - supportedBackendVersions, deprecatedBackendVersions, testName, deviceOrientation, screenResolution, - platformType, screenResolutions)); + [MemberData(nameof(AllPlatforms))] + public void ClickLinkTest(BrowserVersion requestedPlatform) { + InitialiseDriver(requestedPlatform); var guineaPigPage = new GuineaPigPage(BaseFixture.SauceryDriver(), "https://saucelabs.com/"); @@ -37,6 +20,21 @@ public void ClickLinkTest(string os, // verify the browser was navigated to the correct page BaseFixture.Driver!.Url.ShouldContain("saucelabs.com/test-guinea-pig2.html"); } + + public static IEnumerable AllPlatforms + { + get + { + List allPlatforms = []; + + foreach(var platform in RequestedPlatformData.Items) { + allPlatforms.Add([platform]); + } + + return from c in allPlatforms + select c; + } + } } /* * Copyright Andrew Gray, SauceForge