private IApp Configure(PagePlatform platform) { switch (platform) { case PagePlatform.Android: return(ConfigureApp.Android.ApiKey(ApiKey.Key).ApkFile(AndroidPath).StartApp()); case PagePlatform.iOS: return(ConfigureApp.iOS.ApiKey(ApiKey.Key).AppBundle(IosPath).StartApp()); default: throw new ArgumentException("Unsupported test platform (should be Android or iOS)."); } }
public static IContainer Configure(IApp app, PagePlatform pageObjectPlatform) { var builder = new ContainerBuilder(); builder.RegisterInstance(app).As <IApp> ().SingleInstance(); switch (pageObjectPlatform) { case PagePlatform.Android: RegisterPagesForAndroid(builder); break; case PagePlatform.iOS: RegisterPagesForiOS(builder); break; default: throw new ArgumentException("Unsupported test platform (should be iOS or Android)"); } return(builder.Build()); }
public static PagePlatform GetPagePlatformFromEnvironment(TestPlatform testPlatform, PagePlatform localPreference) { if (testPlatform == TestPlatform.Local) { return(localPreference); } switch (testPlatform) { case TestPlatform.TestCloudAndroid: return(PagePlatform.Android); case TestPlatform.TestCloudiOS: return(PagePlatform.iOS); default: throw new ArgumentException(); } }