|
|
@@ -1,19 +1,35 @@
|
|
1
|
1
|
package se.citerus.dddsample.acceptance;
|
|
2
|
2
|
|
|
|
3
|
+import org.junit.Before;
|
|
3
|
4
|
import org.junit.Test;
|
|
4
|
5
|
import se.citerus.dddsample.acceptance.pages.CustomerPage;
|
|
5
|
6
|
import se.citerus.dddsample.acceptance.pages.LaunchPage;
|
|
6
|
7
|
|
|
7
|
8
|
public class CustomerAcceptanceTest extends AbstractAcceptanceTest {
|
|
8
|
|
- @Test
|
|
9
|
|
- public void customerSiteIsOperational() {
|
|
|
9
|
+ private CustomerPage customerPage;
|
|
|
10
|
+
|
|
|
11
|
+ @Before
|
|
|
12
|
+ public void goToCustomerPage() {
|
|
10
|
13
|
LaunchPage home = new LaunchPage(driver,"http://localhost:8080/");
|
|
|
14
|
+ customerPage = home.goToCustomerPage();
|
|
|
15
|
+ }
|
|
11
|
16
|
|
|
12
|
|
- CustomerPage customerPage = home.goToCustomerPage();
|
|
|
17
|
+ @Test
|
|
|
18
|
+ public void customerSiteCanTrackValidCargo() {
|
|
13
|
19
|
customerPage.trackCargoWithIdOf("ABC123");
|
|
14
|
20
|
customerPage.expectCargoLocation("New York");
|
|
|
21
|
+ }
|
|
15
|
22
|
|
|
|
23
|
+ @Test
|
|
|
24
|
+ public void customerSiteErrorsOnInvalidCargo() {
|
|
|
25
|
+ customerPage.trackCargoWithIdOf("XXX999");
|
|
|
26
|
+ customerPage.expectErrorFor("Unknown tracking id");
|
|
|
27
|
+ }
|
|
16
|
28
|
|
|
|
29
|
+ @Test
|
|
|
30
|
+ public void customerSiteNotifiesOnMisdirectedCargo() {
|
|
|
31
|
+ customerPage.trackCargoWithIdOf("JKL567");
|
|
|
32
|
+ customerPage.expectNotificationOf("Cargo is misdirected");
|
|
17
|
33
|
}
|
|
18
|
34
|
|
|
19
|
35
|
}
|