[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/forum/tests/behat/ -> post_to_multiple_groups.feature (source)

   1  @mod @mod_forum
   2  Feature: A user with access to multiple groups should be able to post a copy of a message to all the groups they have access to
   3    In order to post to all groups a user has access to
   4    As a user
   5    I need to have the option to post a copy of a message to all groups
   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 | student2@example.com |
  13        | student3 | Student | 3 | student3@example.com |
  14      And the following "courses" exist:
  15        | fullname | shortname | category |
  16        | Course 1 | C1 | 0 |
  17        | Course 2 | C2 | 0 |
  18      And the following "course enrolments" exist:
  19        | user | course | role |
  20        | teacher1 | C1 | editingteacher |
  21        | teacher1 | C2 | editingteacher |
  22        | student1 | C1 | student |
  23        | student1 | C2 | student |
  24        | student2 | C1 | student |
  25        | student2 | C2 | student |
  26        | student3 | C1 | student |
  27        | student3 | C2 | student |
  28      And the following "groups" exist:
  29        | name | course | idnumber |
  30        | Group A | C1 | C1G1 |
  31        | Group B | C1 | C1G2 |
  32        | Group C | C1 | C1G3 |
  33        | Group A | C2 | C2G1 |
  34        | Group B | C2 | C2G2 |
  35        | Group C | C2 | C2G3 |
  36      And the following "groupings" exist:
  37        | name | course | idnumber |
  38        | G1 | C2 | G1 |
  39      And the following "group members" exist:
  40        | user | group |
  41        | teacher1 | C1G1 |
  42        | teacher1 | C1G2 |
  43        | teacher1 | C1G3 |
  44        | teacher1 | C2G1 |
  45        | teacher1 | C2G1 |
  46        | student1 | C1G1 |
  47        | student1 | C2G1 |
  48        | student1 | C2G2 |
  49        | student2 | C1G1 |
  50        | student2 | C1G2 |
  51        | student3 | C1G1 |
  52        | student3 | C1G2 |
  53        | student3 | C1G3 |
  54      And the following "grouping groups" exist:
  55        | grouping | group |
  56        | G1       | C2G1 |
  57        | G1       | C2G2 |
  58      And the following "activities" exist:
  59        | activity   | name                   | intro             | course | idnumber     | groupmode | grouping |
  60        | forum      | No group forum         | Test forum name   | C1     | forum        | 0         |          |
  61        | forum      | Separate group forum   | Test forum name   | C1     | forum        | 1         |          |
  62        | forum      | Visible group forum    | Test forum name   | C1     | forum        | 2         |          |
  63        | forum      | Groupings forum        | Test forum name   | C2     | forum        | 1         | G1       |
  64  
  65    Scenario: Teacher is able to post a copy of a message to all groups in a separate group forum
  66      Given I log in as "teacher1"
  67      And I follow "Course 1"
  68      And I add a new discussion to "Separate group forum" forum with:
  69        | Subject | Discussion 1 |
  70        | Message | test |
  71        | Post a copy to all groups | 1 |
  72      And I log out
  73      And I log in as "student1"
  74      And I follow "Course 1"
  75      When I follow "Separate group forum"
  76      Then I should see "Discussion 1"
  77      And I log out
  78      And I log in as "student2"
  79      And I follow "Course 1"
  80      And I follow "Separate group forum"
  81      And I should see "Discussion 1"
  82      And I log out
  83      And I log in as "student3"
  84      And I follow "Course 1"
  85      And I follow "Separate group forum"
  86      And I should see "Discussion 1"
  87  
  88    Scenario: Teacher is able to post a copy of a message to all groups in a visible group forum
  89      Given I log in as "teacher1"
  90      And I follow "Course 1"
  91      And I add a new discussion to "Visible group forum" forum with:
  92        | Subject | Discussion 1 |
  93        | Message | test |
  94        | Post a copy to all groups | 1 |
  95      And I log out
  96      And I log in as "student1"
  97      And I follow "Course 1"
  98      When I follow "Visible group forum"
  99      Then I should see "Discussion 1"
 100      And I log out
 101      And I log in as "student2"
 102      And I follow "Course 1"
 103      And I follow "Visible group forum"
 104      And I should see "Discussion 1"
 105      And I log out
 106      And I log in as "student3"
 107      And I follow "Course 1"
 108      And I follow "Visible group forum"
 109      And I should see "Discussion 1"
 110  
 111    Scenario: Teacher is unable to post a copy of a message to all groups in a no group forum
 112      Given I log in as "teacher1"
 113      And I follow "Course 1"
 114      And I follow "No group forum"
 115      And I press "Add a new discussion topic"
 116      Then I should not see "Post a copy to all groups"
 117  
 118    Scenario: Posts to all groups that have groupings should only display within the grouping and not to other groups
 119      Given I log in as "teacher1"
 120      And I follow "Course 2"
 121      And I add a new discussion to "Groupings forum" forum with:
 122        | Subject | Discussion 1 |
 123        | Message | test |
 124        | Post a copy to all groups | 1 |
 125      And I log out
 126      And I log in as "student1"
 127      And I follow "Course 2"
 128      When I follow "Groupings forum"
 129      Then I should see "Discussion 1"
 130      And I log out
 131      And I log in as "student2"
 132      And I follow "Course 2"
 133      And I follow "Groupings forum"
 134      And I should not see "Discussion 1"


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