public void TestConfiguration() { ChromeOptions options = new ChromeOptions(); options.AddArgument("--headless"); IWebDriver driver = new ChromeDriver(options); Eyes eyes = new Eyes(); try { Configuration conf = new Configuration(); conf.SetServerUrl("https://testeyes.applitools.com").SetApiKey("HSNghRv9zMtkhcmwj99injSggnd2a8zUY390OiyNRWoQ110"); eyes.Open(driver, "test configuration", "test server url 1", new Size(800, 600)); TestResults results1 = eyes.Close(); eyes.SetConfiguration(conf); eyes.Open(driver, "test configuration", "test server url 2", new Size(800, 600)); TestResults results2 = eyes.Close(); StringAssert.DoesNotStartWith("https://testeyesapi.applitools.com", results1.ApiUrls.Session); StringAssert.StartsWith("https://testeyesapi.applitools.com", results2.ApiUrls.Session); } finally { driver.Quit(); } }
private void SetUp(Eyes eyes, string AppilToolServerUrl, string AppilToolsApiKey, eBrowserType BrowserType, string Environment) { Applitools.Selenium.Configuration config = new Applitools.Selenium.Configuration(); if (WorkSpace.Instance.RunsetExecutor.RunSetConfig != null && WorkSpace.Instance.RunsetExecutor.RunSetConfig.GingerRunners.Any() && ((GingerExecutionEngine)WorkSpace.Instance.RunsetExecutor.RunSetConfig.GingerRunners[0].Executor).ExecutedFrom == eExecutedFrom.Run) { BatchInfo batchInfo = new BatchInfo(WorkSpace.Instance.RunsetExecutor.RunSetConfig.ItemName); batchInfo.Id = WorkSpace.Instance.RunsetExecutor.RunSetConfig.ExecutionID.ToString(); config.SetBatch(batchInfo); } config.SetApiKey(AppilToolsApiKey); config.SetServerUrl(AppilToolServerUrl); OperatingSystem Os_info = System.Environment.OSVersion; config.SetHostOS(Os_info.VersionString); config.SetHostApp(BrowserType.ToString()); eyes.AddProperty("Environment ID", !String.IsNullOrEmpty(Environment) ? Environment : "Default"); eyes.SetConfiguration(config); }