Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_forum
2
Feature: A user can control their default discussion subscription settings
3
  In order to automatically subscribe to discussions
4
  As a user
5
  I can choose my default subscription preference
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                   | autosubscribe |
10
      | student1 | Student   | One      | student.one@example.com | 1             |
11
      | student2 | Student   | Two      | student.one@example.com | 0             |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 1 | C1 | 0 |
15
    And the following "course enrolments" exist:
16
      | user | course | role |
17
      | student1 | C1 | student |
18
      | student2 | C1 | student |
19
    And the following "activities" exist:
20
      | activity   | name                   | course | idnumber | type    |
21
      | forum      | Test forum name        | C1     | forump1  | general |
22
    And I am on the "Test forum name" "forum activity editing" page logged in as admin
23
    And I set the following fields to these values:
24
      | Subscription mode | Optional subscription |
25
    And I press "Save and return to course"
26
 
27
  Scenario: Creating a new discussion in an optional forum follows user preferences
28
    Given I am on the "Test forum name" "forum activity" page logged in as student1
29
    When I click on "Add discussion topic" "link"
30
    And I click on "Advanced" "button"
31
    Then "input[name=discussionsubscribe]:checked" "css_element" should exist
32
    And I am on the "Test forum name" "forum activity" page logged in as student2
33
    And I click on "Add discussion topic" "link"
34
    And I click on "Advanced" "button"
35
    And "input[name=discussionsubscribe]:not(:checked)" "css_element" should exist
36
 
37
  Scenario: Replying to an existing discussion in an optional forum follows user preferences
38
    Given the following forum discussions exist in course "Course 1":
39
      | user  | forum           | name              | message           |
40
      | admin | Test forum name | Test post subject | Test post message |
41
    And I am on the "Test forum name" "forum activity" page logged in as student1
42
    And I follow "Test post subject"
43
    When I follow "Reply"
44
    Then "input[name=discussionsubscribe]:checked" "css_element" should exist
45
    And I am on the "Test forum name" "forum activity" page logged in as student2
46
    And I follow "Test post subject"
47
    And I follow "Reply"
48
    And "input[name=discussionsubscribe]:not(:checked)" "css_element" should exist
49
 
50
  Scenario: Creating a new discussion in an automatic forum follows forum subscription
51
    Given I am on the "Test forum name" "forum activity editing" page logged in as admin
52
    And I set the following fields to these values:
53
      | Subscription mode | Auto subscription |
54
    And I press "Save and return to course"
55
    And I am on the "Test forum name" "forum activity" page logged in as student1
56
    When I click on "Add discussion topic" "link"
57
    And I click on "Advanced" "button"
58
    Then "input[name=discussionsubscribe]:checked" "css_element" should exist
59
    And I am on the "Test forum name" "forum activity" page logged in as student2
60
    And I click on "Add discussion topic" "link"
61
    And I click on "Advanced" "button"
62
    And "input[name=discussionsubscribe]:checked" "css_element" should exist
63
 
64
  Scenario: Replying to an existing discussion in an automatic forum follows forum subscription
65
    Given the following forum discussions exist in course "Course 1":
66
      | user  | forum           | name              | message           |
67
      | admin | Test forum name | Test post subject | Test post message |
68
    And I am on the "Test forum name" "forum activity editing" page logged in as admin
69
    And I set the following fields to these values:
70
      | Subscription mode | Optional subscription |
71
    And I press "Save and return to course"
72
    And I am on the "Test forum name" "forum activity" page logged in as student1
73
    And I follow "Test post subject"
74
    When I follow "Reply"
75
    Then "input[name=discussionsubscribe]:checked" "css_element" should exist
76
    And I am on the "Test forum name" "forum activity" page logged in as student2
77
    And I follow "Test post subject"
78
    And I follow "Reply"
79
    And "input[name=discussionsubscribe]:not(:checked)" "css_element" should exist
80
 
81
  @javascript
82
  Scenario: Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences
83
    Given the following forum discussions exist in course "Course 1":
84
      | user  | forum           | name              | message           |
85
      | admin | Test forum name | Test post subject | Test post message |
86
    And I am on the "Test forum name" "forum activity editing" page logged in as admin
87
    And I set the following fields to these values:
88
      | Subscription mode | Auto subscription |
89
    And I press "Save and return to course"
90
    And I am on the "Test forum name" "forum activity" page logged in as student1
91
    And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row"
92
    And I follow "Test post subject"
93
    When I follow "Reply"
94
    And I click on "Advanced" "button"
95
    And "input[name=discussionsubscribe][checked]" "css_element" should exist
96
    And I am on the "Test forum name" "forum activity" page logged in as student2
97
    And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row"
98
    And I follow "Test post subject"
99
    And I follow "Reply"
100
    And I click on "Advanced" "button"
101
    And "input[name=discussionsubscribe]:not([checked])" "css_element" should exist