And I scroll to the id "[id]" semi-reliably fails

Bug #1982041 reported by Gold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
New
Undecided
Unassigned

Bug Description

The test that showed me this was the following:

./mahara_behat.sh rundebug site_features/webservices.feature:20

I have been finding line 60 is problematic.

https://git.mahara.org/mahara/mahara/-/blob/main/test/behat/features/site_features/webservices.feature#L60

If I add a breakpoint and stretch the window wide so the Edit button is visible it is reliable. I also tried it many times without stretching it out and it works while the breakpoint is in place.

The suspicion is the "And I scroll to the id "webservices_token_pseudofieldset"" on the line before may not be scrolling into view at a consistent speed and sometimes it doesn't get there in time. Looking at the screenshots of the error this is the case.

Potential fixes.

Adding a "And I wait "1" seconds" allows the test to pass reliably.

However, it adds time and only fixes this one instance.

I'm wondering if building the delay into "And I scroll to the id "[id]"" and the other 'scroll into' steps. Adding a check that the requested id is actually in the viewport here would prevent this issue in all places making the tests more robust.

https://git.mahara.org/mahara/mahara/-/blob/main/htdocs/testing/frameworks/behat/classes/BehatGeneral.php#L1958

Tags: behat-dev
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.