public void TestCloseAsync(bool useVisualGrid)
        {
            IWebDriver  driver     = SeleniumUtils.CreateChromeDriver();
            string      logPath    = TestUtils.InitLogPath();
            ILogHandler logHandler = TestUtils.InitLogHandler(logPath: logPath);
            EyesRunner  runner     = useVisualGrid ? (EyesRunner) new VisualGridRunner(10, logHandler) : new ClassicRunner(logHandler);

            if (useVisualGrid && !TestUtils.RUNS_ON_CI)
            {
                ((VisualGridRunner)runner).DebugResourceWriter = new FileDebugResourceWriter(logPath);
            }
            Eyes eyes = new Eyes(runner);

            eyes.Batch = TestDataProvider.BatchInfo;
            try
            {
                driver.Url = "https://applitools.com/helloworld";
                eyes.Open(driver, nameof(TestApiMethods), nameof(TestCloseAsync) + "_1", new Size(800, 600));
                eyes.Check(Target.Window().WithName("step 1"));
                eyes.CloseAsync();
                driver.FindElement(By.TagName("button")).Click();
                eyes.Open(driver, nameof(TestApiMethods), nameof(TestCloseAsync) + "_2", new Size(800, 600));
                eyes.Check(Target.Window().WithName("step 2"));
                eyes.CloseAsync();
                runner.GetAllTestResults();
            }
            finally
            {
                driver.Quit();
            }
        }
        public void Test4_CanvasChartTest()
        {
            Eyes eyes = new Eyes();

            eyes.ApiKey = Environment.GetEnvironmentVariable("APPLITOOLS_HACKATHON_API_KEY");

            BatchInfo batchInfo = new BatchInfo("Canvas Chart Test");

            batchInfo.Id = "CanvasChartTest";

            eyes.Batch = batchInfo;

            eyes.Open(driver, appName, "Canvas Chart Test");

            landingPage.compareExpensesBtn.Click();
            InduceDelay(1);
            eyes.CheckWindow();
            eyes.CloseAsync();


            eyes.Open(driver, appName, "Canvas Chart Test - Next Year");
            landingPage.showNextYrDataBtn.Click();

            InduceDelay(1);
            eyes.CheckWindow();

            eyes.CloseAsync();
            eyes.AbortIfNotClosed();
        }
