18
18
*/
19
19
class LoginE2ETest extends BaseE2ETest {
20
20
21
+ private final static String PATH = "login/login.csv" ;
21
22
private LoginPage loginPage ;
22
23
23
24
@ BeforeEach
@@ -45,12 +46,12 @@ public void closeBrowserContextSession() {
45
46
@ Owner ("Tahanima Chowdhury" )
46
47
@ Description (
47
48
"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 )
49
50
void testCorrectLoginCredentials (LoginTestData loginDto ) {
50
51
loginPage
51
52
.navigateToUrl ()
52
- .fillUsernameInTextBox (loginDto .getUserName ())
53
- .fillPasswordInTextBox (loginDto .getPassword ())
53
+ .typeUsernameIntoTextBox (loginDto .getUserName ())
54
+ .typePasswordIntoTextBox (loginDto .getPassword ())
54
55
.clickOnLoginButton ();
55
56
56
57
ProductsPage productsPage = createInstance (ProductsPage .class );
@@ -64,12 +65,12 @@ void testCorrectLoginCredentials(LoginTestData loginDto) {
64
65
@ Owner ("Tahanima Chowdhury" )
65
66
@ Description (
66
67
"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 )
68
69
void testIncorrectLoginCredentials (LoginTestData loginDto ) {
69
70
loginPage
70
71
.navigateToUrl ()
71
- .fillUsernameInTextBox (loginDto .getUserName ())
72
- .fillPasswordInTextBox (loginDto .getPassword ())
72
+ .typeUsernameIntoTextBox (loginDto .getUserName ())
73
+ .typePasswordIntoTextBox (loginDto .getPassword ())
73
74
.clickOnLoginButton ();
74
75
75
76
assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
@@ -81,11 +82,11 @@ void testIncorrectLoginCredentials(LoginTestData loginDto) {
81
82
@ Owner ("Tahanima Chowdhury" )
82
83
@ Description (
83
84
"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 )
85
86
void testBlankUserName (LoginTestData loginDto ) {
86
87
loginPage
87
88
.navigateToUrl ()
88
- .fillPasswordInTextBox (loginDto .getPassword ())
89
+ .typePasswordIntoTextBox (loginDto .getPassword ())
89
90
.clickOnLoginButton ();
90
91
91
92
assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
@@ -97,11 +98,11 @@ void testBlankUserName(LoginTestData loginDto) {
97
98
@ Owner ("Tahanima Chowdhury" )
98
99
@ Description (
99
100
"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 )
101
102
void testBlankPassword (LoginTestData loginDto ) {
102
103
loginPage
103
104
.navigateToUrl ()
104
- .fillUsernameInTextBox (loginDto .getUserName ())
105
+ .typeUsernameIntoTextBox (loginDto .getUserName ())
105
106
.clickOnLoginButton ();
106
107
107
108
assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
@@ -113,12 +114,12 @@ void testBlankPassword(LoginTestData loginDto) {
113
114
@ Owner ("Tahanima Chowdhury" )
114
115
@ Description (
115
116
"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 )
117
118
void testLockedOutUser (LoginTestData loginDto ) {
118
119
loginPage
119
120
.navigateToUrl ()
120
- .fillUsernameInTextBox (loginDto .getUserName ())
121
- .fillPasswordInTextBox (loginDto .getPassword ())
121
+ .typeUsernameIntoTextBox (loginDto .getUserName ())
122
+ .typePasswordIntoTextBox (loginDto .getPassword ())
122
123
.clickOnLoginButton ();
123
124
124
125
assertThat (loginPage .getErrorMessage ()).hasText (loginDto .getErrorMessage ());
0 commit comments