public static void TestSetup() { SeleniumDriver.LocalBrowser = ApplicationSettings.GetLocalBrowser; SeleniumDriver.BaseUrl = ApplicationSettings.GetEnvironmentBaseUrl(); if (SeleniumDriver.WebDriver == null) { SeleniumDriver.CreateDriver(); } PageFactory.Pages.HomePage.Goto(); //HomePageSikuli.RestartSession(); PageFactory.Pages.ErrorPage.ClickRestartButton(); PageFactory.Pages.ErrorPageSignIn.ClickSignInAgainLink(); }
public static void TestSetup() { Results = new Result { VerbosityLevel = ApplicationSettings.GetVerbosity }; // set up of properties for desired capabilities SeleniumDriver.TestName = ScenarioContext.Current.ScenarioInfo.Title; SeleniumHelper.FeatureName = FeatureContext.Current.FeatureInfo.Title; SeleniumHelper.Tags = ScenarioContext.Current.ScenarioInfo.Tags; SeleniumDriver.BaseUrl = ApplicationSettings.GetEnvironmentBaseUrl(); SeleniumDriver.IsSeleniumGrid = ApplicationSettings.IsSeleniumGrid; // setting driver properties to make a decision on which driver to create. SeleniumDriver.IsSauceLabsTest = ApplicationSettings.GetSauceLabTestRunner; if (SeleniumDriver.IsSauceLabsTest) { SeleniumDriver.IsSauceLabsDesktopTest = ApplicationSettings.GetSauceLabDesktopTest; SeleniumDriver.JavaScriptEnabled = ApplicationSettings.GetSauceLabJavascriptEnabled; if (SeleniumDriver.IsSauceLabsDesktopTest) { SeleniumDriver.BrowserName = ApplicationSettings.GetSauceLabBrowserName; SeleniumDriver.BrowserVersion = ApplicationSettings.GetSauceLabBrowserVersion; SeleniumDriver.OperatingSystem = ApplicationSettings.GetSauceLabOperatingSystem; SeleniumDriver.Resolution = ApplicationSettings.GetSauceLabResolution; } else { // must be set in order to device test on iOS and Android SeleniumDriver.DeviceType = ApplicationSettings.GetSauceLabDeviceType; SeleniumDriver.DevicePlatform = ApplicationSettings.GetSauceLabDevicePlatform; SeleniumDriver.DeviceOsVersion = ApplicationSettings.GetSauceLabDeviceOsVersion; SeleniumDriver.DeviceName = ApplicationSettings.GetSauceLabDeviceName; SeleniumDriver.DeviceOrientation = ApplicationSettings.GetSauceLabDeviceOrientation; } } else if (SeleniumDriver.IsSeleniumGrid) { SeleniumDriver.SeleniumGridBrowser = ApplicationSettings.SeleniumGridBrowser; SeleniumDriver.SeleniumGridPlatform = ApplicationSettings.SeleniumGridPlatform; SeleniumDriver.SeleniumGridURL = ApplicationSettings.SeleniumGridURL; } else { // must be a local test run SeleniumDriver.LocalBrowser = ApplicationSettings.GetLocalBrowser; } SeleniumDriver.ScreenshotLocation = ApplicationSettings.GetScreenshotLocation; if (ApplicationSettings.GetSauceLabTestRunner) { SeleniumDriver.CreateDriver(); } // this needs to be removed if we go down the route of not opening a // new browser for each test. And add at the feature setup this driver.createdriver() if (SeleniumDriver.WebDriver == null) { SeleniumDriver.CreateDriver(); } }