Example #3
0
        private void TestLoginPage()
        {
            // Call Open on eyes to initialize a test session
            eyes.Open(webDriver);

            // check the login page
            eyes.Check(Target.Window().Fully().WithName("Login page"));

            eyes.CloseAsync();
        }
 public void Verify_Login_Page()
 {
     //Start the test by setting AUT's name, window or the page name that's being tested, viewport width and height
     _eyes.Open(_driver, "Hackathan App", "Login Page Verification", new RectangleSize(1366, 728));
     //Navigate the browser to the "ACME" demo app. To see visual bugs after the first run, use the commented line below instead.
     //_driver.Url = CommonMethods.Config["url"];
     //Url navigation for V2 app.
     _driver.Url = CommonMethods.Config["urlV2"];
     //Visual checkpoint #1 - Check the login page.
     _eyes.CheckWindow("Login Page");
     //End the test.
     _eyes.CloseAsync();
 }
        public void LoginPage1()
        {
            // Start the test by setting AUT's name, window or the page name that's being tested, viewport width and height
            eyes.Open(driver, "Acme app", "Login Page", new Size(1200, 700));

            // Navigate the browser to the "ACME" demo app
            driver.Url = "https://demo.applitools.com/index.html";

            // Visual checkpoint #1.
            eyes.CheckWindow("Login Page");

            // End the test.
            eyes.CloseAsync();
        }
        private void Run()
        {
            // Create a new webdriver
            IWebDriver webDriver = new ChromeDriver();

            // Navigate to the url we want to test
            webDriver.Url = "https://demo.applitools.com";

            // ⭐️ Note to see visual bugs, run the test using the above URL for the 1st run.
            //but then change the above URL to https://demo.applitools.com/index_v2.html (for the 2nd run)

            // Create a runner with concurrency of 10
            VisualGridRunner runner = new VisualGridRunner(10);

            // Create Eyes object with the runner, meaning it'll be a Visual Grid eyes.
            Eyes eyes = new Eyes(runner);

            // Create configuration object
            Configuration conf = new Configuration();



            //conf.SetApiKey("APPLITOOLS_API_KEY");    // Set the Applitools API KEY here or as an environment variable "APPLITOOLS_API_KEY"
            conf.SetTestName("C# VisualGrid demo")   // Set test name
            .SetAppName("Demo app");                 // Set app name

            // Add browsers with different viewports
            conf.AddBrowser(800, 600, BrowserType.CHROME);
            conf.AddBrowser(700, 500, BrowserType.FIREFOX);
            conf.AddBrowser(1200, 800, BrowserType.IE_10);
            conf.AddBrowser(1600, 1200, BrowserType.IE_11);
            conf.AddBrowser(1024, 768, BrowserType.EDGE);

            // Add iPhone 4 device emulation in Portrait mode
            conf.AddDeviceEmulation(DeviceName.iPhone_4, ScreenOrientation.Portrait);


            // Set the configuration object to eyes
            eyes.SetConfiguration(conf);

            // Call Open on eyes to initialize a test session
            eyes.Open(webDriver);

            // check the login page
            eyes.Check(Target.Window().Fully().WithName("Login page"));
            webDriver.FindElement(By.Id("log-in")).Click();

            // Check the app page
            eyes.Check(Target.Window().Fully().WithName("App page"));

            // Close the browser
            webDriver.Quit();

            eyes.CloseAsync();

            //Wait and collect all test results
            TestResultSummary allTestResults = runner.GetAllTestResults();

            System.Console.WriteLine(allTestResults);
        }
Example #7
0
        public static void Test1(IWebDriver webDriver, Eyes eyes)
        {
            try
            {
                // V1 URL
                //webDriver.Url = "https://demo.applitools.com/tlcHackathonMasterV1.html";

                // Dev URL
                // webDriver.Url = "https://demo.applitools.com/tlcHackathonDev.html";

                // V2 URL
                webDriver.Url = "https://demo.applitools.com/tlcHackathonMasterV2.html";

                // Call Open on eyes to initialize a test session
                eyes.Open(webDriver, "AppliFashion", "Test 1", new RectangleSize(1200, 800));


                eyes.Check(Target.Window().Fully().WithName("main page"));


                eyes.CloseAsync();
            }
            catch (Exception e)
            {
                eyes.AbortAsync();
            }
        }
        public void TestDoubleOpenCheckCloseAsyncWithDifferentInstances(bool useVisualGrid)
        {
            IWebDriver driver = SeleniumUtils.CreateChromeDriver();

            driver.Url = "https://applitools.github.io/demo/TestPages/VisualGridTestPage/";

            EyesRunner runner = useVisualGrid ? (EyesRunner) new VisualGridRunner(10) : new ClassicRunner();

            runner.SetLogHandler(TestUtils.InitLogHandler());

            string suffix = useVisualGrid ? "_VG" : "";

            try
            {
                Eyes eyes1 = new Eyes(runner);
                eyes1.Batch = TestDataProvider.BatchInfo;
                eyes1.Open(driver, "Applitools Eyes SDK", nameof(TestDoubleOpenCheckCloseAsyncWithDifferentInstances) + suffix, new RectangleSize(1200, 800));
                eyes1.Check(Target.Window().Fully().IgnoreDisplacements(false).WithName("Step 1"));
                eyes1.CloseAsync();

                Eyes eyes2 = new Eyes(runner);
                eyes2.Batch = TestDataProvider.BatchInfo;
                eyes2.Open(driver, "Applitools Eyes SDK", nameof(TestDoubleOpenCheckCloseAsyncWithDifferentInstances) + suffix, new RectangleSize(1200, 800));
                eyes2.Check(Target.Window().Fully().IgnoreDisplacements(false).WithName("Step 2"));
                eyes2.CloseAsync();
            }
            finally
            {
                driver.Quit();
            }

            TestResultsSummary allTestResults = runner.GetAllTestResults(false);

            Assert.AreEqual(2, allTestResults.Count);
        }
