Línea 27... |
Línea 27... |
27 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
27 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
28 |
When I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
28 |
When I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
29 |
Then I should see "Send course welcome message"
|
29 |
Then I should see "Send course welcome message"
|
30 |
And the field "Send course welcome message" matches value "From the course contact"
|
30 |
And the field "Send course welcome message" matches value "From the course contact"
|
31 |
And I should see "Custom welcome message"
|
31 |
And I should see "Custom welcome message"
|
32 |
And the field "Custom welcome message" matches value "Dear {$a->fullname}, you have successfully been enrolled to course {$a->coursename}"
|
32 |
And the field "Custom welcome message" matches value "Hi {$a->firstname}, you are enrolled in the course {$a->coursename}."
|
33 |
And I should see "Accepted formats: Plain text or Moodle-auto format. HTML tags and multi-lang tags are also accepted, as well as the following placeholders:"
|
33 |
And I should see "Accepted formats: Plain text or Moodle-auto format. HTML tags and multi-lang tags are also accepted, as well as the following placeholders:"
|
34 |
And I set the field "Send course welcome message" to "No"
|
34 |
And I set the field "Send course welcome message" to "No"
|
35 |
And I should not see "Custom welcome message"
|
35 |
And I should not see "Custom welcome message"
|
36 |
And I should not see "Accepted formats: Plain text or Moodle-auto format. HTML tags and multi-lang tags are also accepted, as well as the following placeholders:"
|
36 |
And I should not see "Accepted formats: Plain text or Moodle-auto format. HTML tags and multi-lang tags are also accepted, as well as the following placeholders:"
|
Línea 37... |
Línea 37... |
37 |
|
37 |
|
- |
|
38 |
@javascript
|
- |
|
39 |
Scenario: Teacher can edit the course welcome message
|
- |
|
40 |
Given I am on the "C1" "Enrolled users" page logged in as teacher
|
- |
|
41 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
- |
|
42 |
When I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
- |
|
43 |
Then I should see "Send course welcome message"
|
- |
|
44 |
And I should not see "Enable manual enrolments"
|
- |
|
45 |
And I should not see "Default role"
|
- |
|
46 |
And I should not see "Default enrolment duration"
|
- |
|
47 |
And I should not see "Notify before enrolment expires"
|
- |
|
48 |
And I should not see "Notification threshold"
|
- |
|
49 |
And I set the field "Custom welcome message" to "Hello {$a->fullname}, welcome to the course {$a->coursename}"
|
- |
|
50 |
And I press "Save changes"
|
- |
|
51 |
And I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
- |
|
52 |
And I should see "Hello {$a->fullname}, welcome to the course {$a->coursename}"
|
- |
|
53 |
|
38 |
@javascript
|
54 |
@javascript
|
39 |
Scenario: Student should not receive a welcome message if the setting is disabled
|
55 |
Scenario: Student should not receive a welcome message if the setting is disabled
|
40 |
Given I am on the "C1" "Enrolled users" page logged in as manager
|
56 |
Given I am on the "C1" "Enrolled users" page logged in as manager
|
41 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
57 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
42 |
And I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
58 |
And I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
Línea 69... |
Línea 85... |
69 |
When I am on the "C1" "course" page logged in as user1
|
85 |
When I am on the "C1" "course" page logged in as user1
|
70 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
86 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
71 |
And I open the notification popover
|
87 |
And I open the notification popover
|
72 |
And I should see "Welcome to Course 1"
|
88 |
And I should see "Welcome to Course 1"
|
73 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
89 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
74 |
And I should see "Dear First User, you have successfully been enrolled to course Course 1"
|
90 |
And I should see "Hi First, you are enrolled in the course Course 1."
|
75 |
# Login as second user and check the notification.
|
91 |
# Login as second user and check the notification.
|
76 |
And I am on the "C1" "course" page logged in as user2
|
92 |
And I am on the "C1" "course" page logged in as user2
|
77 |
And I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
93 |
And I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
78 |
And I open the notification popover
|
94 |
And I open the notification popover
|
79 |
And I should see "Welcome to Course 2"
|
95 |
And I should see "Welcome to Course 2"
|
80 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
96 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
81 |
And I should see "Dear Second User, you have successfully been enrolled to course Course 2"
|
97 |
And I should see "Hi Second, you are enrolled in the course Course 2."
|
Línea 82... |
Línea 98... |
82 |
|
98 |
|
83 |
@javascript
|
99 |
@javascript
|
84 |
Scenario: Students should receive a welcome message if the setting is enabled - Custom message
|
100 |
Scenario: Students should receive a welcome message if the setting is enabled - Custom message
|
85 |
Given I am on the "C1" "Enrolled users" page logged in as manager
|
101 |
Given I am on the "C1" "Enrolled users" page logged in as manager
|
86 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
102 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
87 |
And I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
103 |
And I click on "Edit" "link" in the "Manual enrolments" "table_row"
|
88 |
And I set the field "Custom welcome message" to multiline:
|
104 |
And I set the field "Custom welcome message" to multiline:
|
89 |
"""
|
105 |
"""
|
90 |
Dear {$a->fullname}, you have successfully been enrolled to course {$a->coursename}.
|
106 |
Dear {$a->fullname}, you are enrolled in the course {$a->coursename}.
|
91 |
Your email address: {$a->email}
|
107 |
Your email address: {$a->email}
|
92 |
Your first name: {$a->firstname}
|
108 |
Your first name: {$a->firstname}
|
93 |
Your last name: {$a->lastname}
|
109 |
Your last name: {$a->lastname}
|
94 |
Your course role: {$a->courserole}
|
110 |
Your course role: {$a->courserole}
|
Línea 103... |
Línea 119... |
103 |
When I am on the "C1" "course" page logged in as user1
|
119 |
When I am on the "C1" "course" page logged in as user1
|
104 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
120 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
105 |
And I open the notification popover
|
121 |
And I open the notification popover
|
106 |
And I should see "Welcome to Course 1"
|
122 |
And I should see "Welcome to Course 1"
|
107 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
123 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
108 |
And I should see "Dear First User, you have successfully been enrolled to course Course 1"
|
124 |
And I should see "Dear First User, you are enrolled in the course Course 1."
|
109 |
And I should see "Your email address: first@example.com"
|
125 |
And I should see "Your email address: first@example.com"
|
110 |
And I should see "Your first name: First"
|
126 |
And I should see "Your first name: First"
|
111 |
And I should see "Your last name: User"
|
127 |
And I should see "Your last name: User"
|
112 |
And I should see "Your course role: student"
|
128 |
And I should see "Your course role: Student"
|
113 |
# Login as second user and check the notification.
|
129 |
# Login as second user and check the notification.
|
114 |
When I am on the "C1" "course" page logged in as user2
|
130 |
When I am on the "C1" "course" page logged in as user2
|
115 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
131 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
116 |
And I open the notification popover
|
132 |
And I open the notification popover
|
117 |
And I should see "Welcome to Course 1"
|
133 |
And I should see "Welcome to Course 1"
|
118 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
134 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
119 |
And I should see "Dear Second User, you have successfully been enrolled to course Course 1"
|
135 |
And I should see "Dear Second User, you are enrolled in the course Course 1."
|
120 |
And I should see "Your email address: second@example.com"
|
136 |
And I should see "Your email address: second@example.com"
|
121 |
And I should see "Your first name: Second"
|
137 |
And I should see "Your first name: Second"
|
122 |
And I should see "Your last name: User"
|
138 |
And I should see "Your last name: User"
|
123 |
And I should see "Your course role: student"
|
139 |
And I should see "Your course role: Student"
|