-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppTest.java
More file actions
66 lines (56 loc) · 1.71 KB
/
AppTest.java
File metadata and controls
66 lines (56 loc) · 1.71 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
56
57
58
59
60
61
62
63
64
65
66
import org.fluentlenium.adapter.FluentTest;
import org.junit.ClassRule;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import static org.assertj.core.api.Assertions.assertThat;
public class AppTest extends FluentTest {
public WebDriver webDriver = new HtmlUnitDriver();
@Override
public WebDriver getDefaultDriver() {
return webDriver;
}
@ClassRule
public static ServerRule server = new ServerRule();
@Test
public void rootTest() {
goTo("http://localhost:4567/");
assertThat(pageSource()).contains("Triangle Test");
}
@Test
public void IsNotATriangle() {
goTo ("http://localhost:4567/");
fill ("#sideA").with("2");
fill("#sideB").with("2");
fill("#sideC").with("50");
submit(".btn");
assertThat(pageSource()).contains("not a triangle");
}
@Test
public void IsEquilateral() {
goTo ("http://localhost:4567/");
fill ("#sideA").with("2");
fill ("#sideB").with("2");
fill ("#sideC").with("2");
submit(".btn");
assertThat(pageSource()).contains("Your triangle is an equilateral");
}
@Test
public void IsIsoceles(){
goTo ("http://localhost:4567/");
fill ("#sideA").with("5");
fill ("#sideB").with("5");
fill ("#sideC").with("3");
submit(".btn");
assertThat(pageSource()).contains("Your triangle is an isoceles");
}
@Test
public void IsScalene() {
goTo ("http://localhost:4567/");
fill ("#sideA").with("3");
fill ("#sideB").with("4");
fill ("#sideC").with("5");
submit(".btn");
assertThat(pageSource()).contains("Your triangle is a scalene");
}
}