1 @core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
2 Feature: Store the content bank view preference
3 In order to consistantly view the content bank in icons or details view
5 I need to be able to store my view preference
8 Given the following "blocks" exist:
9 | blockname | contextlevel | reference | pagetypepattern | defaultregion |
10 | private_files | System | 1 | my-index | side-post |
11 And I log in as "admin"
12 And I follow "Manage private files..."
13 And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
14 And I upload "h5p/tests/fixtures/greeting-card-887.h5p" file to "Files" filemanager
15 And I click on "Save changes" "button"
16 And I am on site homepage
17 And I turn editing mode on
18 And the following config values are set as admin:
19 | unaddableblocks | | theme_boost|
20 And I add the "Navigation" block if not present
21 And I configure the "Navigation" block
22 And I set the following fields to these values:
23 | Page contexts | Display throughout the entire site |
24 And I press "Save changes"
25 And I expand "Site pages" node
26 And I click on "Content bank" "link"
27 And I click on "Upload" "link"
28 And I click on "Choose a file..." "button"
29 And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
30 And I click on "filltheblanks.h5p" "link"
31 And I set the field "Save as" to "fib.h5p"
32 And I click on "Select this file" "button"
33 And I click on "Save changes" "button"
34 And I click on "Content bank" "link"
35 And I click on "Upload" "link"
36 And I click on "Choose a file..." "button"
37 And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
38 And I click on "greeting-card-887.h5p" "link"
39 And I set the field "Save as" to "greetingcard.h5p"
40 And I click on "Select this file" "button"
41 And I click on "Save changes" "button"
43 Scenario: There are several views for displaying contents into the content bank
44 Given I am on site homepage
45 And I expand "Site pages" node
46 And I click on "Content bank" "link"
47 When I click on "Display content bank with file details" "button"
48 Then I should see "Last modified"
49 And I follow "greetingcard.h5p"
50 And I click on "Content bank" "link"
51 And I should see "Last modified"
52 And I click on "Display content bank with icons" "button"
53 And I follow "greetingcard.h5p"
54 And I click on "Content bank" "link"
55 And I should not see "Last modified"
57 Scenario: Display the number of times a content is used in file details view
58 Given I follow "Dashboard"
59 And I follow "Manage private files..."
60 And I click on "Add..." "button"
61 And I select "Content bank" repository in file picker
62 And I click on "fib.h5p" "file" in repository content area
63 And I click on "Link to the file" "radio"
64 And I click on "Select this file" "button"
65 And I click on "Save changes" "button"
66 When I am on site homepage
67 And I expand "Site pages" node
68 And I click on "Content bank" "link"
69 And I click on "Display content bank with file details" "button"
70 Then I should see "1" in the "[data-file='fib.h5p'] .cb-uses" "css_element"
71 And I should see "0" in the "[data-file='greetingcard.h5p'] .cb-uses" "css_element"