Proyectos de Subversion Moodle

Rev

| 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
 
39
  Scenario: Unlisted content cannot be seen by other users
40
    Given the following "users" exist:
41
      | username  | firstname  | lastname  | email                 |
42
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
43
      | teacher2  | Teacher    | 2         | teacher2@example.com  |
44
    And the following "courses" exist:
45
      | fullname | shortname |
46
      | Course 1 | C1        |
47
    And the following "course enrolments" exist:
48
      | user      | course  | role            |
49
      | teacher1  | C1      | editingteacher  |
50
      | teacher2  | C1      | editingteacher  |
51
    And the following "contentbank content" exist:
52
      | contextlevel | reference | contenttype     | user     | contentname             | filepath                                    | visibility |
53
      | Course       | C1        | contenttype_h5p | teacher1 | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 2          |
54
    And I log out
55
    And I log in as "teacher1"
56
    And I am on "Course 1" course homepage
57
    And I click on "Site pages" "list_item" in the "Navigation" "block"
58
    And I click on "Content bank" "link" in the "Navigation" "block"
59
    Then I should see "filltheblanks.h5p (Unlisted)"
60
    And I log out
61
    And I log in as "teacher2"
62
    And I am on "Course 1" course homepage
63
    And I click on "Site pages" "list_item" in the "Navigation" "block"
64
    And I click on "Content bank" "link" in the "Navigation" "block"
65
    Then I should not see "filltheblanks.h5p"
66
 
67
  Scenario: Unlisted content is not found through search by other users
68
    Given the following "users" exist:
69
      | username  | firstname  | lastname  | email                 |
70
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
71
      | teacher2  | Teacher    | 2         | teacher2@example.com  |
72
    And the following "courses" exist:
73
      | fullname | shortname |
74
      | Course 1 | C1        |
75
    And the following "course enrolments" exist:
76
      | user      | course  | role            |
77
      | teacher1  | C1      | editingteacher  |
78
      | teacher2  | C1      | editingteacher  |
79
    And the following "contentbank content" exist:
80
      | contextlevel | reference | contenttype     | user     | contentname             | filepath                                    | visibility |
81
      | Course       | C1        | contenttype_h5p | teacher1 | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 2          |
82
    And I log out
83
    And I log in as "teacher1"
84
    And I am on "Course 1" course homepage
85
    And I click on "Site pages" "list_item" in the "Navigation" "block"
86
    And I click on "Content bank" "link" in the "Navigation" "block"
87
    And I set the field "Search" to "filltheblanks.h5p"
88
    And I should see "filltheblanks.h5p"
89
    And I log out
90
    And I log in as "teacher2"
91
    And I am on "Course 1" course homepage
92
    And I click on "Site pages" "list_item" in the "Navigation" "block"
93
    And I click on "Content bank" "link" in the "Navigation" "block"
94
    When I set the field "Search" to "filltheblanks.h5p"
95
    Then I should not see "filltheblanks.h5p"
96
 
97
  Scenario: Managers can see other users' unlisted content
98
    Given the following "users" exist:
99
      | username  | firstname  | lastname  | email                 |
100
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
101
      | manager1  | Manager    | 1         | manager1@example.com  |
102
    And the following "courses" exist:
103
      | fullname | shortname |
104
      | Course 1 | C1        |
105
    And the following "course enrolments" exist:
106
      | user      | course  | role            |
107
      | teacher1  | C1      | editingteacher  |
108
      | manager1  | C1      | manager         |
109
    And the following "contentbank content" exist:
110
      | contextlevel | reference | contenttype     | user     | contentname             | filepath                                    | visibility |
111
      | Course       | C1        | contenttype_h5p | teacher1 | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       | 2          |
112
    And I log out
113
    And I log in as "manager1"
114
    And I am on "Course 1" course homepage
115
    And I click on "Site pages" "list_item" in the "Navigation" "block"
116
    And I click on "Content bank" "link" in the "Navigation" "block"
117
    And I should see "filltheblanks.h5p (Unlisted)"
118
    And I set the field "Search" to "filltheblanks.h5p"
119
    And I should see "filltheblanks.h5p (Unlisted)"
120
 
121
  @_file_upload
122
  Scenario: Default content visibility can be set to unlisted
123
    Given the following "courses" exist:
124
      | fullname | shortname |
125
      | Course 1 | C1        |
126
    And I set the following administration settings values:
127
      | Default content visibility | 2 |
128
    And I am on "Course 1" course homepage
129
    And I click on "Site pages" "list_item" in the "Navigation" "block"
130
    And I click on "Content bank" "link" in the "Navigation" "block"
131
    And I click on "Upload" "link"
132
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Upload content" filemanager
133
    And I click on "Save changes" "button"
134
    Then "filltheblanks.h5p (Unlisted)" "heading" should exist
135
 
136
  @_file_upload
137
  Scenario: User preference concerning content visibility overrides site-wide default content visibility
138
    Given the following "courses" exist:
139
      | fullname | shortname |
140
      | Course 1 | C1        |
141
    And I set the following administration settings values:
142
      | Default content visibility | 2 |
143
    And the following "user preferences" exist:
144
      | user  | preference  | value |
145
      | admin | core_contentbank_visibility  | 1  |
146
    And I am on "Course 1" course homepage
147
    And I click on "Site pages" "list_item" in the "Navigation" "block"
148
    And I click on "Content bank" "link" in the "Navigation" "block"
149
    And I click on "Upload" "link"
150
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Upload content" filemanager
151
    And I click on "Save changes" "button"
152
    Then "filltheblanks.h5p" "heading" should exist
153
    And "filltheblanks.h5p (Unlisted)" "heading" should not exist