Skip to content

Commit 8bf1d5e

Browse files
committed
MOBILE-3294: Fix and format behat tests
1 parent 0b9de01 commit 8bf1d5e

File tree

15 files changed

+2469
-3367
lines changed

15 files changed

+2469
-3367
lines changed

mod/assignment/tests/behat/app_basic_usage.feature

Lines changed: 155 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -16,182 +16,159 @@ Feature: Test basic usage of assignment activity in app
1616
| teacher1 | C1 | editingteacher |
1717
| student1 | C1 | student |
1818
And the following "activities" exist:
19-
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod |
20-
| assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1 | manual |
21-
22-
23-
@app @3.8.0 @OK
24-
Scenario: View assign and add a submission (online text), submit for grading, view own submission or student submission and view list of student submissions (as teacher)
25-
When I enter the app
26-
And I log in as "student1"
27-
Then the header should be "Acceptance test site" in the app
28-
And I should see "Course 1"
29-
And I press "Course 1" near "Recently accessed courses" in the app
30-
Then the header should be "Course 1" in the app
31-
And I press "assignment1" in the app
32-
Then the header should be "assignment1" in the app
33-
And I should see "Test assignment description1"
34-
And I should see "Due date"
35-
And I should see "Thursday, 1 January 1970, 1:00 AM"
36-
And I press "Add submission" in the app
37-
And I set the field "Online text submissions" to "Submission test" in the app
38-
And I press "Save" in the app
39-
Then I should see "Draft (not submitted)"
40-
And I should see "Not graded"
41-
And I press "Edit submission" in the app
42-
And I set the field "Online text submissions" to "Submission test edited" in the app
43-
And I press "Save" in the app
44-
And I press "OK" in the app
45-
And I press "Submit assignment" in the app
46-
And I press "OK" in the app
47-
Then I should see "Submitted for grading"
48-
And I should see "Not graded"
49-
And I should see "Submission test edited"
50-
When I enter the app
51-
And I log in as "teacher1"
52-
Then the header should be "Acceptance test site" in the app
53-
And I should see "Course 1"
54-
And I press "Course 1" near "Recently accessed courses" in the app
55-
Then the header should be "Course 1" in the app
56-
And I press "assignment1" in the app
57-
Then the header should be "assignment1" in the app
58-
And I press "Submitted" in the app
59-
Then I should see "Student student"
60-
And I should see "Not graded"
61-
And I press "Student student" near "assignment1" in the app
62-
Then I should see "Online text submission"
63-
And I should see "Submission test edited"
64-
65-
@app @3.8.0 @OK
19+
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod |
20+
| assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1029844800 | manual |
21+
22+
@app @3.8.0
23+
Scenario: Create, edit and submit an assignment as a student, view it as a teacher
24+
# Create, edit and submit as a student
25+
When I enter the app
26+
And I log in as "student1"
27+
And I press "Course 1" near "Recently accessed courses" in the app
28+
And I press "assignment1" in the app
29+
Then the header should be "assignment1" in the app
30+
And I should see "Test assignment description1"
31+
And I should see "Due date"
32+
And I should see "Tuesday, 20 August 2002, 12:00 PM"
33+
34+
When I press "Add submission" in the app
35+
And I set the field "Online text submissions" to "Submission test" in the app
36+
And I press "Save" in the app
37+
Then I should see "Draft (not submitted)"
38+
And I should see "Not graded"
39+
40+
When I press "Edit submission" in the app
41+
And I set the field "Online text submissions" to "Submission test edited" in the app
42+
And I press "Save" in the app
43+
And I press "OK" in the app
44+
Then I should see "Submission test edited"
45+
46+
When I press "Submit assignment" in the app
47+
And I press "OK" in the app
48+
Then I should see "Submitted for grading"
49+
And I should see "Not graded"
50+
And I should see "Submission test edited"
51+
52+
# View as a teacher
53+
When I enter the app
54+
And I log in as "teacher1"
55+
And I press "Course 1" near "Recently accessed courses" in the app
56+
And I press "assignment1" in the app
57+
Then the header should be "assignment1" in the app
58+
59+
When I press "Submitted" in the app
60+
Then I should see "Student student"
61+
And I should see "Not graded"
62+
63+
When I press "Student student" near "assignment1" in the app
64+
Then I should see "Online text submissions"
65+
And I should see "Submission test edited"
66+
67+
@app @3.8.0
6668
Scenario: Add new attempt from previous submission
67-
When I enter the app
68-
And I log in as "student1"
69-
Then the header should be "Acceptance test site" in the app
70-
And I should see "Course 1"
71-
And I press "Course 1" near "Recently accessed courses" in the app
72-
Then the header should be "Course 1" in the app
73-
And I press "assignment1" in the app
74-
Then the header should be "assignment1" in the app
75-
And I should see "Test assignment description1"
76-
And I should see "Due date"
77-
And I should see "Thursday, 1 January 1970, 1:00 AM"
78-
And I press "Add submission" in the app
79-
And I set the field "Online text submissions" to "Submission test" in the app
80-
And I press "Save" in the app
81-
And I press "Submit assignment" in the app
82-
And I press "OK" in the app
83-
When I enter the app
84-
And I log in as "teacher1"
85-
Then the header should be "Acceptance test site" in the app
86-
And I should see "Course 1"
87-
And I press "Course 1" near "Recently accessed courses" in the app
88-
Then the header should be "Course 1" in the app
89-
And I press "assignment1" in the app
90-
Then the header should be "assignment1" in the app
91-
And I press "Participants" in the app
92-
Then I should see "Student student"
93-
And I should see "Not graded"
94-
And I press "Student student" near "assignment1" in the app
95-
Then I should see "Online text submission"
96-
And I should see "Submission test"
97-
And I press "Grade" in the app
98-
And I press "Allow another attempt" in the app
99-
And I press "Done"
100-
Then I should see "Reopened"
101-
And I should see "Not graded"
102-
When I enter the app
103-
And I log in as "student1"
104-
Then the header should be "Acceptance test site" in the app
105-
And I should see "Course 1"
106-
And I press "Course 1" near "Recently accessed courses" in the app
107-
Then the header should be "Course 1" in the app
108-
And I press "assignment1" in the app
109-
And I should see "Reopened"
110-
And I should see "2 out of Unlimited"
111-
And I should see "Add a new attempt based on previous submission"
112-
And I should see "Add a new attempt"
113-
And I press "Add a new attempt based on previous submission" in the app
114-
And I press "OK" in the app
115-
Then I should see "Submission test"
116-
And I set the field "Online text submissions" to "Submission test 2 attempt" in the app
117-
And I press "Save" in the app
118-
And I press "OK" in the app
119-
And I press "Submit assignment" in the app
120-
And I press "OK" in the app
121-
When I enter the app
122-
And I log in as "teacher1"
123-
Then the header should be "Acceptance test site" in the app
124-
And I should see "Course 1"
125-
And I press "Course 1" near "Recently accessed courses" in the app
126-
Then the header should be "Course 1" in the app
127-
And I press "assignment1" in the app
128-
Then the header should be "assignment1" in the app
129-
And I press "Participants" in the app
130-
Then I should see "Student student"
131-
And I should see "Not graded"
132-
And I press "Student student" near "assignment1" in the app
133-
Then I should see "Online text submission"
134-
And I should see "Submission test 2 attempt"
135-
136-
@app @3.8.0 @OK
137-
Scenario: Add submission offline (online text), submit for grading offline and sync submissions
138-
When I enter the app
139-
And I log in as "student1"
140-
Then the header should be "Acceptance test site" in the app
141-
And I should see "Course 1"
142-
And I press "Course 1" near "Recently accessed courses" in the app
143-
Then the header should be "Course 1" in the app
144-
And I press "assignment1" in the app
145-
Then the header should be "assignment1" in the app
146-
And I should see "Test assignment description1"
147-
And I should see "Due date"
148-
And I should see "Thursday, 1 January 1970, 1:00 AM"
149-
And I press "Add submission" in the app
150-
And I switch offline mode to "true"
151-
And I set the field "Online text submissions" to "Submission test" in the app
152-
And I press "Save" in the app
153-
And I press "Submit assignment" in the app
154-
And I press "OK" in the app
155-
Then I should see "This Assignment has offline data to be synchronised."
156-
And I switch offline mode to "false"
157-
And I press the back button in the app
158-
And I press "assignment1" in the app
159-
And I press "Display options" in the app
160-
And I press "Refresh" in the app
161-
Then I should not see "This Assignment has offline data to be synchronised."
162-
And I should see "Submitted for grading"
163-
164-
@app @3.8.0 @OK
165-
Scenario: Edit an offline submission before synchronizing it
166-
When I enter the app
167-
And I log in as "student1"
168-
Then the header should be "Acceptance test site" in the app
169-
And I should see "Course 1"
170-
And I press "Course 1" near "Recently accessed courses" in the app
171-
Then the header should be "Course 1" in the app
172-
And I press "assignment1" in the app
173-
Then the header should be "assignment1" in the app
174-
And I should see "Test assignment description1"
175-
And I should see "Due date"
176-
And I should see "Thursday, 1 January 1970, 1:00 AM"
177-
And I press "Add submission" in the app
178-
And I switch offline mode to "true"
179-
And I set the field "Online text submissions" to "Submission test1" in the app
180-
And I press "Save" in the app
181-
Then I should see "This Assignment has offline data to be synchronised."
182-
And I should see "Submission test1"
183-
And I press "Edit submission" in the app
184-
And I set the field "Online text submissions" to "Submission test edited offline" in the app
185-
And I press "Save" in the app
186-
Then I should see "This Assignment has offline data to be synchronised."
187-
And I should not see "Submission test1"
188-
And I should see "Submission test edited offline"
189-
And I press "Submit assignment" in the app
190-
And I press "OK" in the app
191-
Then I should see "This Assignment has offline data to be synchronised."
192-
And I switch offline mode to "false"
193-
And I press the back button in the app
194-
And I press "assignment1" in the app
195-
Then I should not see "This Assignment has offline data to be synchronised."
196-
And I should see "Submitted for grading"
197-
And I should see "Submission test edited offline"
69+
# Submit first attempt as a student
70+
Given I enter the app
71+
And I log in as "student1"
72+
And I press "Course 1" near "Recently accessed courses" in the app
73+
And I press "assignment1" in the app
74+
And I press "Add submission" in the app
75+
And I set the field "Online text submissions" to "Submission test 1st attempt" in the app
76+
And I press "Save" in the app
77+
And I press "Submit assignment" in the app
78+
And I press "OK" in the app
79+
80+
# Allow more attempts as a teacher
81+
When I enter the app
82+
And I log in as "teacher1"
83+
And I press "Course 1" near "Recently accessed courses" in the app
84+
And I press "assignment1" in the app
85+
And I press "Participants" in the app
86+
And I press "Student student" near "assignment1" in the app
87+
And I press "Grade" in the app
88+
And I press "Allow another attempt" in the app
89+
And I press "Done"
90+
Then I should see "Reopened"
91+
And I should see "Not graded"
92+
93+
# Submit second attempt as a student
94+
When I enter the app
95+
And I log in as "student1"
96+
And I press "Course 1" near "Recently accessed courses" in the app
97+
And I press "assignment1" in the app
98+
Then I should see "Reopened"
99+
And I should see "2 out of Unlimited"
100+
And I should see "Add a new attempt based on previous submission"
101+
And I should see "Add a new attempt"
102+
103+
When I press "Add a new attempt based on previous submission" in the app
104+
And I press "OK" in the app
105+
Then I should see "Submission test 1st attempt"
106+
107+
When I set the field "Online text submissions" to "Submission test 2nd attempt" in the app
108+
And I press "Save" in the app
109+
And I press "OK" in the app
110+
And I press "Submit assignment" in the app
111+
And I press "OK" in the app
112+
113+
# View second attempt as a teacher
114+
When I enter the app
115+
And I log in as "teacher1"
116+
And I press "Course 1" near "Recently accessed courses" in the app
117+
And I press "assignment1" in the app
118+
And I press "Participants" in the app
119+
And I press "Student student" near "assignment1" in the app
120+
Then I should see "Online text submissions"
121+
And I should see "Submission test 2nd attempt"
122+
123+
@app @3.8.0
124+
Scenario: Add offline submission and synchronise it
125+
When I enter the app
126+
And I log in as "student1"
127+
And I press "Course 1" near "Recently accessed courses" in the app
128+
And I press "assignment1" in the app
129+
And I press "Add submission" in the app
130+
And I switch offline mode to "true"
131+
And I set the field "Online text submissions" to "Submission test" in the app
132+
And I press "Save" in the app
133+
And I press "Submit assignment" in the app
134+
And I press "OK" in the app
135+
Then I should see "This Assignment has offline data to be synchronised."
136+
137+
When I switch offline mode to "false"
138+
And I press the back button in the app
139+
And I press "assignment1" in the app
140+
And I press "Display options" in the app
141+
And I press "Refresh" in the app
142+
Then I should see "Submitted for grading"
143+
But I should not see "This Assignment has offline data to be synchronised."
144+
145+
@app @3.8.0
146+
Scenario: Edit an offline submission before synchronising it
147+
When I enter the app
148+
And I log in as "student1"
149+
And I press "Course 1" near "Recently accessed courses" in the app
150+
And I press "assignment1" in the app
151+
And I press "Add submission" in the app
152+
And I switch offline mode to "true"
153+
And I set the field "Online text submissions" to "Submission test original offline" in the app
154+
And I press "Save" in the app
155+
Then I should see "This Assignment has offline data to be synchronised."
156+
And I should see "Submission test original offline"
157+
158+
When I press "Edit submission" in the app
159+
And I set the field "Online text submissions" to "Submission test edited offline" in the app
160+
And I press "Save" in the app
161+
Then I should see "This Assignment has offline data to be synchronised."
162+
And I should see "Submission test edited offline"
163+
But I should not see "Submission test original offline"
164+
165+
When I press "Submit assignment" in the app
166+
And I press "OK" in the app
167+
Then I should see "This Assignment has offline data to be synchronised."
168+
169+
When I switch offline mode to "false"
170+
And I press the back button in the app
171+
And I press "assignment1" in the app
172+
Then I should see "Submitted for grading"
173+
And I should see "Submission test edited offline"
174+
But I should not see "This Assignment has offline data to be synchronised."

0 commit comments

Comments
 (0)