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
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
2
Feature: Make content public or unlisted
3
  In order to make content public or unlisted
4
  As a user
5
  I need to be able to access the edition options
6
 
7
  Background:
8
    Given I log in as "admin"
9
    And I am on site homepage
10
    And I turn editing mode on
11
    And the following config values are set as admin:
12
      | unaddableblocks | | theme_boost|
13
    And I add the "Navigation" block if not present
14
    And I configure the "Navigation" block
15
    And I set the following fields to these values:
16
      | Page contexts | Display throughout the entire site |
17
    And I press "Save changes"
18
    And I navigate to "H5P > Manage H5P content types" in site administration
19
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
20
    And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
21
 
22
  Scenario: Users can make their content public or unlisted
23
    Given the following "contentbank content" exist:
24
      | contextlevel | reference | contenttype     | user  | contentname             | filepath                                    | visibility |
25
      | System       |           | contenttype_h5p | admin | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 1          |
26
    And I click on "Site pages" "list_item" in the "Navigation" "block"
27
    And I click on "Content bank" "link" in the "Navigation" "block"
28
    And I click on "filltheblanks.h5p" "link"
29
    And I wait until the page is ready
30
    And "filltheblanks.h5p (Unlisted)" "heading" should not exist
31
    And I click on "More" "button"
32
    And I should see "Make unlisted"
33
    And I click on "Make unlisted" "link"
34
    And I wait until the page is ready
35
    Then "filltheblanks.h5p (Unlisted)" "heading" should exist
36
    And I click on "More" "button"
37
    And I should see "Make public"
38
 
1441 ariadna 39
  Scenario: Unlisted content can be hidden by user preference
40
    Given the following "contentbank content" exist:
41
      | contextlevel | reference | contenttype     | user  | contentname             | filepath                                    | visibility |
42
      | System       |           | contenttype_h5p | admin | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 1          |
43
      | System       |           | contenttype_h5p | admin | find-the-words.h5p      | /h5p/tests/fixtures/find-the-words.h5p      | 2          |
44
    And I am on the "Content bank" page logged in as "admin"
45
    And I should see "filltheblanks.h5p"
46
    And I should see "find-the-words.h5p (Unlisted)"
47
    When I set the field "Show unlisted content" to "0"
48
    And I wait until the page is ready
49
    Then I should see "filltheblanks.h5p"
50
    And I should not see "find-the-words.h5p (Unlisted)"
51
    And I set the field "Show unlisted content" to "1"
52
    And I wait until the page is ready
53
    And I should see "filltheblanks.h5p"
54
    And I should see "find-the-words.h5p (Unlisted)"
55
 
1 efrain 56
  Scenario: Unlisted content cannot be seen by other users
57
    Given the following "users" exist:
58
      | username  | firstname  | lastname  | email                 |
59
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
60
      | teacher2  | Teacher    | 2         | teacher2@example.com  |
61
    And the following "courses" exist:
62
      | fullname | shortname |
63
      | Course 1 | C1        |
64
    And the following "course enrolments" exist:
65
      | user      | course  | role            |
66
      | teacher1  | C1      | editingteacher  |
67
      | teacher2  | C1      | editingteacher  |
68
    And the following "contentbank content" exist:
69
      | contextlevel | reference | contenttype     | user     | contentname             | filepath                                    | visibility |
70
      | Course       | C1        | contenttype_h5p | teacher1 | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 2          |
71
    And I log out
72
    And I log in as "teacher1"
73
    And I am on "Course 1" course homepage
74
    And I click on "Site pages" "list_item" in the "Navigation" "block"
75
    And I click on "Content bank" "link" in the "Navigation" "block"
76
    Then I should see "filltheblanks.h5p (Unlisted)"
77
    And I log out
78
    And I log in as "teacher2"
79
    And I am on "Course 1" course homepage
80
    And I click on "Site pages" "list_item" in the "Navigation" "block"
81
    And I click on "Content bank" "link" in the "Navigation" "block"
82
    Then I should not see "filltheblanks.h5p"
83
 
84
  Scenario: Unlisted content is not found through search by other users
85
    Given the following "users" exist:
