Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_forum @block_recent_activity
2
Feature: Users can see the relevant recent forum posts from the recent activity block
3
  In order to quickly see the updates from forums in my course
4
  As a user
5
  I need to be able to see the recent forum posts in the recent activity block
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname  | lastname  | email                 |
10
      | student1 | Student    | 1         | student1@example.com  |
11
      | student2 | Student    | 2         | student2@example.com  |
12
      | teacher1 | Teacher    | 1         | teacher1@example.com  |
13
    And the following "courses" exist:
14
      | fullname | shortname  | category  |
15
      | Course 1 | C1         | 0         |
16
    And the following "course enrolments" exist:
17
      | user      | course  | role            |
18
      | student1  | C1      | student         |
19
      | student2  | C1      | student         |
20
      | teacher1  | C1      | editingteacher  |
21
    And the following "groups" exist:
22
      | name    | course  | idnumber  |
23
      | Group 1 | C1      | G1        |
24
      | Group 2 | C1      | G2        |
25
    And the following "group members" exist:
26
      | user     | group  |
27
      | student1 | G1     |
28
      | student2 | G2     |
29
      | teacher1 | G1     |
30
      | teacher1 | G2     |
31
    And the following "activities" exist:
32
      | activity   | name                   | course  | idnumber  | type    | groupmode | visible |
33
      | forum      | Separate groups forum  | C1      | forum1    | general | 1         | 1       |
34
      | forum      | Visible groups forum   | C1      | forum2    | general | 2         | 1       |
35
      | forum      | Standard forum         | C1      | forum3    | general | 0         | 1       |
36
      | forum      | Hidden forum           | C1      | forum4    | general | 0         | 0       |
37
      | forum      | Q&A forum              | C1      | forum5    | qanda   | 0         | 1       |
38
    And the following "blocks" exist:
39
      | blockname       | contextlevel | reference | pagetypepattern | defaultregion |
40
      | recent_activity | Course       | C1        | course-view-*   | side-pre      |
41
    And I log in as "teacher1"
42
 
43
  Scenario: Recent forum activity with separate group discussion
44
    Given the following "mod_forum > discussions" exist:
45
      | user     | forum  | name                        | message              | group |
46
      | teacher1 | forum1 | Group 1 separate discussion | Group 1 members only | G1    |
47
    When I am on the "Course 1" course page logged in as student1
48
    Then I should see "Group 1 separate discussion" in the "Recent activity" "block"
49
    And I am on the "Course 1" course page logged in as student2
50
    And I should not see "Group 1 separate discussion" in the "Recent activity" "block"
51
 
52
  Scenario: Recent forum activity with visible groups discussion
53
    Given the following "mod_forum > discussions" exist:
54
      | user     | forum  | name                       | message                      | group |
55
      | teacher1 | forum2 | Group 1 visible discussion | Not just for group 1 members | G1    |
56
    When I am on the "Course 1" course page logged in as student1
57
    Then I should see "Group 1 visible discussion" in the "Recent activity" "block"
58
    And I am on the "Course 1" course page logged in as student2
59
    And I should see "Group 1 visible discussion" in the "Recent activity" "block"
60
 
61
  Scenario: Recent forum activity with recent post as a private reply
62
    Given the following "mod_forum > discussions" exist:
63
      | user     | forum  | name                      | message                              |
64
      | teacher1 | forum3 | Standard forum discussion | Discuss anything under the sun here! |
65
    And the following "mod_forum > posts" exist:
66
      | user     | parentsubject             | subject                 | message                 | privatereplyto |
67
      | teacher1 | Standard forum discussion | Teacher's private reply | This is a private reply | 1              |
68
    And I am on "Course 1" course homepage
69
    And I should see "Standard forum discussion" in the "Recent activity" "block"
70
    And I should see "Teacher's private reply" in the "Recent activity" "block"
71
    When I am on the "Course 1" course page logged in as student1
72
    Then I should see "Standard forum discussion" in the "Recent activity" "block"
73
    But I should not see "Teacher's private reply" in the "Recent activity" "block"
74
 
75
  Scenario: Recent forum activity with recent post in a hidden forum
76
    Given the following "mod_forum > discussions" exist:
77
      | user     | forum  | name              | message           |
78
      | teacher1 | forum4 | Hidden discussion | Should be hidden! |
79
    And I am on "Course 1" course homepage
80
    And I should see "Hidden discussion" in the "Recent activity" "block"
81
    When I am on the "Course 1" course page logged in as student1
82
    Then I should not see "Hidden discussion" in the "Recent activity" "block"
83
 
84
  Scenario: Recent forum activity with question and answer forum
85
    Given the following "mod_forum > discussions" exist:
86
      | user     | forum  | name                   | message                                   |
87
      | teacher1 | forum5 | The egg vs the chicken | Which came first? The egg or the chicken? |
88
    And the following "mod_forum > posts" exist:
89
      | user     | parentsubject             | subject            | message  |
90
      | student1 | The egg vs the chicken    | Student 1's answer | The egg! |
91
    And I am on the "Course 1" course page logged in as student1
92
    And I should see "The egg vs the chicken" in the "Recent activity" "block"
93
    And I should see "Student 1's answer" in the "Recent activity" "block"
94
    And the following config values are set as admin:
95
      | maxeditingtime | 1 |
96
    When I am on the "Course 1" course page logged in as student2
97
    Then I should see "The egg vs the chicken" in the "Recent activity" "block"
98
    But I should not see "Student 1's answer" in the "Recent activity" "block"
99
    And I reply "The egg vs the chicken" post from "Q&A forum" forum with:
100
      | Subject | Student 2's answer  |
101
      | Message | The chicken, duh!   |
102
    And I wait "2" seconds
103
    And I am on "Course 1" course homepage
104
    And I should see "Student 1's answer" in the "Recent activity" "block"
105
    And I should see "Student 2's answer" in the "Recent activity" "block"
106
 
107
  Scenario: Recent forum activity with timed discussion
108
    Given the following "mod_forum > discussions" exist:
109
      | user     | forum  | name             | message                                           | timeend              |
110
      | teacher1 | forum3 | Timed discussion | Discuss anything under the sun here... no more!!! | ##1 Jan 2020 08:00## |
111
    And I am on "Course 1" course homepage
112
    And I should see "Timed discussion" in the "Recent activity" "block"
113
    When I am on the "Course 1" course page logged in as student1
114
    Then I should not see "Timed discussion" in the "Recent activity" "block"