AutorÃa | Ultima modificación | Ver Log |
@block @block_messageteacher @block_messageteacher_ajaxform @javascriptFeature: AJAX message formIn order to message my teacher easilyAs a studentI need to access a messaging form without leaving the current pageBackground:Given the following "users" exist:| username | email | firstname | lastname || teststudent | teststudent@example.com | Test | Student || testteacher1 | testteacher1@example.com | Test | Teacher1 |And the following "categories" exist:| name | category | idnumber || Category 1 | 0 | CAT1 |And the following "courses" exist:| fullname | shortname | category | format || Course 1 | course1 | CAT1 | topics |And the following "course enrolments" exist:| user | course | role | enrol || teststudent | course1 | student | manual || testteacher1 | course1 | editingteacher | manual |And the following config values are set as admin:| roles | 3 | block_messageteacher |And the following "blocks" exist:| blockname | contextlevel | reference || messageteacher | Course | course1 |Scenario: User accesses formGiven I log in as "teststudent"And I am on "Course 1" course homepageWhen I follow "Test Teacher1"Then "Enter your message for Test Teacher1" "fieldset" should existAnd "Message text" "field" should existAnd "Send" "button" should exist in the "Message My Teacher" "dialogue"Scenario: Student sends a message and returns to the pageGiven I log in as "teststudent"And I am on "Course 1" course homepageAnd I follow "Test Teacher1"And I set the following fields to these values:| Message text | Test Message |When I click on "Send" "button" in the "Message My Teacher" "dialogue"Then I should see "Message Sent!"And "Enter your message for Test Teacher1" "fieldset" should not existAnd I click on "body" "css_element"Then I should see "Course 1" in the "h1" "css_element"Scenario: Teacher recieves a message sent from the custom formGiven I log in as "teststudent"And I am on "Course 1" course homepageAnd I follow "Test Teacher1"And I set the following fields to these values:| Message text | Test Message |And I click on "Send" "button" in the "Message My Teacher" "dialogue"And I click on "body" "css_element"And I log outAnd I log in as "testteacher1"When I select "Test Student" user in messagingThen I should see "Test Message"Scenario: Teacher recieves a message sent from the custom form and appendurl is enabledGiven I log in as "admin"And I set the following administration settings values:| Append Referring URL | 1 |And I log outAnd I log in as "teststudent"And I am on "Course 1" course homepageAnd I follow "Test Teacher1"And I set the following fields to these values:| Message text | Test Message |And I click on "Send" "button" in the "Message My Teacher" "dialogue"And I click on "body" "css_element"And I log outAnd I log in as "testteacher1"When I select "Test Student" user in messagingThen I should see "Test Message"And I should see "/course/view.php?id="