Skip to content

feat: add Cypress e2e tests for dashboard push actions #1403

Open
fabiovincenzi wants to merge 28 commits intofinos:mainfrom
fabiovincenzi:feat/e2e-dashboard-tests
Open

feat: add Cypress e2e tests for dashboard push actions #1403
fabiovincenzi wants to merge 28 commits intofinos:mainfrom
fabiovincenzi:feat/e2e-dashboard-tests

Conversation

@fabiovincenzi
Copy link
Contributor

@fabiovincenzi fabiovincenzi commented Feb 12, 2026

Fixes #1390

  • Add Cypress e2e tests for the admin UI dashboard's push management flows (approve, reject, cancel)
  • Fix disabled prop not being forwarded in CustomButton component, which prevented the attestation confirm button from being properly disabled
  • Add data-testid attributes to push detail action buttons and attestation dialog for reliable test selectors
  • Organise Cypress tests into cypress/e2e/ (local) and cypress/e2e/docker/ (require Docker); local tests continue to run in the Node/MongoDB matrix in ci.yml, Docker tests run in e2e.yml
  • Add cypress:run:docker script targeting Docker-only tests
  • Add Cypress Docker step to e2e.yml alongside existing vitest e2e tests, with log dump and screenshot upload on failure
  • Make existing Cypress tests (repo.cy.js) compatible with Docker environment by replacing hardcoded URLs with Cypress.env('API_BASE_URL')
  • Pass git credentials via GIT_CONFIG_* env vars in createPush to avoid exposing them in CI logs

@netlify
Copy link

netlify bot commented Feb 12, 2026

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

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

@fabiovincenzi fabiovincenzi changed the title Feat/e2e dashboard tests feat: add Cypress e2e tests for dashboard push actions Feb 12, 2026
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.01%. Comparing base (ac353de) to head (308d747).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1403   +/-   ##
=======================================
  Coverage   90.01%   90.01%           
=======================================
  Files          67       67           
  Lines        4769     4769           
  Branches      885      885           
=======================================
  Hits         4293     4293           
  Misses        458      458           
  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.

@fabiovincenzi fabiovincenzi requested a review from a team as a code owner February 17, 2026 11:36
@fabiovincenzi fabiovincenzi marked this pull request as draft February 17, 2026 18:07
@fabiovincenzi fabiovincenzi marked this pull request as ready for review February 18, 2026 10:24
Copy link
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!

// only handles 401 errors in authorisePush/rejectPush. The 403 is silently
// ignored and the user is navigated away without feedback. Once the UI properly
// handles 403, this test should assert a snackbar error message is shown.
cy.visit(`/dashboard/push/${this.pushId}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

@dcoric This might be relevant to your error handling PR #1406 - in case you get failing tests after this gets merged!

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm having some issues with tests failing locally due to Cypress checking the first page which is full of repositories from previous test executions:

image

It'd be great to have some cleanup for repositories specifically, although general cleanup functions for everything affecting the local DB would be ideal!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a cleanupTestRepos command that deletes all cypress-test repos from the DB before the suite runs,. Also fixed a pre-existing bug in the "Existing repo" after hook that was using repo.name instead of repo._id for the delete request, which silently prevented cleanup from working.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement e2e tests for admin UI's dashboard

2 participants