|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+package se.citerus.dddsample;
|
|
|
2
|
+
|
|
|
3
|
+import org.junit.After;
|
|
|
4
|
+import org.junit.Before;
|
|
|
5
|
+import org.junit.Test;
|
|
|
6
|
+import org.openqa.selenium.By;
|
|
|
7
|
+import org.openqa.selenium.WebDriver;
|
|
|
8
|
+import org.openqa.selenium.WebElement;
|
|
|
9
|
+import org.openqa.selenium.chrome.ChromeDriver;
|
|
|
10
|
+
|
|
|
11
|
+import static org.junit.Assert.assertEquals;
|
|
|
12
|
+
|
|
|
13
|
+public class AcceptanceTests {
|
|
|
14
|
+ private WebDriver driver;
|
|
|
15
|
+
|
|
|
16
|
+ @Before
|
|
|
17
|
+ public void setup() {
|
|
|
18
|
+ driver = new ChromeDriver();
|
|
|
19
|
+ }
|
|
|
20
|
+
|
|
|
21
|
+ @Test
|
|
|
22
|
+ public void customerSiteIsOperational() {
|
|
|
23
|
+ driver.get("http://localhost:8080/dddsample");
|
|
|
24
|
+
|
|
|
25
|
+ assertEquals("DDDSample", driver.getTitle());
|
|
|
26
|
+ WebElement adminLink = driver.findElement(By.linkText("cargo tracking"));
|
|
|
27
|
+ adminLink.click();
|
|
|
28
|
+
|
|
|
29
|
+ assertEquals("Tracking cargo", driver.getTitle());
|
|
|
30
|
+//
|
|
|
31
|
+// WebElement trackingIdInput = driver.findElement(By.id("idInput"));
|
|
|
32
|
+// trackingIdInput.submit();
|
|
|
33
|
+
|
|
|
34
|
+ }
|
|
|
35
|
+
|
|
|
36
|
+ @Test
|
|
|
37
|
+ public void adminSiteIsOperational() {
|
|
|
38
|
+ driver.get("http://localhost:8080/dddsample");
|
|
|
39
|
+
|
|
|
40
|
+ assertEquals("DDDSample", driver.getTitle());
|
|
|
41
|
+ WebElement adminLink = driver.findElement(By.linkText("booking and routing"));
|
|
|
42
|
+ adminLink.click();
|
|
|
43
|
+
|
|
|
44
|
+ assertEquals("Cargo Administration", driver.getTitle());
|
|
|
45
|
+ }
|
|
|
46
|
+
|
|
|
47
|
+ @After
|
|
|
48
|
+ public void tearDown() {
|
|
|
49
|
+ driver.quit();
|
|
|
50
|
+
|
|
|
51
|
+ }
|
|
|
52
|
+}
|