-
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathStudentTest.java
More file actions
55 lines (41 loc) · 1.6 KB
/
StudentTest.java
File metadata and controls
55 lines (41 loc) · 1.6 KB
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
50
51
52
53
54
55
package selenium.analytics.students;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import lombok.extern.slf4j.Slf4j;
import selenium.util.DomainHelper;
@Slf4j
public class StudentTest {
private WebDriver driver;
@BeforeEach
public void setUp() {
log.info("setUp");
ChromeOptions chromeOptions = new ChromeOptions();
// Read "headless" property set on the command line:
// mvn clean verify -P regression-test-ui -D headless=true
String headlessSystemProperty = System.getProperty("headless");
log.info("headlessSystemProperty: \"" + headlessSystemProperty + "\"");
if ("true".equals(headlessSystemProperty)) {
chromeOptions.addArguments("headless");
}
driver = new ChromeDriver(chromeOptions);
driver.get(DomainHelper.getBaseUrl() + "/analytics/students");
log.info("driver.getCurrentUrl(): " + driver.getCurrentUrl());
}
@AfterEach
public void tearDown() {
log.info("tearDown");
driver.quit();
}
@Test
public void testRandomStudentEditPage() {
log.info("testRandomStudentEditPage");
StudentListPage studentListPage = new StudentListPage(driver);
studentListPage.pressRandomStudent();
log.info("driver.getCurrentUrl(): " + driver.getCurrentUrl());
StudentPage studentPage = new StudentPage(driver);
}
}