Skip to content

Fix flaky cypress tests - #6965

Merged
juliusknorr merged 2 commits into
mainfrom
tests/cypress-green
Mar 18, 2025
Merged

Fix flaky cypress tests#6965
juliusknorr merged 2 commits into
mainfrom
tests/cypress-green

Conversation

@juliusknorr

@juliusknorrjuliusknorr commented Mar 17, 2025

Copy link
Copy Markdown
Member

runner 1 Assistant - Open translate dialog

Otherwise this test is flaky as it may not focus fast enough before entering text, also clicking my interfere with the autofocus of the language selection. Certainly the test could be improved but this is a quick fix to get back to green ci

runner 7 The session Api - signals closing connection

The issue is that the close api call was not awaited properly. This lead to situations where the push was called too early. Can be tested locally with adding a sleep on the backend in https://github.com/nextcloud/text/blob/tests/cypress-green/lib/Service/ApiService.php#L161

@codecov

codecovBot commented Mar 17, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.82%. Comparing base (7006f77) to head (3210385).
Report is 4 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #6965 +/- ##
=======================================
Coverage 51.82% 51.82% =======================================
Files 476 476 Lines 40154 40154 Branches 985 985 =======================================
Hits 20811 20811 Misses 19237 19237 Partials 106 106 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorrjuliusknorr added tests If you write them we ♥ you 3. to review labels Mar 17, 2025
.click()

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I did not figure out a way to make this wort otherwise. For some reason running on CI otherwise focusses the NcSelect 🤷

@juliusknorr
juliusknorr requested a review from a teamMarch 17, 2025 22:21
@juliusknorrjuliusknorr changed the title tests(cypress): Wait for input to be focusedFix flaky cypress testsMar 17, 2025
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable31

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable30

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable29

@AndyScherzingerAndyScherzinger 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.

🐘

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewtestsIf you write them we ♥ you

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@juliusknorr@AndyScherzinger