Línea 32... |
Línea 32... |
32 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
32 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
33 |
When I click on "Edit" "link" in the "Test student enrolment" "table_row"
|
33 |
When I click on "Edit" "link" in the "Test student enrolment" "table_row"
|
34 |
Then I should see "Send course welcome message"
|
34 |
Then I should see "Send course welcome message"
|
35 |
And the field "Send course welcome message" matches value "From the course contact"
|
35 |
And the field "Send course welcome message" matches value "From the course contact"
|
36 |
And I should see "Custom welcome message"
|
36 |
And I should see "Custom welcome message"
|
37 |
And the field "Custom welcome message" matches value "Dear {$a->fullname}, you have successfully been enrolled to course {$a->coursename}"
|
37 |
And the field "Custom welcome message" matches value "Hi {$a->firstname}, you are enrolled in the course {$a->coursename}."
|
38 |
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:"
|
38 |
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:"
|
39 |
And I set the field "Send course welcome message" to "No"
|
39 |
And I set the field "Send course welcome message" to "No"
|
40 |
And I should not see "Custom welcome message"
|
40 |
And I should not see "Custom welcome message"
|
41 |
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:"
|
41 |
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 42... |
Línea 42... |
42 |
|
42 |
|
- |
|
43 |
@javascript
|
- |
|
44 |
Scenario: Teacher can edit the course welcome message
|
- |
|
45 |
Given I am on the "C1" "Enrolled users" page logged in as teacher
|
- |
|
46 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
- |
|
47 |
When I click on "Edit" "link" in the "Self enrolment" "table_row"
|
- |
|
48 |
Then I should see "Send course welcome message"
|
- |
|
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 "Self enrolment" "table_row"
|
- |
|
52 |
And I should see "Hello {$a->fullname}, welcome to the course {$a->coursename}"
|
- |
|
53 |
|
43 |
@javascript
|
54 |
@javascript
|
44 |
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
|
45 |
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
|
46 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
57 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
47 |
And I click on "Edit" "link" in the "Test student enrolment" "table_row"
|
58 |
And I click on "Edit" "link" in the "Test student enrolment" "table_row"
|
Línea 60... |
Línea 71... |
60 |
When I press "Enrol me"
|
71 |
When I press "Enrol me"
|
61 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
72 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
62 |
And I open the notification popover
|
73 |
And I open the notification popover
|
63 |
And I should see "Welcome to Course 1"
|
74 |
And I should see "Welcome to Course 1"
|
64 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
75 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
65 |
And I should see "Dear First User, you have successfully been enrolled to course Course 1"
|
76 |
And I should see "Hi First, you are enrolled in the course Course 1."
|
66 |
# Login as second user and check the notification.
|
77 |
# Login as second user and check the notification.
|
67 |
And I log in as "user2"
|
78 |
And I log in as "user2"
|
68 |
And I am on "Course 2" course homepage
|
79 |
And I am on "Course 2" course homepage
|
69 |
And I press "Enrol me"
|
80 |
And I press "Enrol me"
|
70 |
And I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
81 |
And I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
71 |
And I open the notification popover
|
82 |
And I open the notification popover
|
72 |
And I should see "Welcome to Course 2"
|
83 |
And I should see "Welcome to Course 2"
|
73 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
84 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
74 |
And I should see "Dear Second User, you have successfully been enrolled to course Course 2"
|
85 |
And I should see "Hi Second, you are enrolled in the course Course 2."
|
Línea 75... |
Línea 86... |
75 |
|
86 |
|
76 |
@javascript
|
87 |
@javascript
|
77 |
Scenario: Students should receive a welcome message if the setting is enabled - Custom message
|
88 |
Scenario: Students should receive a welcome message if the setting is enabled - Custom message
|
78 |
Given I am on the "C1" "Enrolled users" page logged in as manager
|
89 |
Given I am on the "C1" "Enrolled users" page logged in as manager
|
79 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
90 |
And I set the field "Participants tertiary navigation" to "Enrolment methods"
|
80 |
And I click on "Edit" "link" in the "Test student enrolment" "table_row"
|
91 |
And I click on "Edit" "link" in the "Test student enrolment" "table_row"
|
81 |
And I set the field "Custom welcome message" to multiline:
|
92 |
And I set the field "Custom welcome message" to multiline:
|
82 |
"""
|
93 |
"""
|
83 |
Dear {$a->fullname}, you have successfully been enrolled to course {$a->coursename}.
|
94 |
Dear {$a->fullname}, you are enrolled in the course {$a->coursename}.
|
84 |
Your email address: {$a->email}
|
95 |
Your email address: {$a->email}
|
85 |
Your first name: {$a->firstname}
|
96 |
Your first name: {$a->firstname}
|
86 |
Your last name: {$a->lastname}
|
97 |
Your last name: {$a->lastname}
|
87 |
Your course role: {$a->courserole}
|
98 |
Your course role: {$a->courserole}
|
Línea 93... |
Línea 104... |
93 |
When I press "Enrol me"
|
104 |
When I press "Enrol me"
|
94 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
105 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
95 |
And I open the notification popover
|
106 |
And I open the notification popover
|
96 |
And I should see "Welcome to Course 1"
|
107 |
And I should see "Welcome to Course 1"
|
97 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
108 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
98 |
And I should see "Dear First User, you have successfully been enrolled to course Course 1"
|
109 |
And I should see "Dear First User, you are enrolled in the course Course 1."
|
99 |
And I should see "Your email address: first@example.com"
|
110 |
And I should see "Your email address: first@example.com"
|
100 |
And I should see "Your first name: First"
|
111 |
And I should see "Your first name: First"
|
101 |
And I should see "Your last name: User"
|
112 |
And I should see "Your last name: User"
|
102 |
And I should see "Your course role: student"
|
113 |
And I should see "Your course role: Student"
|
103 |
# Login as second user and check the notification.
|
114 |
# Login as second user and check the notification.
|
104 |
And I log in as "user2"
|
115 |
And I log in as "user2"
|
105 |
And I am on "Course 1" course homepage
|
116 |
And I am on "Course 1" course homepage
|
106 |
And I press "Enrol me"
|
117 |
And I press "Enrol me"
|
107 |
And I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
118 |
And I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
108 |
And I open the notification popover
|
119 |
And I open the notification popover
|
109 |
And I should see "Welcome to Course 1"
|
120 |
And I should see "Welcome to Course 1"
|
110 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
121 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
111 |
And I should see "Dear Second User, you have successfully been enrolled to course Course 1"
|
122 |
And I should see "Dear Second User, you are enrolled in the course Course 1."
|
112 |
And I should see "Your email address: second@example.com"
|
123 |
And I should see "Your email address: second@example.com"
|
113 |
And I should see "Your first name: Second"
|
124 |
And I should see "Your first name: Second"
|
114 |
And I should see "Your last name: User"
|
125 |
And I should see "Your last name: User"
|
115 |
And I should see "Your course role: student"
|
126 |
And I should see "Your course role: Student"
|