-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy pathHook.java
More file actions
40 lines (29 loc) · 839 Bytes
/
Hook.java
File metadata and controls
40 lines (29 loc) · 839 Bytes
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
package Steps;
import Base.BaseUtil;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.Before;
/**
* Created by Karthik on 10/17/2016.
*/
public class Hook extends BaseUtil{
private BaseUtil base;
public Hook(BaseUtil base) {
this.base = base;
}
@Before
public void InitializeTest() {
System.out.println("Opening the browser : MOCK");
//Passing a dummy WebDriver instance step info
base.StepInfo = "FirefoxDriver";
}
@After
public void TearDownTest(Scenario scenario) {
if (scenario.isFailed()) {
//Take screenshot logic goes here
System.out.println(scenario.getName());
}
System.out.println("Closing the browser : MOCK");
System.out.println("Success Lofing");
}
}