-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrontendDeveloperTests.java
More file actions
141 lines (115 loc) · 4.44 KB
/
FrontendDeveloperTests.java
File metadata and controls
141 lines (115 loc) · 4.44 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.testfx.framework.junit5.ApplicationTest;
import javafx.scene.control.Label;
*/
/**
* All of these tests can be slightly updated to be correct with the actual output expected
* Right now all of these are passing because they are using the expected output from
* the BackendPlaceholder class
*//*
public class FrontendDeveloperTests extends ApplicationTest {
*/
/**
* This method launches the JavaFX application that you would like to test
* BeforeEach of your @Test methods are run.
*//*
@BeforeEach
public void setup() throws Exception {
Frontend.setBackend(new Backend(new DijkstraGraph()));
ApplicationTest.launch(Frontend.class);
}
*/
/**
* Tests that the shortest path without checking the include walking distance
* checkbox returns what we would expect
*//*
@Test
public void testShortestPathNoWalkingDistance() {
Label resultsLabel = lookup("#resultsLabel").query();
clickOn("#srcTextBox");
write("Union South");
clickOn("#dstTextBox");
write("Computer Sciences and Statistics");
clickOn("#searchButton");
Assertions.assertTrue(resultsLabel.getText().contains(("Results List:")));
Assertions.assertTrue(resultsLabel.getText().contains(("Union South")));
Assertions.assertTrue(resultsLabel.getText().contains(("Computer Sciences and Statistics")));
}
*/
/**
* Tests that the shortest path without checking the include walking distance
* checkbox returns what we would expect
*//*
@Test
public void testShortestPathWithWalkingDistance() {
Label resultsLabel = lookup("#resultsLabel").query();
clickOn("#srcTextBox");
write("Union South");
clickOn("#dstTextBox");
write("Computer Sciences and Statistics");
clickOn("#walkingTimesBox");
clickOn("#searchButton");
Assertions.assertTrue(resultsLabel.getText().contains(("Results List (with walking times):")));
Assertions.assertTrue(resultsLabel.getText().contains(("Union South (176.0)--> Computer Sciences and Statistics")));
Assertions.assertTrue(resultsLabel.getText().contains(("Approximate Total Time: 2min 56sec")));
}
*/
/**
* Tests the furthest from labels, button and output to make
* sure it is what we expect for certain inputs
*//*
@Test
public void testFurthestLocation() {
Label furthestFrom = lookup("#furthestFromLabel").query();
clickOn("#locTextBox");
write("Union South");
clickOn("#furthestFromButton");
Assertions.assertTrue(furthestFrom.getText().contains("Smith Residence Hall"));
Assertions.assertTrue(furthestFrom.getText().contains("Approximate Total Time: 29min 53sec"));
}
*/
/**
* This method tests that when you click the About button the label becomes visible and the user sees
* the information. I was going to test the quit button but I don't know how to
*//*
@Test
public void testAbout() {
Label aboutLabel = lookup("#aboutLabel").query();
clickOn("#about");
Assertions.assertTrue(aboutLabel.getText().contains("This application can help you find paths between"));
}
*/
/**
* Tests that the shortest path without checking the include walking distance
* checkbox returns the correct error whem the second location is wrong
*//*
@Test
public void testShortestPathBadFirstLocation() {
Label srcLabel = lookup("#srcLabel").query();
clickOn("#srcTextBox");
write("Union North");
clickOn("#dstTextBox");
write("Computer Sciences and Statistics");
clickOn("#searchButton");
Assertions.assertTrue(srcLabel.getText().contains(("ERROR")));
}
*/
/**
* Tests that the shortest path without checking the include walking distance
* checkbox returns the correct error whem the second location is wrong
*//*
@Test
public void testShortestPathBadSecondLocation() {
Label dstLabel = lookup("#dstLabel").query();
clickOn("#srcTextBox");
write("Union South");
clickOn("#dstTextBox");
write("Computer Stuff and Statistics");
clickOn("#searchButton");
Assertions.assertTrue(dstLabel.getText().contains(("ERROR")));
}
}
*/