Skip to content

test(cypress): improve e2e test stability#2559

Merged
miaulalala merged 2 commits intomasterfrom
fix/cypress-stability
May 6, 2026
Merged

test(cypress): improve e2e test stability#2559
miaulalala merged 2 commits intomasterfrom
fix/cypress-stability

Conversation

@miaulalala
Copy link
Copy Markdown
Collaborator

@miaulalala miaulalala commented May 6, 2026

toggleMenuAction (filesUtils.ts): add { force: true } to both clicks and { timeout: 10000 } on the action element lookup to survive Vue re-renders triggered by async metadata updates (e.g. share badge loading after file list render).

"Has share activity" (sidebar.cy.ts): remove the cy.visit('/apps/files') re-navigation after createPublicShare. The share is already recorded server-side (waited on via @createShare) and the sidebar is already closed, so showActivityTab can be called directly. Re-navigating caused NC to async-load the share badge on the file row, which triggered a Vue re-render that closed the Actions menu before the details entry could be clicked — failing even with a 10s timeout.

"Form survive a reload" (settings.cy.ts): add cy.intercept + cy.wait('@apiCall') before each cy.reload(), matching the pattern already used by the other two tests in this file.

createPublicShare (sidebarUtils.ts): remove duplicate intercept alias for the same POST endpoint and the redundant trailing cy.wait('@createPublicShare').

addTag (sidebarUtils.ts): wait for .files-list__row-icon-preview--loaded before opening the action menu, consistent with renameFile.

🤖 Generated with Claude Code

- toggleMenuAction: use force:true on clicks and a 10s timeout for the
  action element to survive Vue re-renders caused by async metadata
  updates (e.g. share badge appearing after file list load)
- sidebar.cy.ts "Has share activity": wait for the files PROPFIND to
  complete after cy.visit so share DAV properties are fully applied
  before opening the Actions menu
- settings.cy.ts "Form survive a reload": intercept and wait for the
  settings save API before each cy.reload(), matching the pattern already
  used by the other two tests in this suite
- createPublicShare: remove duplicate intercept alias for the same POST
  endpoint and the redundant trailing cy.wait()
- addTag: wait for the file row preview to load before triggering the
  action menu, consistent with renameFile

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cypress
Copy link
Copy Markdown

cypress Bot commented May 6, 2026

Activity    Run #3686

Run Properties:  status check passed Passed #3686  •  git commit cde533b319: test(cypress): improve e2e test stability
Project Activity
Branch Review fix/cypress-stability
Run status status check passed Passed #3686
Run duration 02m 00s
Commit git commit cde533b319: test(cypress): improve e2e test stability
Committer Anna
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 1
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 9
View all changes introduced in this branch ↗︎

Skip the re-navigation to /apps/files after createPublicShare.
The share is already recorded server-side (cy.wait('@createshare')) and
the sidebar is closed, so showActivityTab can be called directly.
Re-navigating caused NC to async-load the share badge on the file row,
which triggered a Vue re-render that closed the Actions menu before the
details entry could be clicked — failing even with a 10s timeout.

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala miaulalala merged commit 5d2d343 into master May 6, 2026
53 checks passed
@miaulalala miaulalala deleted the fix/cypress-stability branch May 6, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants