1818 */
1919class LoginE2ETest extends BaseE2ETest {
2020
21+ private final static String PATH = "login/login.csv" ;
2122 private LoginPage loginPage ;
2223
2324 @ BeforeEach
@@ -45,12 +46,12 @@ public void closeBrowserContextSession() {
4546 @ Owner ("Tahanima Chowdhury" )
4647 @ Description (
4748 "Test that verifies user gets redirected to 'Products' page after submitting correct login credentials" )
48- @ DataSource (testCaseId = "TC-1" , filePath = "login/login.csv" , clazz = LoginTestData .class )
49+ @ DataSource (testCaseId = "TC-1" , filePath = PATH , clazz = LoginTestData .class )
4950 void testCorrectLoginCredentials (LoginTestData loginDto ) {
5051 loginPage
5152 .navigateToUrl ()
52- .fillUsernameInTextBox (loginDto .getUserName ())
53- .fillPasswordInTextBox (loginDto .getPassword ())
53+ .typeUsernameIntoTextBox (loginDto .getUserName ())
54+ .typePasswordIntoTextBox (loginDto .getPassword ())
5455 .clickOnLoginButton ();
5556
5657 ProductsPage productsPage = createInstance (ProductsPage .class );
@@ -64,12 +65,12 @@ void testCorrectLoginCredentials(LoginTestData loginDto) {
6465 @ Owner ("Tahanima Chowdhury" )
6566 @ Description (
6667 "Test that verifies user gets error message after submitting incorrect login credentials" )
67- @ DataSource (testCaseId = "TC-2" , filePath = "login/login.csv" , clazz = LoginTestData .class )
68+ @ DataSource (testCaseId = "TC-2" , filePath = PATH , clazz = LoginTestData .class )
6869 void testIncorrectLoginCredentials (LoginTestData loginDto ) {
6970 loginPage
7071 .navigateToUrl ()
71- .fillUsernameInTextBox (loginDto .getUserName ())
72- .fillPasswordInTextBox (loginDto .getPassword ())
72+ .typeUsernameIntoTextBox (loginDto .getUserName ())
73+ .typePasswordIntoTextBox (loginDto .getPassword ())
7374 .clickOnLoginButton ();
7475
7576 assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
@@ -81,11 +82,11 @@ void testIncorrectLoginCredentials(LoginTestData loginDto) {
8182 @ Owner ("Tahanima Chowdhury" )
8283 @ Description (
8384 "Test that verifies user gets error message after submitting login credentials where the username is blank" )
84- @ DataSource (testCaseId = "TC-3" , filePath = "login/login.csv" , clazz = LoginTestData .class )
85+ @ DataSource (testCaseId = "TC-3" , filePath = PATH , clazz = LoginTestData .class )
8586 void testBlankUserName (LoginTestData loginDto ) {
8687 loginPage
8788 .navigateToUrl ()
88- .fillPasswordInTextBox (loginDto .getPassword ())
89+ .typePasswordIntoTextBox (loginDto .getPassword ())
8990 .clickOnLoginButton ();
9091
9192 assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
@@ -97,11 +98,11 @@ void testBlankUserName(LoginTestData loginDto) {
9798 @ Owner ("Tahanima Chowdhury" )
9899 @ Description (
99100 "Test that verifies user gets error message after submitting login credentials where the password is blank" )
100- @ DataSource (testCaseId = "TC-4" , filePath = "login/login.csv" , clazz = LoginTestData .class )
101+ @ DataSource (testCaseId = "TC-4" , filePath = PATH , clazz = LoginTestData .class )
101102 void testBlankPassword (LoginTestData loginDto ) {
102103 loginPage
103104 .navigateToUrl ()
104- .fillUsernameInTextBox (loginDto .getUserName ())
105+ .typeUsernameIntoTextBox (loginDto .getUserName ())
105106 .clickOnLoginButton ();
106107
107108 assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
@@ -113,12 +114,12 @@ void testBlankPassword(LoginTestData loginDto) {
113114 @ Owner ("Tahanima Chowdhury" )
114115 @ Description (
115116 "Test that verifies user gets error message after submitting login credentials for locked out user" )
116- @ DataSource (testCaseId = "TC-5" , filePath = "login/login.csv" , clazz = LoginTestData .class )
117+ @ DataSource (testCaseId = "TC-5" , filePath = PATH , clazz = LoginTestData .class )
117118 void testLockedOutUser (LoginTestData loginDto ) {
118119 loginPage
119120 .navigateToUrl ()
120- .fillUsernameInTextBox (loginDto .getUserName ())
121- .fillPasswordInTextBox (loginDto .getPassword ())
121+ .typeUsernameIntoTextBox (loginDto .getUserName ())
122+ .typePasswordIntoTextBox (loginDto .getPassword ())
122123 .clickOnLoginButton ();
123124
124125 assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
0 commit comments