Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_forum @forumreport @forumreport_summary
2
Feature: Message users in the summary report
3
  In order to encourage users to participate
4
  As a teacher
5
  I should be able to send messages to those who are not taking part
6
 
7
  Background:
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        | student1@example.com |
13
    And the following "courses" exist:
14
      | fullname | shortname |
15
      | Course 1 | C1        |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
    And the following "activities" exist:
22
      | activity | name   | course | idnumber |
23
      | forum    | forum1 | C1     | forum1   |
24
    And the following forum discussions exist in course "Course 1":
25
      | user     | forum  | name        | message         |
26
      | teacher1 | forum1 | discussion1 | t1 earliest     |
27
      | teacher1 | forum1 | discussion2 | t1 between      |
28
      | student1 | forum1 | discussion3 | s1 latest       |
29
    And the following forum replies exist in course "Course 1":
30
      | user     | forum  | discussion  | message         |
31
      | teacher1 | forum1 | discussion1 | t1 between      |
32
      | teacher1 | forum1 | discussion2 | t1 latest       |
33
      | student1 | forum1 | discussion1 | s1 earliest     |
34
 
35
  @javascript
36
  Scenario: Message some users
37
    Given the following "users" exist:
38
      | username | firstname | lastname | email                |
39
      | student3 | Student   | 3        | student3@example.com |
40
    And the following "course enrolments" exist:
41
      | user     | course | role    |
42
      | student3 | C1     | student |
43
    When I am on the forum1 "forum activity" page logged in as teacher1
44
    And I navigate to "Reports" in current page administration
45
    And I click on "Select 'Student 1'" "checkbox"
46
    And I click on "Select 'Student 3'" "checkbox"
47
    And I set the field "With selected users..." to "Send a message"
48
    And I set the field "bulk-message" to "blah blah"
49
    And I click on "Send message to 2 people" "button"
50
    Then I should see "Message sent to 2 people"
51
    And I log out
52
    And I log in as "student1"
53
    And I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
54
    And I log out
55
    And I log in as "student3"
56
    And I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
57
    And I log out
58
    And I log in as "student2"
59
    And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
60
 
61
  @javascript
62
  Scenario: Message all users
63
    When I am on the forum1 "forum activity" page logged in as teacher1
64
    And I navigate to "Reports" in current page administration
65
    And I click on "Select all" "checkbox"
66
    And I set the field "With selected users..." to "Send a message"
67
    Then I should see "Send message to 3 people"
68
 
69
  @javascript
70
  Scenario: Ensure no message options when messaging is disabled
71
    Given the following config values are set as admin:
72
      | messaging | 0 |
73
    When I am on the forum1 "forum activity" page logged in as teacher1
74
    And I navigate to "Reports" in current page administration
75
    Then I should not see "With selected users..."
76
    And I should not see "Select all"