[ Index ]

PHP Cross Reference of Unnamed Project

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 | teacher1@example.com |
  14        | assistant1  | Terry2    | Teacher2 | teacher2@example.com |
  15        | student1    | Sam1      | Student1 | student1@example.com |
  16        | student2    | Sam2      | Student2 | student2@example.com |
  17        | student3    | Sam3      | Student3 | student3@example.com |
  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 "teacher1"
  50      And I follow "Course 1"
  51      And I turn editing mode on
  52      When I add a "Forum" to section "1" and I fill the form with:
  53        | name        | ForumVisibleGroups |
  54        | Description | No description     |
  55        | groupmode   | Visible groups     |
  56      And I add a "Forum" to section "1" and I fill the form with:
  57        | name        | ForumSeparateGroups |
  58        | Description | No description      |
  59        | groupmode   | Separate groups     |
  60      And I add a "Forum" to section "1" and I fill the form with:
  61        | name        | ForumHidden    |
  62        | Description | No description |
  63        | Visible     | 0              |
  64      And I add a "Forum" to section "1" and I fill the form with:
  65        | name        | ForumNoGroups  |
  66        | Description | No description |
  67        | groupmode   | No groups      |
  68      And I add a "Forum" to section "2" and I fill the form with:
  69        | name                | ForumVisibleGroupsG1 |
  70        | Description         | No description       |
  71        | groupmode           | Visible groups       |
  72        | Grouping            | Grouping 1           |
  73        | Access restrictions | Grouping: Grouping 1 |
  74      And I add a "Forum" to section "2" and I fill the form with:
  75        | name                | ForumSeparateGroupsG1 |
  76        | Description         | No description        |
  77        | groupmode           | Separate groups       |
  78        | Grouping            | Grouping 1            |
  79        | Access restrictions | Grouping: Grouping 1  |
  80      And I add a "Forum" to section "3" and I fill the form with:
  81        | name                | ForumVisibleGroupsG2 |
  82        | Description         | No description       |
  83        | groupmode           | Visible groups       |
  84        | Grouping            | Grouping 2           |
  85        | Access restrictions | Grouping: Grouping 2 |
  86      And I add a "Forum" to section "3" and I fill the form with:
  87        | name                | ForumSeparateGroupsG2 |
  88        | Description         | No description        |
  89        | groupmode           | Separate groups       |
  90        | Grouping            | Grouping 2            |
  91        | Access restrictions | Grouping: Grouping 2  |
  92      Then I should see "ForumVisibleGroups" in the "Recent activity" "block"
  93      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
  94      And I should see "ForumNoGroups" in the "Recent activity" "block"
  95      And I should see "ForumHidden" in the "Recent activity" "block"
  96      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
  97      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
  98      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
  99      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 100      And I log out
 101      And I log in as "student1"
 102      And I follow "Course 1"
 103      And I should see "ForumVisibleGroups" in the "Recent activity" "block"
 104      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
 105      And I should see "ForumNoGroups" in the "Recent activity" "block"
 106      And I should not see "ForumHidden" in the "Recent activity" "block"
 107      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 108      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 109      And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 110      And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 111      And I log out
 112      And I log in as "student2"
 113      And I follow "Course 1"
 114      And I should see "ForumVisibleGroups" in the "Recent activity" "block"
 115      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
 116      And I should see "ForumNoGroups" in the "Recent activity" "block"
 117      And I should not see "ForumHidden" in the "Recent activity" "block"
 118      And I should not see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 119      And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 120      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 121      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 122      And I log out
 123      And I log in as "student3"
 124      And I follow "Course 1"
 125      And I should see "ForumVisibleGroups" in the "Recent activity" "block"
 126      And I should see "ForumSeparateGroups" in the "Recent activity" "block"
 127      And I should see "ForumNoGroups" in the "Recent activity" "block"
 128      And I should not see "ForumHidden" in the "Recent activity" "block"
 129      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 130      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 131      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 132      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 133      And I log out
 134      # Teachers have capability to see all groups and hidden activities
 135      And I log in as "assistant1"
 136      And I follow "Course 1"
 137      And I should see "ForumHidden" in the "Recent activity" "block"
 138      And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
 139      And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
 140      And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
 141      And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
 142      And I log out
 143  
 144    Scenario: Updates and deletes in recent activity block
 145      When I log in as "teacher1"
 146      And I follow "Course 1"
 147      And I turn editing mode on
 148      And I add a "Forum" to section "1" and I fill the form with:
 149        | name        | ForumNew       |
 150        | Description | No description |
 151      Then I should see "Added Forum" in the "Recent activity" "block"
 152      And I should see "ForumNew" in the "Recent activity" "block"
 153      And I log out
 154      And I log in as "student1"
 155      And I follow "Course 1"
 156      And I should see "Added Forum" in the "Recent activity" "block"
 157      And I should see "ForumNew" in the "Recent activity" "block"
 158      And I log out
 159      # Update forum as a teacher
 160      And I log in as "teacher1"
 161      And I follow "Course 1"
 162      And I follow "ForumNew"
 163      And I click on "Edit settings" "link" in the "Administration" "block"
 164      And I set the following fields to these values:
 165        | name | ForumUpdated |
 166      And I press "Save and return to course"
 167      And I log out
 168      # Student 1 already saw that forum was created, now he can see that forum was updated
 169      And I log in as "student1"
 170      And I follow "Course 1"
 171      And I should not see "Added Forum" in the "Recent activity" "block"
 172      And I should not see "ForumNew" in the "Recent activity" "block"
 173      And I should see "Updated Forum" in the "Recent activity" "block"
 174      And I should see "ForumUpdated" in the "Recent activity" "block"
 175      And I log out
 176      # Student 2 has bigger interval and he can see one entry that forum was created but with the new name
 177      And I log in as "student2"
 178      And I follow "Course 1"
 179      And I should see "Added Forum" in the "Recent activity" "block"
 180      And I should not see "ForumNew" in the "Recent activity" "block"
 181      And I should not see "Updated Forum" in the "Recent activity" "block"
 182      And I should see "ForumUpdated" in the "Recent activity" "block"
 183      And I log out
 184      # Delete forum as a teacher
 185      And I log in as "teacher1"
 186      And I follow "Course 1"
 187      And I turn editing mode on
 188      And I delete "ForumUpdated" activity
 189      And I log out
 190      # Students 1 and 2 see that forum was deleted
 191      And I log in as "student1"
 192      And I follow "Course 1"
 193      And I should not see "Added Forum" in the "Recent activity" "block"
 194      And I should not see "ForumNew" in the "Recent activity" "block"
 195      And I should not see "Updated Forum" in the "Recent activity" "block"
 196      And I should not see "ForumUpdated" in the "Recent activity" "block"
 197      And I should see "Deleted Forum" in the "Recent activity" "block"
 198      And I log out
 199      # Student 3 never knew that forum was created, so he does not see anything
 200      And I log in as "student3"
 201      And I follow "Course 1"
 202      And I should not see "Added Forum" in the "Recent activity" "block"
 203      And I should not see "ForumNew" in the "Recent activity" "block"
 204      And I should not see "Updated Forum" in the "Recent activity" "block"
 205      And I should not see "ForumUpdated" in the "Recent activity" "block"
 206      And I should not see "Deleted Forum" in the "Recent activity" "block"
 207      And I log out


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