Example #9
0
        public static void Test3(IWebDriver webDriver, Eyes eyes)
        {
            try
            {
                // V1 URL
                // webDriver.Url = "https://demo.applitools.com/tlcHackathonMasterV1.html";

                // Dev URL
                // webDriver.Url = "https://demo.applitools.com/tlcHackathonDev.html";

                // V2 URL
                webDriver.Url = "https://demo.applitools.com/tlcHackathonMasterV2.html";

                // Call Open on eyes to initialize a test session
                eyes.Open(webDriver, "AppliFashion", "Test 3", new Size(1200, 800));


                webDriver.FindElement(By.XPath("//img[@alt='Appli Air x Night']")).Click();
                Thread.Sleep(3000);
                eyes.Check(Target.Window().Fully().WithName("product details"));

                eyes.CloseAsync();
            }
            catch (Exception e)
            {
                eyes.AbortAsync();
            }
        }
Example #10
0
        public void TestVanguard()
        {
            VisualGridRunner runner = new VisualGridRunner(10);
            IWebDriver       driver = SeleniumUtils.CreateChromeDriver();
            Eyes             eyes   = InitEyes(driver, runner, "https://investor.vanguard.com/home/", 1000, 700, false);

            Thread.Sleep(2000);
            try
            {
                eyes.Check("Vanguard",
                           Target
                           .Window()
                           .Fully()
                           .Strict()
                           .SendDom(false)
                           .Layout(By.ClassName("vgc-feedbackLink"))
                           );
                eyes.CloseAsync();
                runner.GetAllTestResults();
            }
            finally
            {
                eyes.Abort();
                driver.Quit();
            }
        }
        private static void TestDemoApp(IWebDriver driver, Eyes eyes)
        {
            try
            {
                // Set AUT's name, test name and viewport size (width X height)
                // We have set it to 800 x 600 to accommodate various screens. Feel free to
                // change it.
                eyes.Open(driver, "Demo App", "Smoke Test", new Size(800, 600));

                // Navigate the browser to the "ACME" demo app.
                driver.Url = "https://demo.applitools.com";

                // To see visual bugs after the first run, use the commented line below instead.
                // driver.get("https://demo.applitools.com/index_v2.html");

                // Visual checkpoint #1 - Check the login page. using the fluent API
                // https://applitools.com/docs/topics/sdk/the-eyes-sdk-check-fluent-api.html?Highlight=fluent%20api
                eyes.Check(Target.Window().Fully().WithName("Login Window"));

                // This will create a test with two test steps.
                driver.FindElement(By.Id("log-in")).Click();

                // Visual checkpoint #2 - Check the app page.
                eyes.Check(Target.Window().Fully().WithName("App Window"));

                // End the test.
                eyes.CloseAsync();
            }
            catch (Exception e)
            {
                // If the test was aborted before eyes.close was called, ends the test as
                // aborted.
                eyes.AbortAsync();
            }
        }
Example #12
0
        public void GivenTest()
        {
            //Initialize the Runner for your test.
            runner = new ClassicRunner();

            // Initialize the eyes SDK (IMPORTANT: make sure your API key is set in the APPLITOOLS_API_KEY env variable).
            eyes = new Eyes(runner);

            // Use Chrome browser
            driver = new ChromeDriver();

            // Start the test by setting AUT's name, window or the page name that's being tested, viewport width and height
            eyes.Open(driver, "Demo App", "Smoke Test", new Size(800, 600));

            // Navigate the browser to the "ACME" demo app. To see visual bugs after the first run, use the commented line below instead.
            driver.Url = "https://demo.applitools.com/";
            //driver.Url = "https://demo.applitools.com/index_v2.html";

            // Visual checkpoint #1 - Check the login page.
            eyes.CheckWindow("Login Page");

            // This will create a test with two test steps.
            driver.FindElement(By.Id("log-in")).Click();

            // Visual checkpoint #2 - Check the app page.
            eyes.CheckWindow("App Window");

            // End the test.
            eyes.CloseAsync();
        }
 public void TearDown()
 {
     eyes.CloseAsync();
     driver.Quit();
     eyes.AbortIfNotClosed();
     TestResultsSummary allTestResults = runner.GetAllTestResults();
 }
