File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
src/test/java/io/github/tahanima/e2e/login Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
package io .github .tahanima .e2e .login ;
2
2
3
- import io .github .tahanima .e2e .BaseE2ETest ;
4
3
import io .github .tahanima .data .login .LoginData ;
4
+ import io .github .tahanima .e2e .BaseE2ETest ;
5
5
import io .github .tahanima .pages .login .LoginPage ;
6
6
import io .github .tahanima .pages .product .ProductsPage ;
7
7
import org .testng .ITestNGMethod ;
@@ -37,22 +37,19 @@ public void createBrowserContextAndPage() {
37
37
}
38
38
39
39
@ AfterMethod (alwaysRun = true )
40
- public void closeBrowserContext () {
41
- browserContext .close ();
42
- }
43
-
44
- @ Override
45
- public void initialize () {}
46
-
47
- @ AfterMethod
48
- public void captureScreenshot (ITestResult result ) {
40
+ public void captureScreenshotAndCloseBrowserContext (ITestResult result ) {
49
41
ITestNGMethod method = result .getMethod ();
50
42
51
43
if (ITestResult .FAILURE == result .getStatus ()) {
52
44
loginPage .captureScreenshot (method .getMethodName ());
53
45
}
46
+
47
+ browserContext .close ();
54
48
}
55
49
50
+ @ Override
51
+ public void initialize () {}
52
+
56
53
@ Test (
57
54
testName = "TC-1" ,
58
55
dataProvider = "loginData" ,
You can’t perform that action at this time.
0 commit comments