Behat failing tests when trying to add blocks on pages

Bug #1889020 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Cecilia Vela Gurovic

Bug Description

There are a few behat tests that fail, so far I've seen
edit_default_template_pages.feature
group_view_block.feature
shared_with_group.feature

They try to add a block but the modal is never opened and then the tests fails trying to select a blocktype from a modal that is not visible.

By looking into the Network tab of the browser while running the tests, I could see that there are too many calls to view/blocks.json.php taking a long time to run. This could be delaying the modal load, but we would need to look into this a bit more.

The calls have parameters like
id: 2
change: 1
action_moveblockinstance_id_6_newx_0_newy_0_newheight_8_newwidth_6: true

so they're just trying to resize or move the blocks inside the page.

Changed in mahara:
milestone: none → 20.10.0
Revision history for this message
Robert Lyon (robertl-9) wrote :

I think the issue may also be due to the adding of a block to a page includes some ajax/js which may finish executing after behat goes into it's next step.

So this is happening in behat:
1) adds placeholder block to page
2) selects what type of bock it will be
- on click kicks off ajax to fetch the config for the block
3) next behat step updates form fields including title
- the ajax finally finishes and part of that is to update the block title to the title that existed in step 1, which is 'Placeholder'
4) the block config is saved - but with the old and not the new title

I believe we need to make sure step 2 has fully finished before doing step three

Revision history for this message
Robert Lyon (robertl-9) wrote :
Changed in mahara:
importance: Undecided → Low
status: New → Confirmed
summary: - Behat fainling tests when trying to add blocks on pages
+ Behat failing tests when trying to add blocks on pages
Changed in mahara:
importance: Low → Medium
description: updated
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
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.