-
Notifications
You must be signed in to change notification settings - Fork 1k
/
MyListener.java
49 lines (34 loc) · 1.22 KB
/
MyListener.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package test.listeners.github1130;
import java.util.ArrayList;
import java.util.List;
import org.testng.IClassListener;
import org.testng.ISuite;
import org.testng.ISuiteListener;
import org.testng.ITestClass;
import org.testng.ITestContext;
import org.testng.ITestResult;
public class MyListener implements ISuiteListener, IClassListener {
public static MyListener instance;
public List<String> beforeSuiteCount = new ArrayList<>();
public List<String> beforeClassCount = new ArrayList<>();
public MyListener() {
if (instance == null) {
instance = this;
}
}
public void onStart(ISuite suite) {
beforeSuiteCount.add(this.toString());
}
public void onBeforeClass(ITestClass testClass) {
beforeClassCount.add(this.toString());
}
public void onTestStart(ITestResult result) {}
public void onTestSuccess(ITestResult result) {}
public void onTestFailure(ITestResult result) {}
public void onTestSkipped(ITestResult result) {}
public void onTestFailedButWithinSuccessPercentage(ITestResult result) {}
public void onStart(ITestContext context) {}
public void onFinish(ITestContext context) {}
public void onFinish(ISuite suite) {}
public void onAfterClass(ITestClass testClass) {}
}