MDL-67062 core_h5p: behat fix for delete library test
[moodle.git] / h5p / tests / behat / h5p_libraries.feature
CommitLineData
2c679b6e
AA
1@editor @core_h5p @_file_upload
2Feature: Upload and list H5P libraries and content types installed
3
4 @javascript
5 Scenario: No library installed in new installations.
6 Given I log in as "admin"
7 When I navigate to "H5P > Manage H5P content types" in site administration
8 Then I should see "Upload H5P content types"
9 And I should not see "Installed H5P"
10
11 @javascript
12 Scenario: Upload an invalid content type.
13 Given I log in as "admin"
14 And I navigate to "H5P > Manage H5P content types" in site administration
15 When I upload "h5p/tests/fixtures/h5ptest.zip" file to "H5P content type" filemanager
f531a302 16 And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
2c679b6e
AA
17 And I wait until the page is ready
18 Then I should see "Invalid H5P content type"
19 And I should not see "Installed H5P"
20
21 @javascript
22 Scenario: Upload a valid content type.
23 Given I log in as "admin"
24 And I navigate to "H5P > Manage H5P content types" in site administration
25 When I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
f531a302 26 And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
2c679b6e
AA
27 And I wait until the page is ready
28 Then I should see "H5P content types uploaded successfully"
29 And I should see "Installed H5P"
30 And I should see "Installed H5P content types"
31 And I should see "Fill in the Blanks"
32 And I should not see "Essay"
33 And I should see "Installed H5P libraries"
34 And I click on "Installed H5P libraries" "link"
35 And I should see "Question"
36 And I should see "1.4" in the "Question" "table_row"
37 And I should not see "1.3" in the "Question" "table_row"
38 And I upload "h5p/tests/fixtures/essay.zip" file to "H5P content type" filemanager
f531a302 39 And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
2c679b6e
AA
40 And I wait until the page is ready
41# Existing content types are kept and new added
42 And I should see "Fill in the Blanks"
43 And I should see "Essay"
44 And I click on "Installed H5P libraries" "link"
45 And I should see "1.3" in the "Question" "table_row"
46 And I should see "1.4"
64a2bd19
SA
47
48 @javascript
49 Scenario: Delete H5P library.
50 Given I log in as "admin"
51 And I navigate to "H5P > Manage H5P content types" in site administration
52 And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
91ae2593 53 And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
64a2bd19
SA
54 And I wait until the page is ready
55 And I click on "Installed H5P libraries" "link"
56 When I click on "Delete version" "link" in the "H5P.FontIcons" "table_row"
57 And I press "Continue"
58 And I click on "Installed H5P content types" "link"
59 Then I should not see "Fill in the Blanks"
60 And I click on "Installed H5P libraries" "link"
61 And I should not see "H5P.FontIcons"
62 And I should not see "Joubel UI"
63 And I should see "Transition"