on-demand release 4.0dev+
[moodle.git] / contentbank / tests / behat / view_preferences.feature
CommitLineData
39263ddb 1@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
c393d818
BB
2Feature: Store the content bank view preference
3 In order to consistantly view the content bank in icons or details view
4 As an admin
5 I need to be able to store my view preference
6
7 Background:
c393d818 8 Given I log in as "admin"
3810b293
SA
9 And I follow "Manage private files..."
10 And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
11 And I upload "h5p/tests/fixtures/greeting-card-887.h5p" file to "Files" filemanager
12 And I click on "Save changes" "button"
c393d818
BB
13 And I am on site homepage
14 And I turn editing mode on
15 And I add the "Navigation" block if not present
3810b293
SA
16 And I configure the "Navigation" block
17 And I set the following fields to these values:
18 | Page contexts | Display throughout the entire site |
19 And I press "Save changes"
c393d818
BB
20 And I expand "Site pages" node
21 And I click on "Content bank" "link"
3810b293
SA
22 And I click on "Upload" "link"
23 And I click on "Choose a file..." "button"
24 And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
25 And I click on "filltheblanks.h5p" "link"
26 And I set the field "Save as" to "fib.h5p"
27 And I click on "Select this file" "button"
28 And I click on "Save changes" "button"
29 And I click on "Content bank" "link"
30 And I click on "Upload" "link"
31 And I click on "Choose a file..." "button"
32 And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
33 And I click on "greeting-card-887.h5p" "link"
34 And I set the field "Save as" to "greetingcard.h5p"
35 And I click on "Select this file" "button"
36 And I click on "Save changes" "button"
37
38 Scenario: There are several views for displaying contents into the content bank
39 Given I am on site homepage
c7a7fdab 40 And I expand "Site pages" node
3810b293 41 And I click on "Content bank" "link"
4106d263 42 When I click on "Display content bank with file details" "button"
3810b293
SA
43 Then I should see "Last modified"
44 And I follow "greetingcard.h5p"
c393d818
BB
45 And I click on "Content bank" "link"
46 And I should see "Last modified"
4106d263 47 And I click on "Display content bank with icons" "button"
3810b293 48 And I follow "greetingcard.h5p"
c393d818
BB
49 And I click on "Content bank" "link"
50 And I should not see "Last modified"
3810b293
SA
51
52 Scenario: Display the number of times a content is used in file details view
53 Given I follow "Dashboard" in the user menu
54 And I follow "Manage private files..."
55 And I click on "Add..." "button"
56 And I select "Content bank" repository in file picker
57 And I click on "fib.h5p" "file" in repository content area
58 And I click on "Link to the file" "radio"
59 And I click on "Select this file" "button"
60 And I click on "Save changes" "button"
61 When I am on site homepage
62 And I expand "Site pages" node
63 And I click on "Content bank" "link"
64 And I click on "Display content bank with file details" "button"
65 Then I should see "1" in the "[data-file='fib.h5p'] .cb-uses" "css_element"
66 And I should see "0" in the "[data-file='greetingcard.h5p'] .cb-uses" "css_element"