Esempio n. 1
0
        public void ThenUserDetailsAreUpdated()
        {
            extentReporting.createTest("UPDATE_Request_Test");
            dynamic results = JObject.Parse(response);

            try
            {
                if (results != null)
                {
                    // If the updated details are returned
                    Assert.AreEqual((string)results.name, readExcelReader.readExcel(filePath.filePathToExcel(), 6, 2, 2));
                    Assert.AreEqual((string)results.job, readExcelReader.readExcel(filePath.filePathToExcel(), 6, 2, 3));

                    //Verify the response code
                    Assert.AreEqual(responseStatus, readExcelReader.readExcel(filePath.filePathToExcel(), 6, 3, 2));
                }
                else
                {
                    // If the updated detals are not returned
                    Assert.AreEqual(responseStatus, readExcelReader.readExcel(filePath.filePathToExcel(), 6, 3, 2));
                }

                extentReporting.testStatusWithMsg("Pass", "UPDATE_Request_TestPassed");
            }
            catch (AssertionException e)
            {
                extentReporting.logReportStatement(AventStack.ExtentReports.Status.Error, e.Message);
                extentReporting.testStatusWithMsg("Fail", "UPDATE_Request_TestFailed");
            }

            extentReporting.flushReport();
        }
        public void ThenResourceDetailsShouldDisplay()
        {
            extentReporting.createTest("GET_Request_Test");
            dynamic results  = JObject.Parse(response);
            dynamic array    = jsonRead.LoadJson();
            dynamic results2 = JObject.Parse(array);

            //jsonRead.LoadJson();

            try
            {
                Assert.AreEqual((string)results2["data"][0]["id"], (string)results["data"][0]["id"]);
                Assert.AreEqual((string)results2["data"][0]["name"], (string)results["data"][0]["name"]);


                extentReporting.testStatusWithMsg("Pass", "GET_Request_TestPassed");
            }
            catch (AssertionException e)
            {
                extentReporting.logReportStatement(AventStack.ExtentReports.Status.Error, e.Message);
                extentReporting.testStatusWithMsg("Fail", "GET_Request_TestFailed");
            }

            extentReporting.flushReport();
        }
Esempio n. 3
0
        public void ThenUserDetailsAreDeleted()
        {
            extentReporting.createTest("DELETE_Request_Test");

            try
            {
                Assert.AreEqual(responseStatus, readExcelReader.readExcel(filePath.filePathToExcel(), 7, 1, 2));

                extentReporting.testStatusWithMsg("Pass", "DELETE_Request_TestPassed");
            }
            catch (AssertionException e)
            {
                extentReporting.logReportStatement(AventStack.ExtentReports.Status.Error, e.Message);
                extentReporting.testStatusWithMsg("Fail", "DELETE_Request_TestFailed");
            }

            extentReporting.flushReport();
        }
Esempio n. 4
0
        public void GivenIHaveLaunchedTheEribankApp()
        {
            _extentReport.setupExtentReport("EriBankApp Test", "EriBankApp Test");
            test = _extentReport.createTest("Test");

            if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.EditText[@text='Username']")))
            {
                _extentReport.testStatusWithMsg("Pass", "EriBank app was launched successfully");
                _extentReport.flushReport();
            }

            else
            {
                _extentReport.testStatusWithMsg("Fail", "EriBank app test failed");
                _extentReport.flushReport();
                _extentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test);

                Assert.AreEqual("//android.widget.EditText[@text='Username']", "//android.widget.EditText[@text='Username']2");
            }
        }
Esempio n. 5
0
        public void GivenILaunchTheEriBankApp()
        {
            _ExtentReport.setupExtentReport("EriBankApp Test", "EriBankApp Test");
            test = _ExtentReport.createTest("Test");

            if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.Id("com.experitest.ExperiBank:id/usernameTextField")))
            {
                _ExtentReport.testStatusWithMsg("Pass", "EriBank app was launched successfully");
                _ExtentReport.flushReport();
            }
            else
            {
                _ExtentReport.testStatusWithMsg("Fail", "EriBank app test failed");
                _ExtentReport.flushReport();
                _ExtentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test);

                Assert.AreEqual("//android.widget.EditText[@text='Username']", "//android.widget.EditText[@text='Username']2");
            }


            Console.WriteLine("App launched.................");
        }
Esempio n. 6
0
        public void ThenIGetTheUserDetails()
        {
            extentReporting.createTest("GET_Request_Test");
            dynamic results = JObject.Parse(response);

            try
            {
                //For the 1st object
                Assert.AreEqual((string)results.data[0].id, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 2, 2));
                Assert.AreEqual((string)results.data[0].first_name, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 2, 3));
                Assert.AreEqual((string)results.data[0].last_name, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 2, 4));
                Assert.AreEqual((string)results.data[0].avatar, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 2, 5));

                //For the 2nd object
                Assert.AreEqual((string)results.data[1].id, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 3, 2));
                Assert.AreEqual((string)results.data[1].first_name, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 3, 3));
                Assert.AreEqual((string)results.data[1].last_name, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 3, 4));
                Assert.AreEqual((string)results.data[1].avatar, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 3, 5));

                //For the 3rd object
                Assert.AreEqual((string)results.data[2].id, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 4, 2));
                Assert.AreEqual((string)results.data[2].first_name, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 4, 3));
                Assert.AreEqual((string)results.data[2].last_name, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 4, 4));
                Assert.AreEqual((string)results.data[2].avatar, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 4, 5));

                //Verify the response code
                Assert.AreEqual(responseStatus, readExcelReader.readExcel(filePath.filePathToExcel(), 2, 5, 2));

                extentReporting.testStatusWithMsg("Pass", "GET_Request_TestPassed");
            }
            catch (AssertionException e)
            {
                extentReporting.logReportStatement(AventStack.ExtentReports.Status.Error, e.Message);
                extentReporting.testStatusWithMsg("Fail", "GET_Request_TestFailed");
            }

            extentReporting.flushReport();
        }