This is a sample project to demonstrate high readable test automation implementation with Selenium + Page Factory and Fluent Interface Design Patterns + TestNG + Java.
- Object usages are high
- Test readability and clarity is less
@Category(SIGN_IN)
@Test(description = "Verify that a valid user can login to the application")
public void testValidUserLogin(){
loginpage.setEmail("[email protected]");
loginpage.setPassword("1qaz2wsx@");
loginpage.clickOnSignInButton();
Assert.assertEquals(commonPage.getBrowserTabTitle(), "My account - My Store");
Assert.assertEquals(homepage.getLoggedInUsername(), "Osanda Nimalarathna");
}
- Object usages are less
- Test readability and clarity is high
@Category(SIGN_IN)
@Test(description = "Verify that a valid user can login to the application")
public void testValidUserLogin(){
fragments().getLoginFragment()
.login(USER_EMAIL, USER_PASSWORD)
.checkHomePageTitle()
.getNavigationBlock()
.checkLoggedInUsername(FULL_USER_NAME);
}