Skip to content

Improve stability of the resources e2e tests#6972

Open
AronH99 wants to merge 6 commits into
masterfrom
fix/resources-e2e-flakes
Open

Improve stability of the resources e2e tests#6972
AronH99 wants to merge 6 commits into
masterfrom
fix/resources-e2e-flakes

Conversation

@AronH99

@AronH99 AronH99 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the flaky e2e tests for the resources view.
Ran these multiple times, should be more reliable now.

EDIT: Passed on the first time so it seems to work properly, we will see I guess...

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread cypress/e2e/scenario-6-resources.cy.js Outdated
Comment thread cypress/e2e/scenario-6-resources.cy.js
@AronH99 AronH99 requested a review from LukasStordeur June 11, 2026 07:47
Comment thread cypress/e2e/scenario-6-resources.cy.js Outdated
Comment thread cypress/e2e/scenario-6-resources.cy.js
@AronH99

AronH99 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

I think I tackled the root cause of the problems now so hopefully this should do it, decided to remove the query stuff after all

@AronH99 AronH99 requested a review from LukasStordeur June 11, 2026 09:59
@AronH99

AronH99 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

All right, was another issue but think I am in the right direction still

Comment thread cypress/e2e/scenario-6-resources.cy.js Outdated
cy.get('[data-action="per-page-250"]').click();
cy.wait("@resourcesQuery");
// keepPreviousData keeps the old page on screen while the new request is in flight,
// so retry until the header reads "1 - N of N": all resources rendered on one page.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not entirly sure I understand how this is more robust than finding the text to be 1 - 250 🤔
The 20s timeout would retry the assertion regardless of the added logic to extract the total and recreate the 1 - 250 textContent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because the default is 100 and we know that before the deletion there were more than 100 resources, for example:
1 - 100 of 102 becomes => 1 - 76 of 76 (or something like this).
Then we know oke the deletion has happened and completed properly before we establish another rowCount and move on to the other assertions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, the default is 100, but we just clicked on setting it to 250, no?
So your check will always pass, no matter how many are removed?

@AronH99 AronH99 Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm yes I think that's a mistake I should move the 250 per page down and then the check should be useful to see whether or not those resources are deleted properly.
But I guess I can just delete it as well since we only have less than 100 resources left at that point (old leftover then)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted

@AronH99 AronH99 requested a review from LukasStordeur June 12, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants