Example #1
0
        public void HideImageTest()
        {
            try
            {
                InitialClass initialPage = new InitialClass(webDriver, test);

                string buttonImageText = webDriver.FindElement(InitialClass.buttonImage).Text;
                Assert.AreEqual("Show this image", buttonImageText);
            } finally {
                webDriver.Quit();
            }
        }
        [TestMethod] // this test method can be extended as it's not meant to be an end-to-end method, as long as all methods do not call driver's .quit method
        public void alternativeInitialTest()
        {
            try
            {
                InitialClass initialPage = new InitialClass(webDriver);
                initialPage.hideImageDisableQuit(webDriver, true);
                initialPage.hideImageCustomAssert();
                Assert.AreEqual("Hide this image", webDriver.FindElement(InitialClass.buttonImage).Text);

                initialPage.HideImageBoolQuitAssert(webDriver, true, false);
                initialPage.HideImageBoolQuitAssert(webDriver, true, true);
                Assert.AreEqual("Hide this image", webDriver.FindElement(InitialClass.buttonImage).Text);
                initialPage.HideImageBoolQuitAssert(webDriver, false, false);
            } finally {
                webDriver.Quit();
            }
        }