test: extend Cypress coverage for dashboard pages#1513
test: extend Cypress coverage for dashboard pages#1513dcoric wants to merge 10 commits intofinos:mainfrom
Conversation
…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)
✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.
|
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
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
left a comment
There was a problem hiding this comment.
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.waitcalls?
- Potentially we could remove or reduce the
- Fixing up the 200 check, which isn't the only guaranteed result after fetching if the push was created
jescalada
left a comment
There was a problem hiding this comment.
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 () { |
There was a problem hiding this comment.
For consistency:
| afterEach(function () { | |
| afterEach(() => { |
There was a problem hiding this comment.
We may want to leave the TODO comments in this file - unless we're sure the action items have already been dealt with
There was a problem hiding this comment.
Nit: would be nice to add spacing between each it block in this and other test files 🙂
Closes #624
Summary
Verification