mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +02:00
MDL-51257 messages: Improve message form.
- Add sudmit button - Add formchangechecker - Update behat tests
This commit is contained in:
parent
c18acb8997
commit
ea3aa9f9a0
3 changed files with 43 additions and 3 deletions
|
@ -35,3 +35,34 @@ Feature: An user can message course participants
|
||||||
And I should see "Student 1"
|
And I should see "Student 1"
|
||||||
And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element"
|
And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element"
|
||||||
And I should see "Here it is, the message content"
|
And I should see "Here it is, the message content"
|
||||||
|
|
||||||
|
Scenario: An user can message multiple course participants including him/her self
|
||||||
|
Given the following "users" exist:
|
||||||
|
| username | firstname | lastname | email |
|
||||||
|
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||||
|
| student1 | Student | 1 | student1@example.com |
|
||||||
|
| student2 | Student | 2 | student2@example.com |
|
||||||
|
| student3 | Student | 3 | student3@example.com |
|
||||||
|
And the following "courses" exist:
|
||||||
|
| fullname | shortname | format |
|
||||||
|
| Course 1 | C1 | topics |
|
||||||
|
And the following "course enrolments" exist:
|
||||||
|
| user | course | role |
|
||||||
|
| teacher1 | C1 | editingteacher |
|
||||||
|
| student1 | C1 | student |
|
||||||
|
And I log in as "teacher1"
|
||||||
|
And I follow "Course 1"
|
||||||
|
And I follow "Participants"
|
||||||
|
When I set the field with xpath "//tr[contains(normalize-space(.), 'Teacher 1')]//input[@type='checkbox']" to "1"
|
||||||
|
And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 1')]//input[@type='checkbox']" to "1"
|
||||||
|
And I set the field "With selected users..." to "Send a message"
|
||||||
|
And I press "OK"
|
||||||
|
And I set the following fields to these values:
|
||||||
|
| messagebody | Here it is, the message content |
|
||||||
|
And I press "Send message"
|
||||||
|
And I follow "Messages" in the user menu
|
||||||
|
And I select "Recent conversations" from the "Message navigation:" singleselect
|
||||||
|
Then I should see "Here it is, the message content"
|
||||||
|
And I should see "Student 1"
|
||||||
|
And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element"
|
||||||
|
And I should see "Here it is, the message content"
|
|
@ -24,7 +24,10 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr><td align="center" colspan="2"><input type="submit" name="preview" value="<?php print_string('preview'); ?>" /></td></tr>
|
<tr><td align="center" colspan="2">
|
||||||
|
<input type="submit" name="send" value="<?php print_string('sendmessage', 'message'); ?>" />
|
||||||
|
<input type="submit" name="preview" value="<?php print_string('preview'); ?>" />
|
||||||
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php echo $OUTPUT->box_end(); ?>
|
<?php echo $OUTPUT->box_end(); ?>
|
||||||
<table align="center"><tr><th colspan="4" scope="row"><?php print_string('currentlyselectedusers'); ?></th></tr>
|
<table align="center"><tr><th colspan="4" scope="row"><?php print_string('currentlyselectedusers'); ?></th></tr>
|
||||||
|
|
|
@ -194,6 +194,12 @@ if (count($SESSION->emailto[$id])) {
|
||||||
require("message.html");
|
require("message.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$PAGE->requires->yui_module('moodle-core-formchangechecker',
|
||||||
|
'M.core_formchangechecker.init',
|
||||||
|
array(array(
|
||||||
|
'formid' => 'theform'
|
||||||
|
))
|
||||||
|
);
|
||||||
|
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
|
||||||
|
|
||||||
echo $OUTPUT->footer();
|
echo $OUTPUT->footer();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue