Skip to content

test: extend Cypress coverage for dashboard pages - #1513

Open
dcoric wants to merge 14 commits into
finos:mainfrom
dcoric:feat/cypress
Open

dcoric wants to merge 14 commits into
finos:mainfrom
dcoric:feat/cypress

Conversation

@dcoric

@dcoric dcoric commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Closes #624

Summary

  • add Cypress coverage for dashboard pages, navigation, profile, settings, user list, repo list/details, push list/details, and action flows
  • add test-only cleanup routes and Cypress commands for repeatable data cleanup
  • add stable UI selectors and small routing/rendering fixes needed by the tests

Verification

  • docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --build --wait
  • CYPRESS_BASE_URL=http://localhost:8081 CYPRESS_API_BASE_URL=http://localhost:8081 CYPRESS_GIT_PROXY_URL=http://localhost:8000 CYPRESS_GIT_SERVER_TARGET=git-server:8443 npm run cypress:run:docker
  • Full Docker Cypress suite passed: 71/71

dcoric added 7 commits April 23, 2026 16:17
…rage

- Bug fixes: fix error tab query param (errored → error), add CardBody testid
- Test cleanup: add DELETE /api/v1/test/push/:id and /user/:username routes (NODE_ENV=test only)
- Custom commands: cy.deleteTestPush(), cy.deleteTestUser() for test data cleanup
- UI instrumentation: add data-testid attributes to 16+ components for robust selectors
- New test files: repo-details, push-requests, repo-list, profile, user-list, settings, navigation, error-pages (42 tests total)
- Backfill cleanup: add afterEach/after cleanup to push-details and pushActions tests
… tests

Changed specPattern from 'cypress/e2e/docker/**' to 'cypress/e2e/**'
so the Docker Cypress suite picks up all test files, not just the
docker/ subdirectory. This ensures new test files are included in CI.
- Remove TypeScript type annotations from .cy.js files (Babel doesn't support them)
- Use git server credentials (testuser/user123) for cy.createPush() calls
  instead of app user credentials which don't exist on the git server
…gitignore

- Remove TypeScript type annotations from .cy.js files (Babel doesn't support them)
- Use git server credentials (testuser/user123) for cy.createPush() calls
- Add cypress/screenshots/ to .gitignore
- 48/71 tests passing, 6 specs fully green
Fixes 9 previously failing tests to bring the suite to 71/71 passing:

- Disable express-rate-limit when NODE_ENV=test to prevent 429 errors during rapid API calls

- Forward data-testid prop through CodeActionButton for repo-details selector

- Add data-testid to StepsTimeline step names and details for reliable assertions

- Add NotFound catch-all route in Dashboard layout

- Add .catch() guard to fetchRemoteRepositoryData in RepoDetails

- Fix push-details timing by intercepting and waiting for push API before assertions

- Fix navigation unauthenticated redirect test with 401 intercept strategy

- Fix profile test by stubbing auth profile and waiting for API responses

- Pre-existing fixes in error-pages, push-requests, repo-list, repo, repo-details
- push-details.cy.js: add auth/profile intercept + wait, extend timeouts
  to eliminate timing races on card body, changes tab, steps accordion
  (fixes 1.2, 1.4, 1.6)
- navigation.cy.js: move unauthenticated redirect test to separate describe
  block and clear Cypress sessions to bypass cy.session() cookie restore
  (fixes 8.6)
- profile.cy.js: stub GET /api/v1/user/:username with mock data to prevent
  UserProfile ErrorBoundary crash on backend errors (fixes 5.3)
- repo-details.cy.js: scroll code-clone-btn into view before asserting
  visibility (fixes 2.10)
- docker/pushActions.cy.js: add 2s rate-limit guards in beforeEach hooks
  with eslint suppression to avoid 429 Too Many Requests (fixes 7-9)

Test results: 38/38 previously failing tests now pass (71/71 total suite)
@dcoric
dcoric requested a review from a team as a code owner April 24, 2026 13:37
@netlify

netlify Bot commented Apr 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit d13d086
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6ae99aa9350d9af9034468de

@dcoric dcoric changed the title Extend Cypress coverage for dashboard pages test: extend Cypress coverage for dashboard pages Apr 24, 2026
Comment thread src/service/routes/index.ts Fixed
@codecov

codecov Bot commented Apr 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.05%. Comparing base (23dbf00) to head (d13d086).

Files with missing lines Patch % Lines
src/service/routes/test.ts 88.23% 1 Missing and 1 partial ⚠️
src/service/routes/index.ts 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1513      +/-   ##
==========================================
- Coverage   87.05%   87.05%   -0.01%     
==========================================
  Files         113      114       +1     
  Lines        6482     6502      +20     
  Branches     1260     1266       +6     
==========================================
+ Hits         5643     5660      +17     
- Misses        536      537       +1     
- Partials      303      305       +2     

☔ View full report in Codecov by Harness.
📢 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.

@dcoric
dcoric marked this pull request as draft April 24, 2026 13:53
@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 24, 2026 •

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@dcoric
dcoric marked this pull request as ready for review April 24, 2026 15:17
@dcoric

dcoric commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

I understand that a UI redesign is currently underway, so some of the changes in this PR may already be superseded or become obsolete soon. This work had been sitting on my side for a while, and I thought it was better to clean it up and share it rather than leave it abandoned. Even if it does not land as-is, parts of it may still be useful or reusable.

@jescalada jescalada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good so far! 🚀 Just a few things we ought to fix up:

  • Cleaning up agent-related artifacts
  • Figuring out if we can reduce E2E test execution somewhat (originally 3 mins.)
    • Potentially we could remove or reduce the cy.wait calls?
  • Fixing up the 200 check, which isn't the only guaranteed result after fetching if the push was created

Comment thread CYPRESS_PLAN.md Resolved
Comment thread cypress/e2e/docker/pushActions.cy.js Resolved
Comment thread cypress/e2e/error-pages.cy.js Resolved
Comment thread cypress/e2e/push-details.cy.js Resolved
Comment thread cypress/e2e/push-details.cy.js Resolved

@jescalada jescalada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, just a few more nitpicks from me 🙂

I noticed that the E2E tests have slowed down significantly (12-16 mins. in the last run). However, on closer inspection, it seems that the Docker setup step before the tests is unusually slow. I'm playing around with fixes for the Dockerfile in #1521 - we can safely ignore the slowdown in this PR as it's not due to the new tests.

});

afterEach(() => {
afterEach(function () {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For consistency:

Suggested change
afterEach(function () {
afterEach(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We may want to leave the TODO comments in this file - unless we're sure the action items have already been dealt with

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: would be nice to add spacing between each it block in this and other test files 🙂

dcoric added 2 commits May 20, 2026 13:11
Take main's redesigned UI for every conflicting view and re-add the test ids the
specs rely on. Port the dashboard specs to the new DOM, routes and scm identity
model, move the specs that need pushes into the docker suite, and log in through
the API in cy.login so the specs do not race the login form.
Typing the username key by key raced Primer's inline autocomplete on a
slow CI runner, so the contributor option never matched. Wait for the
input to be enabled and set the query in one input event instead.
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.

Extend Cypress tests for dashboard pages and components

3 participants