Skip to content

Split block editing UI tests into smaller tests - #1819

Merged
LukasKalbertodt merged 1 commit into
elan-ev:mainfrom
owi92:split-block-tests
Oct 27, 2026
Merged

LukasKalbertodt merged 1 commit into
elan-ev:mainfrom
owi92:split-block-tests

Conversation

@owi92

@owi92 owi92 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Previously, we had one large test for both user and regular realms that added and edited five blocks sequentially and then removed them again.
This made the test take quite a while to complete and actually ran into timeouts more often than not.

Apart from the blocks can be added test case, every other test now inserts their blocks directly into the DB and uses just a single block per page. That allows for simpler locators and less co-dependencies of the individual steps.

This also adds a new test case where we do use five blocks and edit a single one to check whether the others remain unchanged.

Also fixed in this are two race conditions:

  • Our router changes the URL immediately, but the actual page only updates once everything is loaded. That meant that the toHaveUrl check passing doesn't really mean that the correct page is in view. So instead we wait for the page heading instead.
  • Blocks stay in edit mode until their save request is done. That means that assertions maed right after clicking "save" would race with that request, adding to the potential flakiness. So now we wait for the "save" button to disappear first.

I recommend that you turn off white space changes for the review. nevermind, that doesn't really help.

Previously, we had one large test for both user and
regular realms that added and edited five blocks
sequentially and then removed them again.
This made the test take quite a while to complete and
actually ran into timeouts more often than not.

Apart from the `blocks can be added` test case, every other
test now inserts their blocks directly into the DB and
uses just a single block per page. That allows for simpler
locators and less co-dependencies of the individual steps.

This also adds a new test case where we do use five blocks
and edit a single one to check whether the others remain
unchanged.

Also fixed in this commit are two race conditions:
- Our router changes the URL immediately, but the actual page only
  updates once everything is loaded. That meant that the `toHaveUrl`
  check passing doesn't really mean that the correct page is in view.
  So instead we wait for the page heading instead.
- Blocks stay in edit mode until their save request is done. That means
  that assertions maed right after clicking "save" would race with that
  request, adding to the potential flakiness. So now we wait for the
  "save" button to disappear first.
@owi92 owi92 added the changelog:dev Changes primarily for developers label Oct 26, 2026
@github-actions
github-actions Bot temporarily deployed to test-deployment-pr1819 October 26, 2026 14:12 Destroyed

@LukasKalbertodt LukasKalbertodt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously neither of us knows whether this will improve the situation, but it looks reasonable and is worth a try. The only thing I don't really like about this is how much SQL code is used, specifically close to the test itself. The DB tables/schema is somewhat of a implementation detail, that UI tests shouldn't care about. Whenever the DB layout changes significantly, we might need to change UI tests too, which is meh. Of course we always had the standardData fixture here, so it was already the case (and I was already not super happy). But it now also moving closer to the test, such that an individual test contains SQL... not a huge fan. But I don't have a super immediate idea how to fix it. And as I said, lets just try, we can always improve later. And we will definitely touch these again soon.

@LukasKalbertodt
LukasKalbertodt merged commit cf347ab into elan-ev:main Oct 27, 2026
3 checks passed

This branch was successfully deployed

No deployments
test-deployment-pr1819 — f38fef09 Deployed Oct 26, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:dev Changes primarily for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants