forked from applitools/JavaSeleniumDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCase.java
More file actions
31 lines (27 loc) · 900 Bytes
/
Copy pathTestCase.java
File metadata and controls
31 lines (27 loc) · 900 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
import com.applitools.eyes.RectangleSize;
import com.applitools.eyes.selenium.Eyes;
import com.applitools.eyes.selenium.fluent.Target;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.junit.jupiter.api.*;
import org.openqa.selenium.WebDriver;
public class TestCase {
WebDriver driver;
Eyes eyes;
@BeforeEach
public void beforeEach(TestInfo testInfo) {
eyes = new Eyes();
eyes.setApiKey(System.getenv("APPLITOOLS_API_KEY"));
driver = WebDriverManager.chromedriver().create();
eyes.open(driver, "My First Tests", testInfo.getTestMethod().get().getName(), new RectangleSize(1000, 600));
}
@Test
public void myTestCase() {
driver.get("https://applitools.com/helloworld/");
eyes.check(Target.window());
}
@AfterEach
public void afterEach() {
eyes.closeAsync();
driver.close();
}
}