public void TestOverflowException()
        {
            string buttonID_A    = TestContext.DataRow["Input Button A"].ToString();
            string buttonID_B    = TestContext.DataRow["Input Button B"].ToString();
            string buttonID_Sign = TestContext.DataRow["Input Button Sign"].ToString();
            string webDriver     = TestContext.DataRow["WebDriver"].ToString();
            string exp           = TestContext.DataRow["Expected Result"].ToString();

            pom = new POM(GetDriver(webDriver), url);
            for (int i = 0; i < 15; i++)
            {
                pom.ClickButton(buttonID_A);
            }
            pom.ClickButton(buttonID_Sign);
            pom.ClickButton(buttonID_B);
            pom.ClickCalcButton();
            string actual = pom.GetResult();

            if (actual == exp)
            {
                pom.CreateSceenshot();
            }

            Assert.AreEqual(exp, actual);
        }
예제 #2
0
        public void TestButton(string buttonID, string exp)
        {
            test = extent.StartTest("Click test of " + buttonID);

            test.Log(LogStatus.Info, "StartTest() method will return the Extent Test object ");
            test.Log(LogStatus.Info, "I am in actual test method");
            test.Log(LogStatus.Info, "We Can Write The Actual Test Logic In This Test");

            pom.NavigateToPage();
            pom.ClickButton(buttonID);
            string actual = pom.GetResult();

            Assert.AreEqual(exp, actual);

            extent.EndTest(test);
        }
        public void TestDivZeroException()
        {
            string buttonID_A    = TestContext.DataRow["Input Button A"].ToString();
            string buttonID_B    = TestContext.DataRow["Input Button B"].ToString();
            string buttonID_Sign = TestContext.DataRow["Input Button Sign"].ToString();
            string webDriver     = TestContext.DataRow["WebDriver"].ToString();
            string exp           = TestContext.DataRow["Expected Result"].ToString();

            pom = new POM(GetDriver(webDriver), url);
            pom.ClickButton(buttonID_A);
            pom.ClickButton(buttonID_Sign);
            pom.ClickButton(buttonID_B);
            pom.ClickCalcButton();
            string actual = pom.GetAlertMessage();

            Assert.AreEqual(exp, actual);
        }
        public void TestElementExistance()
        {
            string buttonID  = TestContext.DataRow["Input Button"].ToString();
            string webDriver = TestContext.DataRow["WebDriver"].ToString();

            pom = new POM(GetDriver(webDriver), url);
            pom.ClickButton(buttonID);

            Assert.IsTrue(true);
        }
        public void TestButton()
        {
            string buttonID  = TestContext.DataRow["Input Button"].ToString();
            string webDriver = TestContext.DataRow["WebDriver"].ToString();
            string exp       = TestContext.DataRow["Expected Result"].ToString();

            pom = new POM(GetDriver(webDriver), url);
            pom.ClickButton(buttonID);
            string actual = pom.GetResult();

            Assert.AreEqual(exp, actual);
        }