Skip to content

Commit 5a87720

Browse files
committed
Add example of cypress test in tutorial
1 parent 84183e2 commit 5a87720

File tree

13 files changed

+3752
-3
lines changed

13 files changed

+3752
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"autograding_method" : "docker",
3+
"container_options" : {
4+
//States that a given testcase uses a router by default. (Default value is true)
5+
"use_router" : false
6+
},
7+
"testcases" : [
8+
{
9+
// Student-visible testcase name.
10+
"title" : "Cypress Frontend Evaluation",
11+
12+
// Commands to run (in order). These are not shell commands, although
13+
// they support some common shell wildcards. This can either be a
14+
// list or a single string.
15+
"containers" : [
16+
{
17+
"container_name": "cypress-evaluator",
18+
"commands" : [ "run-p start test" ],
19+
// Should contain docker build from dockerfile mentioned in question input directory
20+
"container_image" : "submitty/cypress-evaluation:latest"
21+
}
22+
],
23+
24+
"dispatcher_actions" : [
25+
{
26+
"action" : "delay",
27+
"seconds" : 2
28+
},
29+
{
30+
"containers" : ["cypress-evaluator"],
31+
"action" : "stdin",
32+
"string" : "Check output"
33+
}
34+
],
35+
36+
// Point value of this testcase.
37+
"points" : 10,
38+
39+
"validation" : [
40+
{
41+
// Grade by "diffing" the student output with an
42+
// instructor-provided file.
43+
"method" : "diff",
44+
// The student's container0 output.
45+
"actual_file" : "cypress-evaluator/results.txt",
46+
// The title seen by students.
47+
"description" : "Cypress Evaluator Output",
48+
// The instructor-provided file (the correct answer).
49+
"expected_file" : "expected_output.txt"
50+
}
51+
]
52+
}
53+
]
54+
}
55+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
FROM cypress/included:13.6.6
22

3+
WORKDIR /app
4+
5+
COPY . .
6+
37
RUN npm install
48

59
CMD [ "npm", "run-p", "start", "test" ]

0 commit comments

Comments
 (0)