internal static void ReportTestRailResults(ulong caseID, AutomationModels.Browser browser, AutomationModels.Brand brand, AutomationModels.Environment enviorment, TestRailModels.TestRail.ResultStatus resultStatus, string messege) { AtutomationCaseRun automationCase = PlanRepository .Where(x => x.CaseBase.ID == caseID) .Where(x => x.Browser == browser) .Where(x => x.Brand == brand) .FirstOrDefault(x => x.Environment == enviorment); if (automationCase != null) { TestRailManager.Instance.AddResultForCase(automationCase.RunId, caseID, resultStatus, messege); } }
public IWebDriver GetWebDriverForBrowser(AutomationModels.Browser browser) { IWebDriver driver = null; string path = Directory.GetParent(Directory.GetParent(Directory.GetParent(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)).FullName).FullName).FullName; switch (browser) { case AutomationModels.Browser.Chrome: ChromeDriver = new ChromeDriver(path + @"\WebDrivers"); driver = ChromeDriver; break; case AutomationModels.Browser.Firefox: FirefoxProfile profile = new FirefoxProfile(); profile.SetPreference("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); FirefoxDriver = new FirefoxDriver(profile); driver = FirefoxDriver; break; case AutomationModels.Browser.IE: InternetExplorerDriver = new InternetExplorerDriver(path + @"\WebDrivers"); driver = InternetExplorerDriver; break; case AutomationModels.Browser.Safari: SafariDriver = new ChromeDriver(path + @"E:\WebDrivers"); driver = SafariDriver; break; } if (driver != null) { //driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(DriverTimeOut)); driver.Manage().Window.Maximize(); } return(driver); }