Skip to content

Commit e66e83c

Browse files
authored
Merge pull request #7 from NoelDeMartin/MOBILE-3294
Mobile 3294
2 parents 865f852 + 8bf1d5e commit e66e83c

File tree

15 files changed

+3328
-38
lines changed

15 files changed

+3328
-38
lines changed
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
@mod @mod_assign @app @javascript
2+
Feature: Test basic usage of assignment activity in app
3+
In order to participate in the assignment while using the mobile app
4+
I need basic assignment functionality to work
5+
6+
Background:
7+
Given the following "users" exist:
8+
| username | firstname | lastname | email |
9+
| teacher1 | Teacher | teacher | teacher1@example.com |
10+
| student1 | Student | student | student1@example.com |
11+
And the following "courses" exist:
12+
| fullname | shortname | category |
13+
| Course 1 | C1 | 0 |
14+
And the following "course enrolments" exist:
15+
| user | course | role |
16+
| teacher1 | C1 | editingteacher |
17+
| student1 | C1 | student |
18+
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 | 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
68+
Scenario: Add new attempt from previous submission
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."
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
@mod @mod_chat @app @javascript
2+
Feature: Test basic usage of chat in app
3+
As a student
4+
I need basic chat functionality to work
5+
6+
Background:
7+
Given the following "courses" exist:
8+
| fullname | shortname |
9+
| Course 1 | C1 |
10+
And the following "users" exist:
11+
| username | firstname | lastname |
12+
| student1 | david | student |
13+
| student2 | pau | student2 |
14+
And the following "course enrolments" exist:
15+
| user | course | role |
16+
| student1 | C1 | student |
17+
| student2 | C1 | student |
18+
And the following "activities" exist:
19+
| activity | name | intro | course | idnumber | groupmode |
20+
| chat | Test chat name | Test chat | C1 | chat | 0 |
21+
22+
@app @3.8.0
23+
Scenario: Send and read messages, send beeps and view connected users
24+
# Send messages as student1
25+
When I enter the app
26+
And I log in as "student1"
27+
And I press "Course 1" near "Course overview" in the app
28+
And I press "Test chat name" in the app
29+
Then I should see "Click here to enter the chat now"
30+
And I should see "View past chat sessions"
31+
32+
When I press "Click here to enter the chat now" in the app
33+
And I set the field "New message" to "Hi!"
34+
And I press "Send" in the app
35+
And I set the field "New message" to "I am David"
36+
And I press "Send" in the app
37+
Then I should see "Hi!"
38+
And I should see "I am David"
39+
40+
# Read messages, view connected users, send beep and reply as student2
41+
When I enter the app
42+
And I log in as "student2"
43+
And I press "Course 1" near "Course overview" in the app
44+
And I press "Test chat name" in the app
45+
And I press "Click here to enter the chat now" in the app
46+
Then I should see "Hi!"
47+
And I should see "I am David"
48+
49+
When I press "people" in the app
50+
Then I should see "david student"
51+
52+
When I press "Beep" in the app
53+
Then I should see "You beeped david student"
54+
55+
When I set the field "New message" to "Hi David, I am Pau."
56+
And I press "Send" in the app
57+
Then I should see "Hi David, I am Pau."
58+
59+
@app @3.8.0
60+
Scenario: View past sessions shown for >=3.5
61+
# Send messages as student1
62+
Given I enter the app
63+
And I log in as "student1"
64+
And I press "Course 1" near "Course overview" in the app
65+
And I press "Test chat name" in the app
66+
And I press "Click here to enter the chat now" in the app
67+
And I set the field "New message" to "Hi!"
68+
And I press "Send" in the app
69+
And I set the field "New message" to "I am David"
70+
And I press "Send" in the app
71+
72+
# Read messages from past sessions as student2
73+
When I enter the app
74+
And I log in as "student2"
75+
And I press "Course 1" near "Course overview" in the app
76+
And I press "Test chat name" in the app
77+
And I press "View past chat sessions" in the app
78+
And I press "Show incomplete sessions" in the app
79+
And I press "david student (2)" in the app
80+
Then I should see "Hi!"
81+
And I should see "I am David"

0 commit comments

Comments
 (0)