public void SetUp() { #if DEBUG AtataContext.Configure() .UseDriver(_driverAlias) .UseBaseUrl("https://localhost:44345/") .Build(); AtataContext.Current.Driver.Maximize(); #elif DEV AtataContext.Configure() .UseDriver(_driverAlias) .UseBaseUrl("https://svea-webpay-sdk-001-dev.azurewebsites.net/") .Build(); AtataContext.Current.Driver.Maximize(); #elif RELEASE var config = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .AddEnvironmentVariables() .Build(); AtataContext.Configure() .UseChrome() .WithOptions(DriverOptionsFactory.GetDriverOptions(Driver.Chrome) as ChromeOptions) .UseBaseUrl(config.GetSection("SampleWebsite").GetSection("Url").Value) .Build(); AtataContext.Current.Driver.Maximize(); #endif }
public void SetUp() { this.testWebApplicationFactory = new TestWebApplicationFactory(); var chromeOptions = DriverOptionsFactory.GetDriverOptions(Driver.Chrome) as ChromeOptions; AtataContext.Configure() .UseChrome() .WithOptions(chromeOptions) .UseBaseUrl(this.testWebApplicationFactory.RootUri) .Build(); }
public void OneTimeSetUp() { AtataContext.GlobalConfiguration. UseChrome(). WithOptions(DriverOptionsFactory.GetDriverOptions(Driver.Chrome) as ChromeOptions). UseFirefox(). WithOptions(DriverOptionsFactory.GetDriverOptions(Driver.Firefox) as FirefoxOptions). UseInternetExplorer(). WithOptions(DriverOptionsFactory.GetDriverOptions(Driver.InternetExplorer) as InternetExplorerOptions). AddNUnitTestContextLogging(). WithMinLevel(LogLevel.Error). UseBaseRetryTimeout(TimeSpan.FromSeconds(20)); }
public void GlobalSetup() { #if DEBUG AtataContext.GlobalConfiguration. UseChrome(). WithOptions(DriverOptionsFactory.GetDriverOptions(Driver.Chrome) as ChromeOptions). UseFirefox(). WithOptions(DriverOptionsFactory.GetDriverOptions(Driver.Firefox) as FirefoxOptions). UseVerificationTimeout(TimeSpan.FromSeconds(3)). UseElementFindTimeout(TimeSpan.FromSeconds(15)). UseWaitingTimeout(TimeSpan.FromSeconds(30)). AddNUnitTestContextLogging(). WithMinLevel(LogLevel.Trace). TakeScreenshotOnNUnitError(). AddScreenshotFileSaving(). WithFolderPath(() => $@"Logs\{AtataContext.BuildStart:yyyy-MM-dd HH_mm_ss}"). WithFileName(screenshotInfo => $"{AtataContext.Current.TestName} - {screenshotInfo.PageObjectFullName}"). UseTestName(() => $"[{_driverAlias}]{TestContext.CurrentContext.Test.Name}"); #endif }