Example #14
0
        public void TestPandalytics()
        {
            VisualGridRunner runner = new VisualGridRunner(10);
            IWebDriver       driver = SeleniumUtils.CreateChromeDriver();
            Eyes             eyes   = InitEyesWithLogger(runner, verbose: true, writeResources: true);

            //ConfigureSingleBrowser(eyes);
            ConfigureMultipleBrowsers(eyes);
            try
            {
                EyesWebDriver eyesWebDriver = (EyesWebDriver)OpenEyes(driver, "https://pandalytics-sandbox.instructure.com", eyes, 1000, 700);
                driver.FindElement(By.Id("pseudonym_session_unique_id")).SendKeys("*****@*****.**");
                driver.FindElement(By.Id("pseudonym_session_password")).SendKeys("password");
                driver.FindElement(By.ClassName("Button--login")).Click();

                eyes.Check("Dashboard page", Target.Window().Fully());

                driver.Url = "https://pandalytics-sandbox.instructure.com/courses/17/external_tools/63";

                Thread.Sleep(1000);
                eyes.Check("LTI tool", Target.Frame("tool_content").Fully());
                eyes.CloseAsync();
                runner.GetAllTestResults();
            }
            finally
            {
                eyes.Abort();
                driver.Quit();
            }
        }
Example #15
0
        public static void Test2(IWebDriver webDriver, Eyes eyes)
        {
            try
            {
                // V1 URL
                //webDriver.Url = "https://demo.applitools.com/tlcHackathonMasterV1.html";

                // Dev URL
                //  webDriver.Url = "https://demo.applitools.com/tlcHackathonDev.html";

                // V2 URL
                webDriver.Url = "https://demo.applitools.com/tlcHackathonMasterV2.html";

                // Call Open on eyes to initialize a test session
                eyes.Open(webDriver, "AppliFashion", "Test 2", new Size(1200, 800));

                webDriver.FindElement(By.XPath("//label[text()='Black ']")).Click();
                webDriver.FindElement(By.Id("filterBtn")).Click();
                Thread.Sleep(3000);
                eyes.CheckRegion(By.Id("product_grid"), "filter by color", 3);

                eyes.CloseAsync();
            }
            catch (Exception e)
            {
                eyes.AbortAsync();
            }
        }
