Skip to content

Commit

Permalink
MDL-76857 filter_displayh5p: Improve behat tests
Browse files Browse the repository at this point in the history
Although the screenshots in the failures for some of the scenarios in
filter/displayh5p/tests/behat/h5p_filter.feature, like "Render a local
H5P file as teacher" were displaying the expected result, there were
some javascript errors (probably due to behat is quicker and the
iframes were not always ready).
I've added one extra step before accessing the iframe to give more
time to the H5P player to load and confirm the page is displayed
properly.
  • Loading branch information
sarjona committed Apr 27, 2023
1 parent b90b0e6 commit e8cd8fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions filter/displayh5p/tests/behat/h5p_filter.feature
Expand Up @@ -69,6 +69,7 @@ Feature: Render H5P content using filters
And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue"
And I wait until the page is ready
When I click on "Save and display" "button"
And I should see "PageName1" in the "page-header" "region"
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page
Expand Down Expand Up @@ -104,6 +105,7 @@ Feature: Render H5P content using filters
And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue"
And I wait until the page is ready
When I click on "Save and display" "button"
And I should see "PageName1" in the "page-header" "region"
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
Then I should see "Note that the libraries may exist in the file you uploaded, but you're not allowed to upload new libraries."
Expand All @@ -129,6 +131,7 @@ Feature: Render H5P content using filters
And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue"
And I wait until the page is ready
And I click on "Save and display" "button"
And I should see "PageName1" in the "page-header" "region"
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Libraries don't exist, so an error should be displayed.
Expand All @@ -152,6 +155,7 @@ Feature: Render H5P content using filters
And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue"
And I wait until the page is ready
And I click on "Save and display" "button"
And I should see "PageName2" in the "page-header" "region"
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page
Expand Down

0 comments on commit e8cd8fc

Please sign in to comment.