public void ThenIAmNavigatedToTheMakePaymentScreen() { if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.EditText[@text = 'Phone']"))) { _extentReport.testStatusWithMsg("Pass", "Navigated to the make payment screen successfully"); _extentReport.flushReport(); } else { _extentReport.testStatusWithMsg("Fail", "EriBank app test failed"); _extentReport.flushReport(); _extentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test); Assert.AreEqual("//android.widget.EditText[@text = 'Phone']", "//android.widget.EditText[@text = 'Phone']2"); } }
public void ThenIAmNavigatedToTheBalanceScreen() { if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.Button[@text='Logout']"))) { _extentReport.testStatusWithMsg("Pass", "Payment made successfully. The current balance is " + _EriBankBalanceScreen.BalanceAmount()); _extentReport.flushReport(); } else { _extentReport.testStatusWithMsg("Fail", "EriBank app test failed"); _extentReport.flushReport(); _extentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test); Assert.AreEqual("//android.widget.Button[@text='Logout']", "//android.widget.Button[@text='Logout']2"); } }
public void ThenIAmNavigatedToTheLoginScreen() { /*Successfull logout in report*/ if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.EditText[@text='Username']"))) { _extentReport.testStatusWithMsg("Pass", "Logged out from the EriBank app 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"); } }
public void ThenIViewTheBalance() { /*Log the current balance to the report*/ if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.Button[@text='Make Payment']"))) { _extentReport.testStatusWithMsg("Pass", "Logged into the EriBank app successfully. The current balance is " + _EriBankBalanceScreen.BalanceAmount()); _extentReport.flushReport(); } else { _extentReport.testStatusWithMsg("Fail", "EriBank app test failed"); _extentReport.flushReport(); _extentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test); Assert.AreEqual("//android.widget.Button[@text='Make Payment']", "//android.widget.Button[@text='Make Payment']2"); } }
public void WhenIClickOnTheMakePaymentButton() { /*Proceed to make pament*/ if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.Button[@text='Make Payment']"))) { _extentReport.testStatusWithMsg("Pass", "Navigated to the balance screen successfully"); _extentReport.flushReport(); } else { _extentReport.testStatusWithMsg("Fail", "EriBank app test failed"); _extentReport.flushReport(); _extentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test); Assert.AreEqual("//android.widget.Button[@text='Make Payment']", "//android.widget.Button[@text='Make Payment']2"); } _EriBankBalanceScreen.clickOnMakePaymentButton(); }
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"); } }
public void WhenILoggedIntoTheEriBankAppWithValidUsernameAndPassword() { _EriBankLoginScreen.EnterUserName(); _EriBankLoginScreen.EnterPassword(); _EriBankLoginScreen.ClickLoginButton(); /*Log the current balance to the report*/ if (_CommonFunctions.IsAndroidElementVisible(AndriodDriverFactory.GetAndroidDriver(), By.XPath("//android.widget.Button[@text='Make Payment']"))) { _extentReport.testStatusWithMsg("Pass", "Logged into the EriBank app successfully. The current balance is " + _EriBankBalanceScreen.balanceAmount()); _extentReport.flushReport(); } else { _extentReport.testStatusWithMsg("Fail", "EriBank app test failed"); _extentReport.flushReport(); _extentReport.getScreenShotMobile(AndriodDriverFactory.GetAndroidDriver(), test); Assert.AreEqual("//android.widget.Button[@text='Make Payment']", "//android.widget.Button[@text='Make Payment']2"); } }
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................."); }
public static void AfterScenario() { AndriodDriverFactory.GetAndroidDriver().Quit(); }