After I completed the Login Module tests. There are 6 tests in total.
[TestMethod]
[Description("Validate that the user is able to login successfully using validate data")]
public void Test_1()
{
userInfo.EmailAddress = ["guest@guest.com](mailto:%22guest@guest.com)";
userInfo.PassWord = "q1111111";
loginPage.InputUserInfoAndLogin(userInfo);
Assert.AreEqual("CBA Invoicing", driver.Title);
}
[TestMethod]
[Description("Validate alert if there is no input into email address and password fields")]
public void Test_0_NoInput()
{
loginPage.NoInput();
Assert.IsTrue(loginPage.AlertforEmailAddress.Text.Contains("You Must Enter A Value."));
Assert.IsTrue(loginPage.AlertforPassword.Text.Contains("You Must Enter A Value."));
Assert.IsFalse(loginPage.LoginButton.Enabled);
}
[TestMethod]
[Description("Validate that the user will get an alert while only inputting password field ")]
public void Test_0_OnlyInputPassword()
{
userInfo.PassWord = "q1111111";
loginPage.PassWord.SendKeys(userInfo.PassWord);
loginPage.LoginButton.Click();
Assert.IsFalse(loginPage.LoginButton.Enabled);
}
[TestMethod]
[Description("Validate that the user will get an alert while only inputting email address field ")]
public void Test_0_OnlyInputEmailAddress()
{
userInfo.EmailAddress = "guest@guest.com";
loginPage.EmailAddress.SendKeys(userInfo.EmailAddress);
loginPage.LoginButton.Click();
Assert.IsFalse(loginPage.LoginButton.Enabled);
}
[TestMethod]
[Description("Validate that the user is not able to login successfully using invalid data")]
public void Test_0_WrongPassword()
{
userInfo.EmailAddress = "guest@guest.com";
userInfo.PassWord = "guest111";
loginPage.InputUserInfoAndLogin(userInfo);
Thread.Sleep(3000);
driver.SwitchTo().Alert().Accept();
Assert.AreEqual("Login to Your Account!", loginPage.LoginToYourAccount.Text);
}
[TestMethod]
[Description("Validate that the user will get an alert if inputting an inexisting email address")]
public void Test_0_InputWrongEmailAddress()
{
userInfo.EmailAddress = "guest@opeu.com";
userInfo.PassWord = "guest111";
loginPage.InputUserInfoAndLogin(userInfo);
Thread.Sleep(3000);
driver.SwitchTo().Alert().Accept();
Assert.AreEqual("Login to Your Account!", loginPage.LoginToYourAccount.Text);
}
It looks tidier than when I haven't learnedt automation framework. I love programming. Tomorrow I will start the Invoice Module and then finish up with Logging and Reporting.
Here is the running results.
Add more tests for login module:
After I completed the Login Module tests. There are 6 tests in total.
It looks tidier than when I haven't learnedt automation framework. I love programming. Tomorrow I will start the Invoice Module and then finish up with Logging and Reporting. Here is the running results.![Screen Shot 2020-10-26 at 11 18 14 PM](https://user-images.githubusercontent.com/48224242/97161706-0d1dbd80-17e3-11eb-99e1-6a56e22480e0.png)