From 81da9e8ab2b3eae1d2cedb05817056b9f5a746cf Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 22 Mar 2022 00:24:16 +0100 Subject: [PATCH] MDL-72698 behat: fix problem with FF, not able to auto-scroll iframes The "Save changes" button in the SCORM package falls out from the viewport and that seems to be a problem for Firefox, not being able to auto-scroll to it before clicking. So we are just making the window 200 points taller and that makes the button to be visible (within the viewport) and clickable. Also, change the way we "wait" at the end of the scenario and, instead of reloading, we re-visit one of the contents to allow completion to be ready for final assertions. --- .../tests/behat/scorm_activity_completion.feature | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mod/scorm/tests/behat/scorm_activity_completion.feature b/mod/scorm/tests/behat/scorm_activity_completion.feature index c5964500dae..a2dfb5f2a04 100644 --- a/mod/scorm/tests/behat/scorm_activity_completion.feature +++ b/mod/scorm/tests/behat/scorm_activity_completion.feature @@ -44,6 +44,9 @@ Feature: View activity completion in the SCORM activity @javascript Scenario: View automatic completion items as a student Given I am on the "Music history" "scorm activity" page logged in as student1 + # We need a little taller window because Firefox is, apparently, unable to auto-scroll within + # an iframe, so we need to ensure that the "Save changes" button is visible in the viewport. + And I change window size to "1366x968" And the "View" completion condition of "Music history" is displayed as "todo" And the "Receive a score of 3 or more" completion condition of "Music history" is displayed as "todo" And the "Do all parts of this activity" completion condition of "Music history" is displayed as "todo" @@ -90,10 +93,12 @@ Feature: View activity completion in the SCORM activity And I wait until "Score: 33" "text" exists And I switch to the main frame # We need to get some time till the last item is marked as done (or it won't be ready in slow databases). - # This could be a pause of a few seconds (working ok in super-slow oracle docker database), but forcing a - # reload seems to be doing the work too under that very same slow environment. - And I reload the page + # This could be a pause of a few seconds (working ok in super-slow oracle docker database), but re-visiting + # any of the pages seems to be doing the work too under that very same slow environment. + And I click on "Par?" "list_item" + And I switch to "scorm_object" iframe And I wait until the page is ready + And I switch to the main frame When I am on the "Music history" "scorm activity" page Then the "View" completion condition of "Music history" is displayed as "done" # Conditions that are not possible to achieve (eg score below requirement but all attempts used) are marked as failed.