-
Notifications
You must be signed in to change notification settings - Fork 467
Expand file tree
/
Copy pathHook.java
More file actions
41 lines (30 loc) · 922 Bytes
/
Hook.java
File metadata and controls
41 lines (30 loc) · 922 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
41
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");
System.setProperty("webdriver.chrome.driver", "C:\\Libs\\chromedriver.exe");
base.Driver = new ChromeDriver();
//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");
}
}