Repository navigation
Split block editing UI tests into smaller tests - #1819
Conversation
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.
LukasKalbertodt
left a comment
There was a problem hiding this comment.
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.
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 addedtest 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:
toHaveUrlcheck passing doesn't really mean that the correct page is in view. So instead we wait for the page heading instead.I recommend that you turn off white space changes for the review.nevermind, that doesn't really help.