Пример #1
0
        public void TestOverflowException(string elementA, string elementB, string operation, string exp)
        {
            test = extent.StartTest("Exception test: OverflowException");

            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();
            for (int i = 0; i < 15; i++)
            {
                pom.ClickButton(elementA);
            }
            pom.ClickButton(operation);
            pom.ClickButton(elementB);
            pom.ClickCalcButton();
            string actual = pom.GetResult();

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

            extent.EndTest(test);
        }
        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);
        }