on-demand release 4.0dev+
[moodle.git] / contentbank / tests / behat / events.feature
CommitLineData
39263ddb 1@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @_switch_iframe @javascript
f2e02ea9
AA
2Feature: Confirm content bank events are triggered
3 In order to log content bank actions
4 As an admin
5 I need to be able to check triggered events
6
7 Background:
f3d43c76
SA
8 Given I log in as "admin"
9 And I navigate to "H5P > Manage H5P content types" in site administration
10 And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
11 And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
f2e02ea9
AA
12 And the following "courses" exist:
13 | fullname | shortname | category |
14 | Course 1 | C1 | 0 |
15 And the following "contentbank content" exist:
f3d43c76
SA
16 | contextlevel | reference | contenttype | user | contentname | filepath |
17 | Course | C1 | contenttype_h5p | admin | Existing | /h5p/tests/fixtures/filltheblanks.h5p |
ef557b97
SA
18 And I follow "Dashboard" in the user menu
19 And I follow "Manage private files..."
f2e02ea9
AA
20 And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager
21 And I click on "Save changes" "button"
22 And I am on "Course 1" course homepage with editing mode on
23 And I add the "Navigation" block if not present
24
25 Scenario: Content created and uploaded events when uploading a content file
26 Given I navigate to "Reports > Live logs" in site administration
27 And I should not see "Content uploaded"
28 And I should not see "Content created"
29 And I am on "Course 1" course homepage
30 And I expand "Site pages" node
31 And I click on "Content bank" "link"
32 When I click on "Upload" "link"
33 And I click on "Choose a file..." "button"
34 And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
35 And I click on "filltheblanks.h5p" "link"
36 And I click on "Select this file" "button"
37 And I click on "Save changes" "button"
38 And I navigate to "Reports > Live logs" in site administration
39 Then I should see "Content uploaded"
40 And I should see "Content created"
41
42 Scenario: Content viewed event
43 Given I navigate to "Reports > Live logs" in site administration
44 And I should not see "Content viewed"
45 And I am on "Course 1" course homepage
46 And I expand "Site pages" node
47 And I click on "Content bank" "link"
48 When I click on "Existing" "link"
49 And I navigate to "Reports > Live logs" in site administration
50 Then I should see "Content viewed"
51
52 Scenario: Content deleted event
53 Given I navigate to "Reports > Live logs" in site administration
54 And I should not see "Content deleted"
55 And I am on "Course 1" course homepage
56 And I expand "Site pages" node
57 And I click on "Content bank" "link"
58 And I click on "Existing" "link"
59 And I open the action menu in "region-main-settings-menu" "region"
60 When I choose "Delete" in the open action menu
61 And I click on "Delete" "button" in the "Delete content" "dialogue"
62 And I navigate to "Reports > Live logs" in site administration
63 Then I should see "Content deleted"
64
65 Scenario: Content updated event when renaming
66 Given I navigate to "Reports > Live logs" in site administration
67 And I should not see "Content updated"
68 And I am on "Course 1" course homepage
69 And I expand "Site pages" node
70 And I click on "Content bank" "link"
71 And I click on "Existing" "link"
72 And I open the action menu in "region-main-settings-menu" "region"
73 When I choose "Rename" in the open action menu
74 And I set the field "Content name" to "New name"
75 And I click on "Rename" "button"
76 And I navigate to "Reports > Live logs" in site administration
7afd16ad 77 Then I should see "Content updated"