Example #16
0
        public void TestWebsiteThatRequireScrolling(string website, string name)
        {
            VisualGridRunner runner = new VisualGridRunner(10);
            IWebDriver       driver = SeleniumUtils.CreateChromeDriver();
            Eyes             eyes   = InitEyesWithLogger(runner, writeResources: true, verbose: true, testMethod: name);

            ConfigureMultipleBrowsers(eyes);

            try
            {
                EyesWebDriver        eyesWebDriver = (EyesWebDriver)OpenEyes(driver, website, eyes, 1000, 700, name);;
                EyesRemoteWebElement html          = (EyesRemoteWebElement)eyesWebDriver.FindElement(By.TagName("html"));
                eyesWebDriver.ExecuteAsyncScript(@"var currScrollPosition = 0;
                    let cb = arguments[arguments.length - 1]
                    var interval = setInterval(function() {
                    let scrollPosition = document.documentElement.scrollTop;
                    currScrollPosition += 300;
                    window.scrollTo(0, currScrollPosition);
                    if (scrollPosition === document.documentElement.scrollTop)
                    {
                        clearInterval(interval);
                        window.scrollTo(0, 0);
                        cb()
                    }
                    }, 100); ");
                eyes.Check(name, Target.Window().Fully());
                eyes.CloseAsync();
                runner.GetAllTestResults();
            }
            finally
            {
                eyes.Abort();
                driver.Quit();
            }
        }
Example #17
0
        public void TestCleanUp()
        {
            _eyes.CloseAsync();
            SiteDriver.Close();
            TestResultsSummary allTestResults = runner.GetAllTestResults();

            Console.WriteLine(allTestResults);
        }
Example #18
0
        public void TestSuccess()
        {
            ILogHandler      logHandler       = TestUtils.InitLogHandler();
            VisualGridRunner visualGridRunner = new VisualGridRunner(10, logHandler);

            Size[] ViewportList =
            {
                new Size(800,  600),
                new Size(700,  500),
                new Size(1200, 800),
                new Size(1600, 1200)
            };

            IWebDriver webDriver = SeleniumUtils.CreateChromeDriver();

            webDriver.Url = "https://applitools.com/helloworld";
            try
            {
                foreach (Size viewport in ViewportList)
                {
                    Eyes eyes = InitEyes_(null, webDriver, viewport);
                    eyes.Check(Target.Window().Fully());
                    eyes.CloseAsync();

                    try
                    {
                        eyes = InitEyes_(visualGridRunner, webDriver, viewport);
                        eyes.Check(Target.Window().Fully());
                        eyes.CloseAsync();
                    }
                    finally
                    {
                        eyes.AbortAsync();
                    }
                }
                TestResultsSummary results = visualGridRunner.GetAllTestResults();
                Assert.AreEqual(ViewportList.Length, results?.Count);
            }
            finally
            {
                webDriver?.Quit();
            }
        }
Example #19
0
 public void TearDown()
 {
     try
     {
         driver.Quit();
         eyes.CloseAsync();
     }
     finally
     {
         eyes.AbortAsync();
     }
 }
Example #20
0
        private static void RunVisualTest(IWebDriver driver, Eyes eyes, string url, string appName, string testName)
        {
            ConfigureEyes(eyes);
            ConfigureUltrafastGrid(eyes);
            TestUtils.SetupLogging(eyes);

            driver.Url = url;

            eyes.Open(driver, appName, testName, new Size(1000, 600));

            eyes.Check(Target.Window());

            eyes.CloseAsync();
        }
        public void Trello_1532()
        {
            IWebDriver    webDriver = new ChromeDriver();
            ClassicRunner runner    = new ClassicRunner();

            webDriver.Url = "https://www.humana.com/medicare/medicare-supplement-plans/plan-g";

            Eyes eyes = new Eyes(runner);

            eyes.SetLogHandler(new StdoutLogHandler(true));
            Configuration conf = new Configuration();

            conf.SetTestName("#31659")
            .SetAppName("Humana")
            .SetViewportSize(new Size(1200, 800));

            eyes.SetConfiguration(conf);

            eyes.StitchMode = StitchModes.CSS;
            //eyes.HideCaret = false;
            eyes.Open(webDriver);

            webDriver.Manage().Timeouts().ImplicitWait   = TimeSpan.FromSeconds(3);
            IReadOnlyCollection <IWebElement> TabsInPage = webDriver.FindElements(By.XPath("//button[@role='tab']"));

            if (TabsInPage.Count > 0)
            {
                By layout = By.CssSelector("#anchor-main-content > section:nth-child(2) > div > div > div.col-12.col-sm-12.col-md-4");
                By ignore = By.CssSelector("#searchbox");

                eyes.Check(Target.Window().Fully().WithName("Login page").Layout(layout).Ignore(ignore)); //This is fine

                TabsInPage.ElementAt(0).Click();
                eyes.Check(Target.Window().Fully().WithName("Login page").Layout(layout).Ignore(ignore)); //This is wrong

                TabsInPage.ElementAt(1).Click();
                eyes.Check(Target.Window().Fully().WithName("Login page").Layout(layout).Ignore(ignore));
            }

            webDriver.Quit();
            eyes.CloseAsync();

            TestResultsSummary allTestResults = runner.GetAllTestResults();

            TestContext.Progress.WriteLine(allTestResults);
        }
        public void AfterEachTest()
        {
            // check if an exception was thrown
            Boolean testPassed = TestContext.CurrentContext.Result.Outcome.Status != NUnit.Framework.Interfaces.TestStatus.Failed;

            if (testPassed)
            {
                // Close the Eyes instance, no need to wait for results, we'll get those at the end in afterTestSuite
                eyes.CloseAsync();
            }
            else
            {
                // There was an exception so the test may be incomplete - abort the test
                eyes.AbortIfNotClosed();
            }
            webDriver.Quit();
        }
Example #23
0
        public void GivenISeeTheText(string expectedHeaderText)
        {
            var runner                = new ClassicRunner();
            var eyes                  = new Eyes(runner);
            var configuration         = new Configuration();
            var driver                = Browser.Get();
            var navigationList        = new HomePage().NavigationLinksList;
            var navigationEnglishList = new HomePage().NavigationEnglishLists;

            eyes.ApiKey = "e1a30daWtG7TGDntETpQvN8WhA29muccCaXA6aFQMn8110";
            eyes.Open(driver, "Demo App", "Smoke Test");

            eyes.Check(" BBC Page", Target.Window().Ignore(navigationList).Ignore(navigationEnglishList));

            eyes.CloseAsync();

            //var currentText = new HomePage().Header.Text;
            //currentText.Should().NotBeEmpty( expectedHeaderText, "because the header text shoud be must be the same as expected" );
        }
Example #24
0
        public void TestWebsite(string website, string name)
        {
            VisualGridRunner runner = new VisualGridRunner(10);
            IWebDriver       driver = SeleniumUtils.CreateChromeDriver();
            Eyes             eyes   = InitEyes(driver, runner, website, 1000, 700, writeResources: true, verbose: true, testMethod: name);

            //Thread.Sleep(3000);
            try
            {
                eyes.Check(name, Target.Window().Fully());
                eyes.CloseAsync();
                runner.GetAllTestResults();
            }
            finally
            {
                eyes.Abort();
                driver.Quit();
            }
        }
        public void TestExceptionInGetAllTestResults()
        {
            EyesRunner runner = new ClassicRunner();
            Eyes       eyes   = new Eyes(runner);

            eyes.SaveNewTests = false;
            IWebDriver driver = SeleniumUtils.CreateChromeDriver();

            driver.Url = "https://applitools.com/helloworld?diff1";

            eyes.Open(driver,
                      nameof(TestClassicRunnerExceptions),
                      nameof(TestExceptionInGetAllTestResults),
                      new Size(800, 600));
            eyes.CheckWindow();
            eyes.CloseAsync();

            driver.Quit();
            Assert.That(() => { TestResultsSummary results = runner.GetAllTestResults(); }, Throws.Exception);
        }
Example #26
0
        public void AfterScenario()
        {
            IWebDriver driver = null;

            try
            {
                driver = (IWebDriver)ScenarioContext.Current["WEBDRIVER"];
                driver.Close();
                driver.Quit();
                driver = null;
            }
            catch (Exception e)
            {
                Console.WriteLine($"Selenium Web Driver not found to dispose. {e.Message}");
            }

            finally
            {
                ScenarioContext.Current["WEBDRIVER"] = null;

                Console.WriteLine("After Scenario - Test Completed");
            }


            //Close Eyes
            try
            {
                EyesRunner runner = (EyesRunner)ScenarioContext.Current["EYESRUNNER"];
                Eyes       eyes   = (Eyes)ScenarioContext.Current["EYES"];

                eyes.CloseAsync();

                // If the test was aborted before eyes.close was called, ends the test as aborted.
                eyes.AbortIfNotClosed();

                //Wait and collect all test results
                TestResultsSummary allTestResults = runner.GetAllTestResults();
            }catch (Exception e)
            {
            }
        }
Example #27
0
        public void TestPNC()
        {
            VisualGridRunner runner = new VisualGridRunner(10);
            IWebDriver       driver = SeleniumUtils.CreateChromeDriver();
            Eyes             eyes   = InitEyes(driver, runner, "https://www.pnc.com/", 1000, 700, false);

            try
            {
                eyes.Check("PNC", Target.Window().Fully().SendDom()
                           .Layout(By.CssSelector("#main-header > div.highlighted-topics-tout-container-parsys.limited-parsys"))
                           .Layout(By.CssSelector("#main-header > div.promo-parsys.limited-parsys"))
                           .Ignore(By.CssSelector("#oo-feedback > img")));
                eyes.CloseAsync();
                runner.GetAllTestResults();
            }
            finally
            {
                eyes.Abort();
                driver.Quit();
            }
        }
Example #28
0
        public void BasicTest()
        {
            // Start the test by setting AUT's name, window or the page name that's being tested, viewport width and height
            eyes.Open(driver, "Demo App", "Smoke Test", new Size(800, 600));

            // Navigate the browser to the "ACME" demo app. To see visual bugs after the first run, use the commented line below instead.
            driver.Url = "https://demo.applitools.com/";
            //driver.Url = "https://demo.applitools.com/index_v2.html";

            // Visual checkpoint #1 - Check the login page.
            eyes.CheckWindow("Login Page");

            // This will create a test with two test steps.
            driver.FindElement(By.Id("log-in")).Click();

            // Visual checkpoint #2 - Check the app page.
            eyes.CheckWindow("App Window");

            // End the test.
            eyes.CloseAsync();
        }
Example #29
0
        public void Test_32176_Trello_1744()
        {
            ClassicRunner runner = new ClassicRunner();

            var driver = new ChromeDriver();

            var eyes = new Eyes(runner);

            eyes.StitchMode = StitchModes.CSS;
            //eyes.ForceFullPageScreenshot = true;
            eyes.SetLogHandler(new StdoutLogHandler(true));

            try
            {
                eyes.Open(driver, "GovIL", "#32176", new Size(1600, 600));

                driver.Url = "https://govforms.gov.il/mw/forms/[email protected]";

                driver.ExecuteScript("document.documentElement.style.overflow='hidden'; document.documentElement.style.transform='translate(0px, 0px)';document.body.style.overflow='visible';");

                eyes.Check("Tab 1", Target.Region(By.CssSelector("#user")).Fully());

                driver.FindElement(By.CssSelector("#Tab2")).Click();
                eyes.Check("Tab 2", Target.Region(By.CssSelector("#user")).Fully());

                //driver.FindElement(By.CssSelector("#Tab3")).Click();
                //eyes.Check("Tab 3", Target.Region(By.CssSelector("#user")));

                //driver.FindElement(By.CssSelector("#Tab4")).Click();
                //eyes.Check("Tab 4", Target.Region(By.CssSelector("#user")));

                eyes.CloseAsync();
            }
            finally
            {
                driver.Quit();

                runner.GetAllTestResults();
            }
        }
Example #30
0
            public void BasicTest()
            {
                // Start the test by setting AUT's name, window or the page name that's being tested, viewport width and height
                eyes.Open(driver, "Demo App", "Smoke Test", new Size(800, 600));

                // Navigate the browser to the "ACME" demo app. To see visual bugs after the first run, use the commented line below instead.
                driver.Url = "https://demo.applitools.com/";
                //driver.Url = "https://demo.applitools.com/index_v2.html";

                // Visual checkpoint #1 - Check the login page. using the fluent API
                // https://applitools.com/docs/topics/sdk/the-eyes-sdk-check-fluent-api.html?Highlight=fluent%20api
                eyes.Check(Target.Window().Fully().WithName("Login Window"));

                // This will create a test with two test steps.
                driver.FindElement(By.Id("log-in")).Click();

                // Visual checkpoint #2 - Check the app page.
                eyes.Check(Target.Window().Fully().WithName("App Window"));

                // End the test.
                eyes.CloseAsync();
            }