public static string GetTestName(this SaucePlatform platform, string testName) { var shortTestName = new StringBuilder(); shortTestName.Append(testName.Contains(SauceryConstants.LEFT_SQUARE_BRACKET) ? testName.Substring(0, testName.IndexOf(SauceryConstants.LEFT_SQUARE_BRACKET, StringComparison.Ordinal)) : testName); return(platform.IsADesktopPlatform() ? DesktopTestName(shortTestName, platform) : MobileTestName(shortTestName, platform)); }
public static DesiredCapabilities CreateCapabilities(SaucePlatform platform, string testName) { if (platform.IsADesktopPlatform()) { return((new DesktopCreator()).Create(platform, testName).GetCaps()); } //Mobile Platform return(platform.CanUseAppium() //Mobile Platform ? platform.IsAnAppleDevice() ? (new AppiumIOSCreator()).Create(platform, testName).GetCaps() : (new AppiumAndroidCreator()).Create(platform, testName).GetCaps() //Devolve to WebDriver : platform.IsAnAppleDevice() ? (new WebDriverIOSCreator()).Create(platform, testName).GetCaps() : (new WebDriverAndroidCreator()).Create(platform, testName).GetCaps()); }