1 |
efrain |
1 |
@mod @mod_assign @javascript
|
|
|
2 |
Feature: Manage assignment submission web notifications
|
|
|
3 |
In order to receive assignment submission notifications
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to turn on web notifications for assignment submission
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
# Turn off the course welcome message, so we can easily test other messages.
|
|
|
9 |
Given the following config values are set as admin:
|
|
|
10 |
| sendcoursewelcomemessage | 0 | enrol_manual |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| student1 | Student | 1 | student1@example.com |
|
|
|
14 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
15 |
And the following "user preferences" exist:
|
|
|
16 |
| user | preference | value |
|
|
|
17 |
| teacher1 | message_provider_mod_assign_assign_notification_enabled | none |
|
|
|
18 |
And the following "courses" exist:
|
|
|
19 |
| fullname | shortname | category |
|
|
|
20 |
| Course 1 | C1 | 0 |
|
|
|
21 |
And the following "course enrolments" exist:
|
|
|
22 |
| user | course | role |
|
|
|
23 |
| teacher1 | C1 | editingteacher |
|
|
|
24 |
| student1 | C1 | student |
|
|
|
25 |
And the following "activity" exists:
|
|
|
26 |
| activity | assign |
|
|
|
27 |
| course | C1 |
|
|
|
28 |
| name | Assign 1 |
|
|
|
29 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
30 |
| assignsubmission_file_enabled | 0 |
|
|
|
31 |
| submissiondrafts | 0 |
|
|
|
32 |
| sendnotifications | 1 |
|
|
|
33 |
And the following "mod_assign > submissions" exist:
|
|
|
34 |
| assign | user | onlinetext |
|
|
|
35 |
| Assign 1 | student1 | I'm the student1 submission |
|
|
|
36 |
|
|
|
37 |
Scenario: Teacher can choose to receive assignment notification submissions
|
|
|
38 |
Given I log in as "teacher1"
|
|
|
39 |
When I open the notification popover
|
|
|
40 |
Then I should see "You have no notifications"
|
|
|
41 |
# Update assignment submission to generate a notification
|
|
|
42 |
And I am on the "Assign 1" "assign activity" page logged in as student1
|
|
|
43 |
And the following "user preferences" exist:
|
|
|
44 |
| user | preference | value |
|
|
|
45 |
| teacher1 | message_provider_mod_assign_assign_notification_enabled | popup |
|
|
|
46 |
# This should generate a notification
|
|
|
47 |
And I press "Edit submission"
|
|
|
48 |
And I set the field "Online text" to "updated"
|
|
|
49 |
And I press "Save changes"
|
|
|
50 |
# Confirm that teacher received assignment submission notification
|
|
|
51 |
And I log in as "teacher1"
|
|
|
52 |
And I open the notification popover
|
|
|
53 |
Then I should see "Student 1 has updated their submission for assignment Assign 1"
|