From 149319befead19e632b32596e28852ea810921bc Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Fri, 14 Apr 2023 12:20:32 +0200 Subject: [PATCH] MDL-76857 filter_displayh5p: Improve behat tests 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. --- filter/displayh5p/tests/behat/h5p_filter.feature | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/filter/displayh5p/tests/behat/h5p_filter.feature b/filter/displayh5p/tests/behat/h5p_filter.feature index 842d2dc7f8e12..3c79d290dbc6e 100644 --- a/filter/displayh5p/tests/behat/h5p_filter.feature +++ b/filter/displayh5p/tests/behat/h5p_filter.feature @@ -72,6 +72,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 @@ -107,6 +108,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." @@ -132,6 +134,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. @@ -155,6 +158,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 @@ -194,6 +198,7 @@ Feature: Render H5P content using filters And I click on "Select this file" "button" And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue" And I click on "Save and display" "button" + And I should see "PageName1" in the "page-header" "region" And I switch to "h5p-iframe" class iframe # Library is disabled, so an error should be displayed. Then I should see "This file can't be displayed because its content type is disabled."