Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@repository @repository_contentbank @javascript
2
Feature: Select content bank files using the content bank files repository
3
  In order to re-use content bank files
4
  As a user
5
  I need to be able to view and select content bank files using the content bank repository
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student  | Student   | 1        | student@example.com  |
11
      | teacher1 | Teacher 1 | 1        | teacher1@example.com |
12
      | teacher2 | Teacher 2 | 1        | teacher2@example.com |
13
    And the following "categories" exist:
14
      | name         | category | idnumber |
15
      | Category1    | 0        | CAT1     |
16
      | SubCategory1 | CAT1     | SUBCAT1  |
17
    And the following "courses" exist:
18
      | fullname             | shortname | category |
19
      | MiscellaneousCourse1 | mscC1     | 0        |
20
      | MiscellaneousCourse2 | mscC2     | 0        |
21
      | Category1Course1     | cat1C1    | CAT1     |
22
      | SubCategory1Course1  | subcat1C1 | SUBCAT1  |
23
    And the following "contentbank content" exist:
24
      | contextlevel | reference | contenttype     | user  | contentname             | filepath                                    |
25
      | Course       | mscC1     | contenttype_h5p | admin | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       |
26
      | Course       | mscC2     | contenttype_h5p | admin | find-the-words.h5p      | /h5p/tests/fixtures/find-the-words.h5p      |
27
      | Course       | subcat1C1 | contenttype_h5p | admin | greeting-card.h5p       | /h5p/tests/fixtures/greeting-card.h5p       |
28
      | Category     | CAT1      | contenttype_h5p | admin | ipsums.h5p              | /h5p/tests/fixtures/ipsums.h5p              |
29
      | Category     | SUBCAT1   | contenttype_h5p | admin | multiple-choice-2-6.h5p | /h5p/tests/fixtures/multiple-choice-2-6.h5p |
30
      | System       |           | contenttype_h5p | admin | filltheblanks.h5p       | /h5p/tests/fixtures/filltheblanks.h5p       |
31
    And the following "activities" exist:
32
      | activity | name       | intro      | introformat | course | idnumber |
33
      | forum    | Forum      |            | 1           | mscC1  | forum1   |
34
      | folder   | Folder     | FolderDesc | 1           | mscC1  | folder1  |
35
    And the following "course enrolments" exist:
36
      | user     | course | role           |
37
      | teacher1 | mscC1  | editingteacher |
38
      | teacher2 | mscC1  | teacher        |
39
      | student  | mscC1  | student        |
40
 
41
  Scenario: Admin can navigate and see all existing content bank files using the content bank repository
42
    Given I am on the Folder "Folder activity" page logged in as admin
43
    And I click on "Edit" "button"
44
    And I click on "Add..." "button"
45
    And I should see "Content bank" in the ".fp-repo-area" "css_element"
46
    When I select "Content bank" repository in file picker
47
    Then I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
48
    And I should see "1" elements in repository content area
49
    And I should see "filltheblanks.h5p" "file" in repository content area
50
    And I click on "Category 1" "link" in the ".file-picker .fp-pathbar" "css_element"
51
    And I should see "System > Category 1" breadcrumb navigation in repository
52
    And I should see "2" elements in repository content area
53
    And I should see "MiscellaneousCourse1" "folder" in repository content area
54
    And I should see "MiscellaneousCourse2" "folder" in repository content area
55
    And I click on "MiscellaneousCourse2" "folder" in repository content area
56
    And I should see "System > Category 1 > MiscellaneousCourse2" breadcrumb navigation in repository
57
    And I should see "1" elements in repository content area
58
    And I should see "find-the-words.h5p" "file" in repository content area
59
    And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
60
    And I should see "System" breadcrumb navigation in repository
61
    And I should see "3" elements in repository content area
62
    And I should see "filltheblanks.h5p" "file" in repository content area
63
    And I should see "Category 1" "folder" in repository content area
64
    And I should see "Category1" "folder" in repository content area
65
    And I click on "Category1" "folder" in repository content area
66
    And I should see "System > Category1" breadcrumb navigation in repository
67
    And I should see "3" elements in repository content area
68
    And I should see "SubCategory1" "folder" in repository content area
69
    And I should see "Category1Course1" "folder" in repository content area
70
    And I should see "ipsums.h5p" "file" in repository content area
71
    And I click on "SubCategory1" "folder" in repository content area
72
    And I should see "System > Category1 > SubCategory1" breadcrumb navigation in repository
73
    And I should see "2" elements in repository content area
