Línea 1... |
Línea 1... |
1 |
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
|
1 |
@core @core_contentbank @core_h5p @contentbank_h5p @javascript
|
2 |
Feature: Delete H5P file from the content bank
|
2 |
Feature: Delete H5P file from the content bank
|
3 |
In order remove H5P content from the content bank
|
3 |
In order remove H5P content from the content bank
|
4 |
As an admin
|
4 |
As an admin
|
5 |
I need to be able to delete any H5P content from the content bank
|
5 |
I need to be able to delete any H5P content from the content bank
|
Línea 6... |
Línea 6... |
6 |
|
6 |
|
7 |
Background:
|
7 |
Background:
|
8 |
Given the following "blocks" exist:
|
- |
|
9 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
8 |
Given the following "user private file" exists:
|
10 |
| private_files | System | 1 | my-index | side-post |
|
- |
|
11 |
And I log in as "admin"
|
- |
|
12 |
And I follow "Manage private files..."
|
9 |
| user | admin |
|
13 |
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
|
- |
|
14 |
And I click on "Save changes" "button"
|
- |
|
15 |
And I am on site homepage
|
- |
|
16 |
And I turn editing mode on
|
- |
|
17 |
And the following config values are set as admin:
|
- |
|
18 |
| unaddableblocks | | theme_boost|
|
- |
|
19 |
And I add the "Navigation" block if not present
|
- |
|
20 |
And I configure the "Navigation" block
|
- |
|
21 |
And I set the following fields to these values:
|
- |
|
22 |
| Page contexts | Display throughout the entire site |
|
- |
|
23 |
And I press "Save changes"
|
- |
|
24 |
And I click on "Site pages" "list_item" in the "Navigation" "block"
|
10 |
| filepath | h5p/tests/fixtures/filltheblanks.h5p |
|
25 |
And I click on "Content bank" "link" in the "Navigation" "block"
|
11 |
And I am on the "Content bank" page logged in as "admin"
|
26 |
And I click on "Upload" "link"
|
12 |
And I click on "Upload" "link"
|
27 |
And I click on "Choose a file..." "button"
|
13 |
And I click on "Choose a file..." "button"
|
28 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
14 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
29 |
And I click on "filltheblanks.h5p" "link"
|
15 |
And I click on "filltheblanks.h5p" "link"
|
30 |
And I set the field "Save as" to "content2delete.h5p"
|
16 |
And I set the field "Save as" to "content2delete.h5p"
|
31 |
And I click on "Select this file" "button"
|
17 |
And I click on "Select this file" "button"
|
Línea 32... |
Línea 18... |
32 |
And I click on "Save changes" "button"
|
18 |
And I click on "Save changes" "button"
|
- |
|
19 |
|
33 |
|
20 |
Scenario: Admins can delete content from the content bank
|
34 |
Scenario: Admins can delete content from the content bank
|
21 |
Given I wait "2" seconds
|
35 |
Given I click on "More" "button"
|
22 |
And I click on "More" "button"
|
36 |
And I should see "Delete"
|
23 |
And I should see "Delete"
|
37 |
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
|
24 |
And I click on "Delete" "link"
|
38 |
And I should see "Are you sure you want to delete the content 'content2delete.h5p'"
|
25 |
And I should see "Are you sure you want to delete the content 'content2delete.h5p'"
|
39 |
And I should not see "The content will only be deleted from the content bank"
|
26 |
And I should not see "The content will only be deleted from the content bank"
|
- |
|
27 |
And I click on "Cancel" "button" in the "Delete content" "dialogue"
|
40 |
And I click on "Cancel" "button" in the "Delete content" "dialogue"
|
28 |
Then I should see "content2delete.h5p"
|
41 |
Then I should see "content2delete.h5p"
|
29 |
And I wait "2" seconds
|
42 |
And I click on "More" "button"
|
30 |
And I click on "More" "button"
|
43 |
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
|
31 |
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
|
44 |
And I click on "Delete" "button" in the "Delete content" "dialogue"
|
32 |
And I click on "Delete" "button" in the "Delete content" "dialogue"
|
45 |
And I wait until the page is ready
|
33 |
And I wait until the page is ready
|
Línea 54... |
Línea 42... |
54 |
| username | firstname | lastname | email |
|
42 |
| username | firstname | lastname | email |
|
55 |
| manager | Max | Manager | man@example.com |
|
43 |
| manager | Max | Manager | man@example.com |
|
56 |
And the following "role assigns" exist:
|
44 |
And the following "role assigns" exist:
|
57 |
| user | role | contextlevel | reference |
|
45 |
| user | role | contextlevel | reference |
|
58 |
| manager | manager | System | |
|
46 |
| manager | manager | System | |
|
59 |
And I log out
|
- |
|
60 |
And I log in as "manager"
|
- |
|
61 |
And I follow "Manage private files..."
|
47 |
And the following "user private file" exists:
|
62 |
And I upload "h5p/tests/fixtures/find-the-words.h5p" file to "Files" filemanager
|
- |
|
63 |
And I click on "Save changes" "button"
|
48 |
| user | manager |
|
64 |
When I click on "Site pages" "list_item" in the "Navigation" "block"
|
49 |
| filepath | h5p/tests/fixtures/find-the-words.h5p |
|
65 |
And I click on "Content bank" "link" in the "Navigation" "block"
|
50 |
When I am on the "Content bank" page logged in as "manager"
|
66 |
And I should see "content2delete.h5p"
|
51 |
And I should see "content2delete.h5p"
|
67 |
And I follow "content2delete.h5p"
|
52 |
And I follow "content2delete.h5p"
|
- |
|
53 |
And I wait "2" seconds
|
68 |
And I click on "More" "button"
|
54 |
And I click on "More" "button"
|
69 |
Then I should not see "Delete"
|
55 |
Then I should not see "Delete"
|
70 |
And I click on "Content bank" "link"
|
56 |
And I am on the "Content bank" page
|
71 |
And I click on "Upload" "link"
|
57 |
And I click on "Upload" "link"
|
72 |
And I click on "Choose a file..." "button"
|
58 |
And I click on "Choose a file..." "button"
|
73 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
59 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
74 |
And I click on "find-the-words.h5p" "link"
|
60 |
And I click on "find-the-words.h5p" "link"
|
75 |
And I click on "Select this file" "button"
|
61 |
And I click on "Select this file" "button"
|
76 |
And I click on "Save changes" "button"
|
62 |
And I click on "Save changes" "button"
|
- |
|
63 |
And I wait "2" seconds
|
77 |
And I click on "More" "button"
|
64 |
And I click on "More" "button"
|
78 |
And I should see "Delete"
|
65 |
And I should see "Delete"
|
Línea 79... |
Línea 66... |
79 |
|
66 |
|
80 |
Scenario: The number of times a content is used is displayed before removing it
|
- |
|
81 |
Given I follow "Dashboard"
|
67 |
Scenario: The number of times a content is used is displayed before removing it
|
82 |
And I follow "Manage private files..."
|
68 |
Given I am on the "My private files" page
|
83 |
And I click on "Add..." "button"
|
69 |
And I click on "Add..." "button"
|
84 |
And I select "Content bank" repository in file picker
|
70 |
And I select "Content bank" repository in file picker
|
85 |
And I click on "content2delete.h5p" "file" in repository content area
|
71 |
And I click on "content2delete.h5p" "file" in repository content area
|
86 |
And I click on "Link to the file" "radio"
|
72 |
And I click on "Link to the file" "radio"
|
87 |
And I click on "Select this file" "button"
|
73 |
And I click on "Select this file" "button"
|
88 |
And I click on "Save changes" "button"
|
- |
|
89 |
When I click on "Site pages" "list_item" in the "Navigation" "block"
|
74 |
And I click on "Save changes" "button"
|
90 |
And I click on "Content bank" "link" in the "Navigation" "block"
|
75 |
And I am on the "Content bank" page
|
- |
|
76 |
And I follow "content2delete.h5p"
|
91 |
And I follow "content2delete.h5p"
|
77 |
And I wait "2" seconds
|
92 |
And I click on "More" "button"
|
78 |
And I click on "More" "button"
|
93 |
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
|
79 |
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
|
94 |
Then I should see "Are you sure you want to delete the content 'content2delete.h5p'"
|
80 |
Then I should see "Are you sure you want to delete the content 'content2delete.h5p'"
|
95 |
And I should see "The content will only be deleted from the content bank"
|
81 |
And I should see "The content will only be deleted from the content bank"
|
96 |
And I click on "Delete" "button" in the "Delete content" "dialogue"
|
82 |
And I click on "Delete" "button" in the "Delete content" "dialogue"
|