on-demand release 3.8dev+
[moodle.git] / lib / editor / atto / plugins / h5p / tests / behat / h5p.feature
CommitLineData
297f7e41
BB
1@editor @editor_atto @atto @atto_h5p @_switch_iframe
2Feature: Add h5ps to Atto
3 To write rich text - I need to add h5ps.
4
5 Background:
6 Given the following "courses" exist:
7 | shortname | fullname |
8 | C1 | Course 1 |
9 And the following "users" exist:
10 | username | firstname | lastname | email |
11 | teacher1 | Teacher | 1 | teacher1@example.com |
12 And the following "course enrolments" exist:
13 | user | course | role |
14 | teacher1 | C1 | editingteacher |
15 And the following "activities" exist:
16 | activity | name | intro | introformat | course | content | contentformat | idnumber |
17 | page | PageName1 | PageDesc1 | 1 | C1 | H5Ptest | 1 | 1 |
18
19 @javascript
20 Scenario: Insert an embedded h5p
21 Given I log in as "admin"
22 And I am on "Course 1" course homepage
23 And I follow "PageName1"
24 And I navigate to "Edit settings" in current page administration
25 And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
26 And I set the field "Enter URL" to "https://h5p.org/h5p/embed/576651"
27 And I click on "Save H5P" "button" in the "H5P properties" "dialogue"
28 And I wait until the page is ready
29 When I click on "Save and display" "button"
30 And I switch to "h5pcontent" iframe
31 Then ".h5p-iframe" "css_element" should exist
32
33 @javascript
34 Scenario: Test an invalid url
35 Given I log in as "admin"
36 And I am on "Course 1" course homepage
37 And I follow "PageName1"
38 And I navigate to "Edit settings" in current page administration
39 And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
40 And I set the field "Enter URL" to "ftp://h5p.org/h5p/embed/576651"
41 And I click on "Save H5P" "button" in the "H5P properties" "dialogue"
42 And I wait until the page is ready
43 Then I should see "Invalid URL" in the "H5P properties" "dialogue"
44
45 @javascript
46 Scenario: No embed h5p capabilities
47 Given I log in as "admin"
48 And I set the following system permissions of "Teacher" role:
49 | capability | permission |
50 | atto/h5p:addembed | Prohibit |
51 And I log out
52 And I log in as "teacher1"
53 And I am on "Course 1" course homepage
54 And I follow "PageName1"
55 And I navigate to "Edit settings" in current page administration
56 Then "Insert H5P" "button" should not exist