74
    And I should see "SubCategory1Course1" "folder" in repository content area
75
    And I should see "multiple-choice-2-6.h5p" "file" in repository content area
76
    And I click on "SubCategory1Course1" "folder" in repository content area
77
    And I should see "System > Category1 > SubCategory1 > SubCategory1Course1" breadcrumb navigation in repository
78
    And I should see "1" elements in repository content area
79
    And I should see "greeting-card.h5p" "file" in repository content area
80
 
81
  Scenario: Admin can select and re-use content bank files using the content bank repository
82
    Given I am on the Folder "Folder activity" page logged in as admin
83
    And I click on "Edit" "button"
84
    And I click on "Add..." "button"
85
    And I should see "Content bank" in the ".fp-repo-area" "css_element"
86
    And I select "Content bank" repository in file picker
87
    And I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
88
    And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
89
    And I click on "Category1" "folder" in repository content area
90
    And I should see "ipsums.h5p" "file" in repository content area
91
    And I click on "ipsums.h5p" "file" in repository content area
92
    And I should see "Select ipsums.h5p"
93
    When I click on "Select this file" "button"
94
    Then I should see "1" elements in "Files" filemanager
95
    And I should see "ipsums.h5p" in the ".fp-content .fp-file" "css_element"
96
 
97
  Scenario: Editing teacher can navigate and see content bank files available to him using the content bank repository
98
    Given I am on the Folder "Folder activity" page logged in as teacher1
99
    And I click on "Edit" "button"
100
    And I click on "Add..." "button"
101
    And I should see "Content bank" in the ".fp-repo-area" "css_element"
102
    When I select "Content bank" repository in file picker
103
    Then I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
104
    And I should see "1" elements in repository content area
105
    And I should see "filltheblanks.h5p" "file" in repository content area
106
    And I click on "Category 1" "link" in the ".file-picker .fp-pathbar" "css_element"
107
    And I should see "System > Category 1" breadcrumb navigation in repository
108
    And I should see "1" elements in repository content area
109
    And I should see "MiscellaneousCourse1" "folder" in repository content area
110
    And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
111
    And I should see "System" breadcrumb navigation in repository
112
    And I should see "2" elements in repository content area
113
    And I should see "filltheblanks.h5p" "file" in repository content area
114
    And I should see "Category 1" "folder" in repository content area
115
 
116
  Scenario: Editing teacher can select and re-use content bank files available to him using the content bank repository
117
    Given I am on the Folder "Folder activity" page logged in as teacher1
118
    And I click on "Edit" "button"
119
    And I click on "Add..." "button"
120
    And I should see "Content bank" in the ".fp-repo-area" "css_element"
121
    And I select "Content bank" repository in file picker
122
    And I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
123
    And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
124
    And I should see "filltheblanks.h5p" "file" in repository content area
125
    And I click on "filltheblanks.h5p" "file" in repository content area
126
    And I should see "Select filltheblanks.h5p"
127
    When I click on "Select this file" "button"
128
    Then I should see "1" elements in "Files" filemanager
129
    And I should see "filltheblanks.h5p" in the ".fp-content .fp-file" "css_element"
130
 
131
  Scenario: Non-editing teacher can not see the content bank repository
132
    Given I am on the Forum "Forum activity" page logged in as teacher2
133
    And I click on "Add discussion topic" "link"
134
    And I click on "Advanced" "button"
135
    When I click on "Add..." "button"
136
    Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
137
 
138
  Scenario: Student can not see the content bank repository
139
    Given I am on the Forum "Forum activity" page logged in as student
140
    And I click on "Add discussion topic" "link"
141
    And I click on "Advanced" "button"
142
    When I click on "Add..." "button"
143
    Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
144
 
145
  Scenario: Both content name and file name are shown when a content is selected
146
    Given the following "contentbank content" exist:
147
      | contextlevel | reference | contenttype     | user  | contentname | filepath                       |
148
      | Course       | mscC1     | contenttype_h5p | admin | My content  | /h5p/tests/fixtures/ipsums.h5p |
149
    And I am on the Folder "Folder activity" page logged in as admin
150
    And I click on "Edit" "button"
151
    And I click on "Add..." "button"
152
    And I should see "Content bank" in the ".fp-repo-area" "css_element"
153
    When I select "Content bank" repository in file picker
154
    Then I should see "My content"
155
    And I click on "My content" "link"
156
    And I should see "Select My content"
157
    And the field "Save as" matches value "ipsums.h5p"