Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_data
2
Feature: Group data activity
3
  In order to create a database with my group
4
  As a student
5
  I need to add and view entries for the groups I am a member of
6
 
7
  Background:
8
    And the following "courses" exist:
9
      | fullname      | shortname |
10
      | Test Course 1 | C1        |
11
    And the following "groups" exist:
12
      | name    | course | idnumber | participation |
13
      | Group 1 | C1     | G1       | 1             |
14
      | Group 2 | C1     | G2       | 1             |
15
      | Group 3 | C1     | G3       | 0             |
16
    And the following "users" exist:
17
      | username | firstname    | lastname | email                |
18
      | teacher1 | TeacherG1    | 1        | teacher1@example.com |
1441 ariadna 19
      | teacher2 | TeacherGNone | 2        | teacher2@example.com |
20
      | teacher3 | TeacherGNone | 3        | teacher3@example.com |
1 efrain 21
      | user1    | User1G1      | 1        | user1@example.com    |
22
      | user2    | User2G2      | 2        | user2@example.com    |
23
      | user3    | User3None    | 3        | user3@example.com    |
24
      | user4    | User4NPgroup | 4        | user4@example.com    |
25
    And the following "course enrolments" exist:
26
      | user     | course | role           |
27
      | teacher1 | C1     | editingteacher |
1441 ariadna 28
      | teacher2 | C1     | editingteacher |
29
      | teacher3 | C1     | teacher        |
1 efrain 30
      | user1    | C1     | student        |
31
      | user2    | C1     | student        |
32
      | user3    | C1     | student        |
33
      | user4    | C1     | student        |
34
    And the following "group members" exist:
35
      | user     | group |
36
      | teacher1 | G1    |
37
      | user1    | G1    |
38
      | user2    | G2    |
39
      | user4    | G3    |
40
    And the following "activities" exist:
41
      | activity | name          | intro                     | course | idnumber | groupmode |
42
      | data     | Separate data | Data with separate groups | C1     | data1    | 1         |
43
      | data     | Visible data  | Data with visible groups  | C1     | data2    | 2         |
44
    And the following "mod_data > fields" exist:
45
      | database | type      | name         |
46
      | data1    | shorttext | separatetext |
47
      | data2    | shorttext | visibletext  |
48
    And the following "mod_data > entries" exist:
49
      | database | user  | group | separatetext       |
50
      | data1    | user1 | G1    | I am user 1        |
51
      | data1    | user2 | G2    | I am user 2        |
52
    And the following "mod_data > entries" exist:
53
      | database | user  | separatetext       |
54
      | data1    | user3 | I am user 3        |
55
    And the following "mod_data > entries" exist:
56
      | database | user  | group | visibletext        |
57
      | data2    | user1 | G1    | I am user 1        |
58
      | data2    | user2 | G2    | I am user 2        |
59
    And the following "mod_data > entries" exist:
60
      | database | user  | visibletext        |
61
      | data2    | user3 | I am user 3        |
62
      | data2    | user4 | I am user 4        |
63
 
64
  Scenario Outline: Users should see their own participation groups in "separate groups" mode, and all
65
  participation groups in "visible groups" mode.
66
    Given I am on the "<data>" "data activity" page logged in as "<user>"
67
    Then I <all> "All participants"
68
    And I <G1> "Group 1"
69
    And I <user1> "I am user 1"
70
    And I <G2> "Group 2"
71
    And I <user2> "I am user 2"
72
    # All users should see entries with no group.
73
    And I should see "I am user 3"
74
    # No-one should see non-participation groups.
75
    And I should not see "Group 3"
76
 
77
    Examples:
78
      | data  | user     | all            | G1             | G2             | user1          | user2          |
79
      | data1 | teacher1 | should see     | should see     | should see     | should see     | should see     |
1441 ariadna 80
      | data1 | teacher2 | should see     | should see     | should see     | should see     | should see     |
81
      | data1 | teacher3 | should see     | should not see | should not see | should not see | should not see |
1 efrain 82
      | data1 | user1    | should not see | should see     | should not see | should see     | should not see |
83
      | data1 | user2    | should not see | should not see | should see     | should not see | should see     |
84
      | data1 | user3    | should see     | should not see | should not see | should not see | should not see |
85
      | data1 | user4    | should see     | should not see | should not see | should not see | should not see |
86
      | data2 | teacher1 | should see     | should see     | should see     | should see     | should see     |
1441 ariadna 87
      | data2 | teacher2 | should see     | should see     | should see     | should see     | should see     |
88
      | data2 | teacher3 | should see     | should see     | should see     | should see     | should not see |
1 efrain 89
      | data2 | user1    | should see     | should see     | should see     | should see     | should not see |
90
      | data2 | user2    | should see     | should see     | should see     | should not see | should see     |
91
      | data2 | user3    | should see     | should see     | should see     | should see     | should not see |
92
      | data2 | user4    | should see     | should see     | should see     | should see     | should not see |
93
 
94
  Scenario Outline: When viewing a database in visible groups mode,
95
  a user should only have the "Add entry" button for their own participation groups
96
    Given I am on the "data2" "data activity" page logged in as "<user>"
97
    And I select "<mygroup>" from the "group" singleselect
98
    And I should see "Add entry"
99
    When I select "<othergroup>" from the "group" singleselect
100
    Then I should not see "Add entry"
101
 
102
    Examples:
103
      | user  | mygroup          | othergroup |
104
      | user1 | Group 1          | Group 2    |
105
      | user2 | Group 2          | Group 1    |
106
      | user1 | All participants | Group 2    |
107
      | user2 | All participants | Group 1    |
108
 
109
  Scenario Outline: Users in no groups or non-participation groups should not be able to add entries
110
    Given I am on the "<data>" "data activity" page logged in as "<user>"
111
    Then I should not see "Add entry"
112
 
113
    Examples:
114
      | data  | user     |
115
      | data1 | user3    |
116
      | data1 | user4    |
117
      | data2 | user3    |
118
      | data2 | user4    |