Skip to content

test: extend Cypress coverage for dashboard pages#1513

Open
dcoric wants to merge 10 commits intofinos:mainfrom
dcoric:feat/cypress
Open

test: extend Cypress coverage for dashboard pages#1513
dcoric wants to merge 10 commits intofinos:mainfrom
dcoric:feat/cypress

Conversation

@dcoric
Copy link
Copy Markdown
Contributor

@dcoric dcoric commented Apr 24, 2026

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
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit d43f371
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/69f1e2775a7daf0008140d45

@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
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.21%. Comparing base (6981427) to head (d43f371).

Files with missing lines Patch % Lines
src/service/routes/test.ts 86.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1513      +/-   ##
==========================================
- Coverage   90.21%   90.21%   -0.01%     
==========================================
  Files          69       70       +1     
  Lines        5511     5551      +40     
  Branches      944      953       +9     
==========================================
+ Hits         4972     5008      +36     
- Misses        521      525       +4     
  Partials       18       18              

☔ 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.

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

linux-foundation-easycla Bot commented Apr 24, 2026

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
Copy link
Copy Markdown
Contributor Author

dcoric commented Apr 25, 2026

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.

Copy link
Copy Markdown
Contributor

@jescalada jescalada left a comment

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 Outdated
Comment thread cypress/e2e/docker/pushActions.cy.js Outdated
Comment thread cypress/e2e/error-pages.cy.js Outdated
Comment thread cypress/e2e/push-details.cy.js
Comment thread cypress/e2e/push-details.cy.js Outdated
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.

Extend Cypress tests for dashboard pages and components

3 participants