[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/message/tests/behat/ -> message_participants.feature (source)

   1  @core @core_message
   2  Feature: An user can message course participants
   3    In order to communicate efficiently with my students
   4    As a teacher
   5    I need to message them all
   6  
   7    Scenario: An user can message multiple course participants including him/her self
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | teacher1@example.com |
  11        | student1 | Student | 1 | student1@example.com |
  12        | student2 | Student | 2 | student2@example.com |
  13        | student3 | Student | 3 | student3@example.com |
  14      And the following "courses" exist:
  15        | fullname | shortname | format |
  16        | Course 1 | C1 | topics |
  17      And the following "course enrolments" exist:
  18        | user | course | role |
  19        | teacher1 | C1 | editingteacher |
  20        | student1 | C1 | student |
  21      And I log in as "teacher1"
  22      And I follow "Course 1"
  23      And I follow "Participants"
  24      When I set the field with xpath "//tr[contains(normalize-space(.), 'Teacher 1')]//input[@type='checkbox']" to "1"
  25      And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 1')]//input[@type='checkbox']" to "1"
  26      And I set the field "With selected users..." to "Send a message"
  27      And I press "OK"
  28      And I set the following fields to these values:
  29        | messagebody | Here it is, the message content |
  30      And I press "Preview"
  31      And I press "Send message"
  32      And I follow "Messages" in the user menu
  33      And I select "Recent conversations" from the "Message navigation:" singleselect
  34      Then I should see "Here it is, the message content"
  35      And I should see "Student 1"
  36      And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element"
  37      And I should see "Here it is, the message content"
  38  
  39    Scenario: An user can message multiple course participants including him/her self
  40      Given the following "users" exist:
  41        | username | firstname | lastname | email |
  42        | teacher1 | Teacher | 1 | teacher1@example.com |
  43        | student1 | Student | 1 | student1@example.com |
  44        | student2 | Student | 2 | student2@example.com |
  45        | student3 | Student | 3 | student3@example.com |
  46      And the following "courses" exist:
  47        | fullname | shortname | format |
  48        | Course 1 | C1 | topics |
  49      And the following "course enrolments" exist:
  50        | user | course | role |
  51        | teacher1 | C1 | editingteacher |
  52        | student1 | C1 | student |
  53      And I log in as "teacher1"
  54      And I follow "Course 1"
  55      And I follow "Participants"
  56      When I set the field with xpath "//tr[contains(normalize-space(.), 'Teacher 1')]//input[@type='checkbox']" to "1"
  57      And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 1')]//input[@type='checkbox']" to "1"
  58      And I set the field "With selected users..." to "Send a message"
  59      And I press "OK"
  60      And I set the following fields to these values:
  61        | messagebody | Here it is, the message content |
  62      And I press "Send message"
  63      And I follow "Messages" in the user menu
  64      And I select "Recent conversations" from the "Message navigation:" singleselect
  65      Then I should see "Here it is, the message content"
  66      And I should see "Student 1"
  67      And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element"
  68      And I should see "Here it is, the message content"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1