public void Initialize() { //Initialize the Runner for your test. runner = new VisualGridRunner(10); // Initialize the eyes SDK (IMPORTANT: make sure your API key is set in the APPLITOOLS_API_KEY env variable). _eyes = new Eyes(runner); // Initialize eyes Configuration config = new Configuration(); config.SetApiKey("TlTMI102RD5Kl0PGlP1SLRTb6x5Idiomwl5YuF79ibDBs110"); config.SetBatch(new BatchInfo("UFG Hackathon")); // Add browsers with different viewports config.AddBrowser(1200, 700, BrowserType.CHROME); config.AddBrowser(1200, 700, BrowserType.FIREFOX); config.AddBrowser(1200, 700, BrowserType.EDGE_CHROMIUM); config.AddBrowser(768, 700, BrowserType.CHROME); config.AddBrowser(768, 700, BrowserType.FIREFOX); config.AddBrowser(768, 700, BrowserType.EDGE_CHROMIUM); // Add mobile emulation devices in Portrait mode config.AddDeviceEmulation(DeviceName.iPhone_X, ScreenOrientation.Portrait); config.AddDeviceEmulation(DeviceName.Pixel_2, ScreenOrientation.Portrait); // Set the configuration object to eyes _eyes.SetConfiguration(config); }
public static void SetUp(Eyes eyes) { // Initialize eyes Configuration Configuration config = new Configuration(); config.SetApiKey("3xHYsqXjxBhhuNRDcDpQHcaMaUgYU111MBD0fXq5QNxMo110"); config.SetBatch(new BatchInfo("Holiday Shopping")); config.SetViewportSize(1200, 800); config.AddBrowser(1200, 800, BrowserType.CHROME); config.AddBrowser(1200, 800, BrowserType.FIREFOX); config.AddBrowser(1200, 800, BrowserType.EDGE_CHROMIUM); config.AddBrowser(1200, 800, BrowserType.SAFARI); config.AddDeviceEmulation(DeviceName.iPhone_X); eyes.SetConfiguration(config); eyes.ForceFullPageScreenshot = true; eyes.StitchMode = StitchModes.CSS; }
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); }
public void BeforeTestSuite() { runner = new VisualGridRunner(concurrentSessions); // Create a configuration object, we will use this when setting up each test suiteConfig = new Configuration(); IConfiguration newsuiteConfg = new Configuration(); suiteConfig.AddBrowser(1200, 700, BrowserType.CHROME); suiteConfig.AddBrowser(1200, 700, BrowserType.FIREFOX); suiteConfig.AddBrowser(1200, 700, BrowserType.EDGE_CHROMIUM); suiteConfig.AddBrowser(768, 700, BrowserType.CHROME); suiteConfig.AddBrowser(768, 700, BrowserType.FIREFOX); suiteConfig.AddBrowser(768, 700, BrowserType.EDGE_CHROMIUM); suiteConfig.AddDeviceEmulation(DeviceName.iPhone_X, Applitools.VisualGrid.ScreenOrientation.Portrait); suiteConfig .SetApiKey(apiKey) .SetAppName(appName) .SetBatch(new BatchInfo(batchName)) ; }
public static void ClassInitializeMethod(TestContext testContext) { _testContext = testContext; suiteConfig = new Configuration(); suiteConfig.SetApiKey("xIWisbt6NECuLEfxj99i7tQD5MTm2fwXlK3X8Xwek578110"); suiteConfig.SetBatch(new BatchInfo(batchName)); // Visual Grid configurations suiteConfig.AddBrowser(1200, 700, BrowserType.CHROME); suiteConfig.AddBrowser(1200, 700, BrowserType.FIREFOX); suiteConfig.AddBrowser(1200, 700, BrowserType.EDGE_CHROMIUM); suiteConfig.AddBrowser(768, 700, BrowserType.CHROME); suiteConfig.AddBrowser(768, 700, BrowserType.FIREFOX); suiteConfig.AddBrowser(768, 700, BrowserType.EDGE_CHROMIUM); suiteConfig.AddDeviceEmulation(DeviceName.iPhone_X, Applitools.VisualGrid.ScreenOrientation.Portrait); string projectPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName; string eyesLogFile = Path.Combine(projectPath, "eyesLogFile.txt"); //eyes = new Eyes(runner); //eyes.SetConfiguration(suiteConfig); //eyes.SetLogHandler(new FileLogHandler(eyesLogFile, true, true)); }
public void Initialize() { //Initialize the Runner for your test. runner = new VisualGridRunner(10); // Initialize the eyes SDK _eyes = new Eyes(runner); // Initialize eyes Configuration config = new Configuration(); config.SetApiKey("AS876OwEVY3qDFEAlB4NERfld2wrXCbSDVxewhHgn5E110"); config.SetBatch(new BatchInfo("Holiday Shopping")); config.AddBrowser(1200, 800, BrowserType.CHROME); // Add browsers with different viewports //Uncomment these to run in multiple browsers //config.AddBrowser(1200, 800, BrowserType.FIREFOX); //config.AddBrowser(1200, 800, BrowserType.EDGE_CHROMIUM); //config.AddBrowser(1200, 800, BrowserType.SAFARI); //config.AddDeviceEmulation(DeviceName.iPhone_X); _eyes.SetConfiguration(config); }
public void Initialize() { //Initialize the Runner the test. runner = new VisualGridRunner(10); // Initialize the eyes SDK _eyes = new Eyes(runner); // Initialize eyes Configuration config = new Configuration(); config.SetApiKey("80t00102Dxj9FBzQ7UWU1031n4MRH109Vvc5JoceMwbA79Q110 "); config.SetBatch(new BatchInfo("Holiday Shopping")); config.AddBrowser(1200, 800, BrowserType.CHROME); //Adding configuration for cross-browsers testing //Uncomment the following to run across multiple browsers //config.AddBrowser(1200, 800, BrowserType.FIREFOX); //config.AddBrowser(1200, 800, BrowserType.EDGE_CHROMIUM); //config.AddBrowser(1200, 800, BrowserType.SAFARI); //config.AddDeviceEmulation(DeviceName.iPhone_X); _eyes.SetConfiguration(config); }
public void Demo_Applitool() { EyesRunner runner = new ClassicRunner(); Eyes eye = new Eyes(runner); var suiteConfig = new Applitools.Selenium.Configuration(); suiteConfig // Test suite configurations .SetApiKey("KgPPOMrJBHbsgzaZ1oJ5A18sNMPiZEXpiRSGqOv6qmk110") .SetBatch(new BatchInfo("Demo Regression 001")); eye.SetConfiguration(suiteConfig); DriverProperty property = new DriverProperty(); property.DriverType = DriverType.Chrome; WebDriver.InitDriverManager(property); WebDriver.AddNewDriver(property); eye.Open(WebDriver.Driver, "DEMO", "Demo Test 001"); WebDriver.GoToUrl("http://google.com.vn"); WebDriver.Sleep(5); eye.CheckWindow("Google home page 1"); eye.Check(Target.Window().Layout(By.XPath("")).Region(By.XPath(""))); WebDriver.Sleep(5); eye.CheckWindow("Google home page 2"); eye.CloseAsync(); WebDriver.QuitAllDriver(); runner.GetAllTestResults(true); }