File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed
main/java/io/github/tahanima/page
test/java/io/github/tahanima/e2e Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 12
12
*/
13
13
public class LoginPage extends BasePage {
14
14
15
- @ Step
15
+ @ Step ( "Navigate to the login page" )
16
16
public LoginPage navigateToUrl () {
17
17
page .navigate (config ().baseUrl ());
18
18
19
19
return this ;
20
20
}
21
21
22
- @ Step
22
+ @ Step ( "Fill <username> in 'Username' textbox" )
23
23
public LoginPage fillUsernameInTextBox (String username ) {
24
24
page .fill ("id=user-name" , username );
25
25
26
26
return this ;
27
27
}
28
28
29
- @ Step
29
+ @ Step ( "Fill <password> in 'Password' textbox" )
30
30
public LoginPage fillPasswordInTextBox (String password ) {
31
31
page .fill ("id=password" , password );
32
32
33
33
return this ;
34
34
}
35
35
36
- @ Step
36
+ @ Step ( "Get error message" )
37
37
public Locator getErrorMessage () {
38
38
return page .locator (".error-message-container h3" );
39
39
}
40
40
41
- @ Step
41
+ @ Step ( "Click on the 'Login' button" )
42
42
public void clickOnLoginButton () {
43
43
page .click ("id=login-button" );
44
44
}
Original file line number Diff line number Diff line change 10
10
*/
11
11
public class ProductsPage extends BasePage {
12
12
13
- @ Step
13
+ @ Step ( "Get title of the 'Products' page" )
14
14
public Locator getTitle () {
15
15
return page .locator (".title" );
16
16
}
Original file line number Diff line number Diff line change 17
17
import io .github .tahanima .util .BrowserManager ;
18
18
19
19
import org .apache .commons .lang3 .StringUtils ;
20
- import org .junit .jupiter .api .AfterAll ;
21
- import org .junit .jupiter .api .BeforeAll ;
22
- import org .junit .jupiter .api .TestInstance ;
20
+ import org .junit .jupiter .api .*;
23
21
import org .junit .jupiter .api .extension .AfterTestExecutionCallback ;
24
22
import org .junit .jupiter .api .extension .RegisterExtension ;
25
23
@@ -53,7 +51,7 @@ protected <T extends BasePage> T createInstance(Class<T> basePage) {
53
51
}
54
52
55
53
@ BeforeAll
56
- public void setup () {
54
+ public void createPlaywrightAndBrowserInstancesAndSetupAllureEnvironment () {
57
55
playwright = Playwright .create ();
58
56
browser = BrowserManager .browser (playwright );
59
57
@@ -68,7 +66,7 @@ public void setup() {
68
66
}
69
67
70
68
@ AfterAll
71
- public void teardown () {
69
+ public void closeBrowserAndPlaywrightSessions () {
72
70
browser .close ();
73
71
playwright .close ();
74
72
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class LoginE2ETest extends BaseE2ETest {
21
21
private LoginPage loginPage ;
22
22
23
23
@ BeforeEach
24
- public void initialize () {
24
+ public void createBrowserContextAndPageAndLoginPageInstances () {
25
25
browserContext = browser .newContext ();
26
26
page = browserContext .newPage ();
27
27
@@ -34,7 +34,7 @@ protected byte[] captureScreenshotOnFailure() {
34
34
}
35
35
36
36
@ AfterEach
37
- public void closeBrowserContext () {
37
+ public void closeBrowserContextSession () {
38
38
browserContext .close ();
39
39
}
40
40
You can’t perform that action at this time.
0 commit comments