· 6 years ago · Oct 07, 2019, 05:32 AM
1@Before
2 public void beforeEach() {
3 // Initialize the Runner for your test.
4 runner = new ClassicRunner();
5
6 // Initialize the eyes SDK
7 eyes = new Eyes(runner);
8
9 // Raise an error if no API Key has been found.
10 if(isNullOrEmpty(System.getenv("APPLITOOLS_API_KEY"))) {
11 throw new RuntimeException("No API Key found; Please set environment variable 'APPLITOOLS_API_KEY'.");
12 }
13
14 // Set batch name
15 eyes.setBatch(batch);
16
17 ChromeOptions options = new ChromeOptions();
18 driver = new ChromeDriver(options);
19 }