public static CommandAction GetPreferredCommandActionFromTarget(CrmTestingContext crmContext) { if (crmContext.IsTarget(Constants.SpecFlow.TARGET_API)) { return(CommandAction.PreferApi); } else if (crmContext.IsTarget(Constants.SpecFlow.TARGET_Chrome) || crmContext.IsTarget(Constants.SpecFlow.TARGET_Edge) || crmContext.IsTarget(Constants.SpecFlow.TARGET_Firefox) || crmContext.IsTarget(Constants.SpecFlow.TARGET_InternetExplorer)) { return(CommandAction.ForceBrowser); } else { throw new TestExecutionException(Constants.ErrorCodes.UNKNOWN_TAG); } }
public UCIBrowser GetBrowser() { if (_crmContext.IsTarget("API")) { throw new TestExecutionException(Constants.ErrorCodes.CANT_START_BROWSER_FOR_API_TESTS); } var browser = GlobalTestingContext.BrowserManager.GetBrowser(BrowserOptions, GlobalTestingContext.ConnectionManager.CurrentUserDetails, GlobalTestingContext.ConnectionManager.Url); browser.ChangeApp(CurrentApp); return(browser); }