86
      | username  | firstname  | lastname  | email                 |
87
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
88
      | teacher2  | Teacher    | 2         | teacher2@example.com  |
89
    And the following "courses" exist:
90
      | fullname | shortname |
91
      | Course 1 | C1        |
92
    And the following "course enrolments" exist:
93
      | user      | course  | role            |
94
      | teacher1  | C1      | editingteacher  |
95
      | teacher2  | C1      | editingteacher  |
96
    And the following "contentbank content" exist:
97
      | contextlevel | reference | contenttype     | user     | contentname             | filepath                                    | visibility |
98
      | Course       | C1        | contenttype_h5p | teacher1 | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 2          |
99
    And I log out
100
    And I log in as "teacher1"
101
    And I am on "Course 1" course homepage
102
    And I click on "Site pages" "list_item" in the "Navigation" "block"
103
    And I click on "Content bank" "link" in the "Navigation" "block"
104
    And I set the field "Search" to "filltheblanks.h5p"
105
    And I should see "filltheblanks.h5p"
106
    And I log out
107
    And I log in as "teacher2"
108
    And I am on "Course 1" course homepage
109
    And I click on "Site pages" "list_item" in the "Navigation" "block"
110
    And I click on "Content bank" "link" in the "Navigation" "block"
111
    When I set the field "Search" to "filltheblanks.h5p"
112
    Then I should not see "filltheblanks.h5p"
113
 
114
  Scenario: Managers can see other users' unlisted content
115
    Given the following "users" exist:
116
      | username  | firstname  | lastname  | email                 |
117
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
118
      | manager1  | Manager    | 1         | manager1@example.com  |
119
    And the following "courses" exist:
120
      | fullname | shortname |
121
      | Course 1 | C1        |
122
    And the following "course enrolments" exist:
123
      | user      | course  | role            |
124
      | teacher1  | C1      | editingteacher  |
125
      | manager1  | C1      | manager         |
126
    And the following "contentbank content" exist:
127
      | contextlevel | reference | contenttype     | user     | contentname             | filepath                                    | visibility |
128
      | Course       | C1        | contenttype_h5p | teacher1 | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 2          |
129
    And I log out
130
    And I log in as "manager1"
131
    And I am on "Course 1" course homepage
132
    And I click on "Site pages" "list_item" in the "Navigation" "block"
133
    And I click on "Content bank" "link" in the "Navigation" "block"
134
    And I should see "filltheblanks.h5p (Unlisted)"
135
    And I set the field "Search" to "filltheblanks.h5p"
136
    And I should see "filltheblanks.h5p (Unlisted)"
137
 
138
  @_file_upload
139
  Scenario: Default content visibility can be set to unlisted
140
    Given the following "courses" exist:
141
      | fullname | shortname |
142
      | Course 1 | C1        |
143
    And I set the following administration settings values:
144
      | Default content visibility | 2 |
145
    And I am on "Course 1" course homepage
146
    And I click on "Site pages" "list_item" in the "Navigation" "block"
147
    And I click on "Content bank" "link" in the "Navigation" "block"
148
    And I click on "Upload" "link"
149
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Upload content" filemanager
150
    And I click on "Save changes" "button"
151
    Then "filltheblanks.h5p (Unlisted)" "heading" should exist
152
 
153
  @_file_upload
154
  Scenario: User preference concerning content visibility overrides site-wide default content visibility
155
    Given the following "courses" exist:
156
      | fullname | shortname |
157
      | Course 1 | C1        |
158
    And I set the following administration settings values:
159
      | Default content visibility | 2 |
160
    And the following "user preferences" exist:
161
      | user  | preference  | value |
162
      | admin | core_contentbank_visibility  | 1  |
163
    And I am on "Course 1" course homepage
164
    And I click on "Site pages" "list_item" in the "Navigation" "block"
165
    And I click on "Content bank" "link" in the "Navigation" "block"
166
    And I click on "Upload" "link"
167
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Upload content" filemanager
168
    And I click on "Save changes" "button"
169
    Then "filltheblanks.h5p" "heading" should exist
170
    And "filltheblanks.h5p (Unlisted)" "heading" should not exist