[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/blocks/recent_activity/tests/behat/ -> structural_changes.feature (source)

   1  @block @block_recent_activity
   2  Feature: View structural changes in recent activity block
   3    In order to know when activities were changed
   4    As a user
   5    In need to see the structural changes in recent activity block
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category |
  10        | Course 1 | C1 | 0 |
  11      And the following "users" exist:
  12        | username    | firstname | lastname | email            |
  13        | teacher1    | Terry1    | Teacher1 | [email protected] |
  14        | assistant1  | Terry2    | Teacher2 | [email protected] |
  15        | student1    | Sam1      | Student1 | [email protected] |
  16        | student2    | Sam2      | Student2 | [email protected] |
  17        | student3    | Sam3      | Student3 | [email protected] |
  18      And the following "course enrolments" exist:
  19        | user        | course | role           |
  20        | teacher1    | C1     | editingteacher |
  21        | assistant1  | C1     | teacher        |
  22        | student1    | C1     | student        |
  23        | student2    | C1     | student        |
  24        | student3    | C1     | student        |
  25      And the following "groups" exist:
  26        | name | course | idnumber |
  27        | Group 1 | C1 | G1 |
  28        | Group 2 | C1 | G2 |
  29      And the following "groupings" exist:
  30        | name        | course | idnumber |
  31        | Grouping 1  | C1     | GG1      |
  32        | Grouping 2  | C1     | GG2      |
  33        | Grouping 3  | C1     | GG3      |
  34      And the following "group members" exist:
  35        | user        | group |
  36        | student1    | G1    |
  37        | student2    | G2    |
  38        | student3    | G1    |
  39        | student3    | G2    |
  40        | assistant1  | G1    |
  41      And the following "grouping groups" exist:
  42        | grouping | group |
  43        | GG1      | G1    |
  44        | GG2      | G2    |
  45        | GG3      | G1    |
  46        | GG3      | G2    |
  47  
  48    Scenario: Check that Added module information is displayed respecting view capability
  49      Given I log in as "admin"
  50      And I set the following administration settings values:
  51        | Enable conditional access | 1 |
  52      And I log out
  53      And I log in as "teacher1"
  54      And I follow "Course 1"
  55      And I turn editing mode on
  56      When I add a "Forum" to section "1" and I fill the form with:
  57        | name        | ForumVisibleGroups |
  58        | Description | No description     |
  59        | groupmode   | Visible groups     |
  60      And I add a "Forum" to section "1" and I fill the form with:
  61        | name        | ForumSeparateGroups |
  62        | Description | No description      |
  63        | groupmode   | Separate groups     |
  64      And I add a "Forum" to section "1" and I fill the form with:
  65        | name        | ForumHidden    |
  66        | Description | No description |
  67        | Visible     | 0              |
  68      And I add a "Forum" to section "1" and I fill the form with:
  69        | name        | ForumNoGroups  |
  70        | Description | No description |
  71        | groupmode   | No groups      |
  72      And I add a "Forum" to section "2" and I fill the form with:
  73        | name                | ForumVisibleGroupsG1 |
  74        | Description         | No description       |
  75        | groupmode           | Visible groups       |
  76        | Grouping            | Grouping 1           |
  77        | Access restrictions | Grouping: Grouping 1 |
  78      And I add a "Forum" to section "2" and I fill the form with:
  79        | name                | ForumSeparateGroupsG1 |
  80        | Description         | No description        |
  81        | groupmode           | Separate groups       |
  82        | Grouping            | Grouping 1            |
  83        | Access restrictions | Grouping: Grouping 1  |
  84      And I add a "Forum" to section "3" and I fill the form with:
  85        | name                | ForumVisibleGroupsG2 |
  86        | Description         | No description       |
  87        | groupmode           | Visible groups       |
  88        | Grouping            | Grouping 2           |
  89        | Access restrictions | Grouping: Grouping 2 |
  90      And I add a "Forum" to section "3" and I fill the form with:
  91        | name                | ForumSeparateGroupsG2 |
  92        | Description         | No description        |
  93        | groupmode           | Separate groups       |
  94        | Grouping            | Grouping 2            |
  95        | Access restrictions | Grouping: Grouping 2  |
  96      Then I should see "ForumVisibleGroups" in the "Recent activity" "block"
  97      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
  98      And I should see "ForumNoGroups" in the "Recent activity" "block"
  99      And I should see "ForumHidden" in the "Recent activity" "block"
 100      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 101      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 102      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 103      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 104      And I log out
 105      And I log in as "student1"
 106      And I follow "Course 1"
 107      And I should see "ForumVisibleGroups" in the "Recent activity" "block"
 108      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
 109      And I should see "ForumNoGroups" in the "Recent activity" "block"
 110      And I should not see "ForumHidden" in the "Recent activity" "block"
 111      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 112      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 113      And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 114      And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 115      And I log out
 116      And I log in as "student2"
 117      And I follow "Course 1"
 118      And I should see "ForumVisibleGroups" in the "Recent activity" "block"
 119      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
 120      And I should see "ForumNoGroups" in the "Recent activity" "block"
 121      And I should not see "ForumHidden" in the "Recent activity" "block"
 122      And I should not see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 123      And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 124      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 125      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 126      And I log out
 127      And I log in as "student3"
 128      And I follow "Course 1"
 129      And I should see "ForumVisibleGroups" in the "Recent activity" "block"
 130      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
 131      And I should see "ForumNoGroups" in the "Recent activity" "block"
 132      And I should not see "ForumHidden" in the "Recent activity" "block"
 133      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 134      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 135      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 136      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 137      And I log out
 138      # Teachers have capability to see all groups and hidden activities
 139      And I log in as "assistant1"
 140      And I follow "Course 1"
 141      And I should see "ForumHidden" in the "Recent activity" "block"
 142      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 143      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 144      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 145      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 146      And I log out
 147  
 148    Scenario: Updates and deletes in recent activity block
 149      When I log in as "teacher1"
 150      And I follow "Course 1"
 151      And I turn editing mode on
 152      And I add a "Forum" to section "1" and I fill the form with:
 153        | name        | ForumNew       |
 154        | Description | No description |
 155      Then I should see "Added Forum" in the "Recent activity" "block"
 156      And I should see "ForumNew" in the "Recent activity" "block"
 157      And I log out
 158      And I log in as "student1"
 159      And I follow "Course 1"
 160      And I should see "Added Forum" in the "Recent activity" "block"
 161      And I should see "ForumNew" in the "Recent activity" "block"
 162      And I log out
 163      # Update forum as a teacher
 164      And I log in as "teacher1"
 165      And I follow "Course 1"
 166      And I follow "ForumNew"
 167      And I click on "Edit settings" "link" in the "Administration" "block"
 168      And I set the following fields to these values:
 169        | name | ForumUpdated |
 170      And I press "Save and return to course"
 171      And I log out
 172      # Student 1 already saw that forum was created, now he can see that forum was updated
 173      And I log in as "student1"
 174      And I follow "Course 1"
 175      And I should not see "Added Forum" in the "Recent activity" "block"
 176      And I should not see "ForumNew" in the "Recent activity" "block"
 177      And I should see "Updated Forum" in the "Recent activity" "block"
 178      And I should see "ForumUpdated" in the "Recent activity" "block"
 179      And I log out
 180      # Student 2 has bigger interval and he can see one entry that forum was created but with the new name
 181      And I log in as "student2"
 182      And I follow "Course 1"
 183      And I should see "Added Forum" in the "Recent activity" "block"
 184      And I should not see "ForumNew" in the "Recent activity" "block"
 185      And I should not see "Updated Forum" in the "Recent activity" "block"
 186      And I should see "ForumUpdated" in the "Recent activity" "block"
 187      And I log out
 188      # Delete forum as a teacher
 189      And I log in as "teacher1"
 190      And I follow "Course 1"
 191      And I turn editing mode on
 192      And I delete "ForumUpdated" activity
 193      And I log out
 194      # Students 1 and 2 see that forum was deleted
 195      And I log in as "student1"
 196      And I follow "Course 1"
 197      And I should not see "Added Forum" in the "Recent activity" "block"
 198      And I should not see "ForumNew" in the "Recent activity" "block"
 199      And I should not see "Updated Forum" in the "Recent activity" "block"
 200      And I should not see "ForumUpdated" in the "Recent activity" "block"
 201      And I should see "Deleted Forum" in the "Recent activity" "block"
 202      And I log out
 203      # Student 3 never knew that forum was created, so he does not see anything
 204      And I log in as "student3"
 205      And I follow "Course 1"
 206      And I should not see "Added Forum" in the "Recent activity" "block"
 207      And I should not see "ForumNew" in the "Recent activity" "block"
 208      And I should not see "Updated Forum" in the "Recent activity" "block"
 209      And I should not see "ForumUpdated" in the "Recent activity" "block"
 210      And I should not see "Deleted Forum" in the "Recent activity" "block"
 211      And I log out


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1