Skip to content

Add Cypress end-to-end smoke suite, GitHub Actions workflow and Jenkins stage - #361

Merged
erikrozi merged 4 commits into
DevOpsfrom
devin/1793909604-cypress-e2e-smoke
Nov 6, 2026
Merged

erikrozi merged 4 commits into
DevOpsfrom
devin/1793909604-cypress-e2e-smoke

Conversation

@erikrozi

@erikrozi erikrozi commented Nov 5, 2026 •

Copy link
Copy Markdown

Summary

Adds a browser-level smoke suite under e2e/ that runs the real app against real MySQL via the existing docker-compose.yml, wires it into CI, and documents it.

Suite (e2e/cypress/e2e/, Cypress 13, 13 tests)

  • 01-register – /register renders; new user registers → /login → /dashboard with $0; duplicate username shows User already present

  • 02-login – seeded alice lands on /dashboard with Current Balance: $500.00; wrong password → /login?error; anonymous /dashboard redirects to login

  • 03-transactions – /transactions lists exactly alice's 3 seeded rows with the right text-success/text-danger classes

  • 04-transfer – Transfer Money form debits the dashboard balance by the amount and writes a Transfer Out to bob row; insufficient funds / unknown recipient show the .error text

  • 05-deposit-withdrawal – three isolated regressions: deposit $125 ($500 → $625), withdrawal $75 ($500 → $425), and insufficient-funds withdrawal $501 (balance and history unchanged). Successful operations add exactly one correctly typed/valued/coloured transaction while preserving the prior rows. Reseeds before every test/retry and after the spec.

Stack

  • e2e/docker-compose.e2e.yml overrides the root compose file: build: . instead of pulling ${DUSER}/${IMAGE}, a wget /login health check (the app has no actuator and the runtime image has no curl, so the existing health check can never pass), throw-away DB volume.
  • Runs as its own Compose project (-p bankapp-e2e, project-scoped containers bankapp-e2e-mainapp-1/bankapp-e2e-mysql-1, host port 8081 via ports: !override), so it coexists with a regular docker compose up of the root file and stack:down never touches it. Needs Compose ≥ 2.24.
  • e2e/seed/seed.sql is loaded after boot (Hibernate creates the tables with ddl-auto=update); it wipes and re-inserts alice/bob and 5 transactions, so re-running resets state. Password Password123! (bcrypt cost 10).
  • e2e/scripts/{stack-up,seed,stack-logs,stack-down}.sh wrapped as npm run stack:up | stack:seed | stack:logs | stack:down.

CI

  • .github/workflows/e2e.yml – Node 20 + Cypress binary cache → stack:up → stack:seed → cypress run → on failure uploads cypress-failure-artifacts (screenshots, videos, docker compose logs); on success uploads cypress-videos; stack:down always.
  • Jenkinsfile – new E2E: Cypress smoke suite stage between Docker: Build Images and Docker: Push to DockerHub, archiving screenshots/videos/e2e/stack.log on failure. Not executed here (no Jenkins); the agent needs Docker Compose v2 ≥ 2.24 + Node 20.

Required app fix

  • Dockerfile: openjdk:17-alpine no longer exists on Docker Hub (docker manifest inspect → not found), so the image could not be built at all. Runtime stage now uses eclipse-temurin:17-jre-alpine. Added .dockerignore so e2e/node_modules and target/ stay out of the build context.

Docs: docs/testing/e2e.md – layout, seed table, local run, how to add a test, what CI archives.

Current regression verification

Continues this PR's existing devin/1793909604-cypress-e2e-smoke branch. This extension changes only 05-deposit-withdrawal.cy.js and the testing guide; the original 10 tests/assertions, app, Dockerfile, workflow, and Jenkinsfile are unchanged from the baseline. No intentional failures, disabled checks, or SQL-performance branch changes.

  • Baseline: run 42104702352, head 1c69295150efc4fe13e4e7c3e5e5fb4a72605158, 10/10 passing; logs show checkout of merge commit cf2658b8ba2292e73cd89b6550c1d498192dfde9. Downloaded its four videos; artifact 13451251512, 909,234 bytes.
  • Final head: acaf1922cf7cc70ca0c387ed853d5f2a4441b539.
  • Actual GitHub Actions execution: run 42161194634 / job 127707008260, 13/13 tests, 5 specs, zero failures/skips/retries; all six PR checks green. The run and artifact metadata both identify the final head above. Checkout logs show GitHub's generated merge commit 037d192304a34fbd767b82e638dcc66fb0b0c5e5 (final head merged into a0653f5c358543309bbb66d3d5f72487b4df112d), not a claim that Actions checked out the head directly.
  • CI videos: cypress-videos artifact 13476947810, 1,321,627 bytes, five downloaded/probed MP4s including 05-deposit-withdrawal.cy.js.mp4; expires 2026-11-13 04:16 UTC. ZIP SHA-256 from upload logs/metadata: 1db2ccb83c1478cbf615353a51f897e14fe6ba8d06148f6072fe7d626ca0e990.
  • Separate local verification: full Cypress suite 13/13, focused spec rerun 3/3, no failures/skips/retries, against real Spring Boot 3.3.3 + MySQL 8.0.46. Native Chrome verification independently passed all three flows with reseeding and verified $500/three-row preconditions. Annotated browser recording.

Commands and evidence pipeline

Existing workflow commands (working directory e2e):

npm ci
npm run stack:up
npm run stack:seed
npm run cy:run
npm run stack:down
  • stack:up invokes docker compose -p bankapp-e2e -f docker-compose.yml -f e2e/docker-compose.e2e.yml up -d --wait --wait-timeout 300 --build from the repo root. It starts mysql:8.0 and the built app, waits for health, then probes /login. Docker's builder executes mvn clean install -DskipTests=true.
  • stack:seed pipes e2e/seed/seed.sql into the MySQL container with docker compose ... exec -T mysql mysql --user=root --password="$DB_PASSWORD" "$DB_NAME"; the new spec repeats this via cy.exec("npm run stack:seed") before each test/retry and after the spec.
  • cy:run invokes cypress run. CI used Cypress 13.17.0 / Electron 118 headless / Node 20; local Cypress used the same Cypress/browser versions with Node 24.19.0.
  • On success, actions/upload-artifact@v4 uploads e2e/cypress/videos as cypress-videos for seven days. On failure, npm run -s stack:logs > logs/stack.log 2>&1 || true collects logs and the same action archives screenshots, videos, and logs as cypress-failure-artifacts for 14 days. stack:down always runs. Failure-only steps were correctly skipped in this successful run; no synthetic failure was created.

Local suite commands after the setup workaround below:

cd e2e
E2E_SKIP_BUILD=1 npm run stack:up
npm run stack:seed
npm run cy:run
npm run cy:run -- --spec cypress/e2e/05-deposit-withdrawal.cy.js
Local-only build workaround and exact build commands

The original local npm run stack:up build encountered Maven Central HTTP 429. A repo1.maven.org retry also failed. Google’s Maven Central mirror populated the local dependency cache successfully; an external copy of the Dockerfile then mounted that cache and built offline. Source, build/runtime base image versions, repository Dockerfile, and CI were not changed. The final GitHub Actions run built successfully with the original online command.

External maven-settings.xml used:

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0">
  <mirrors><mirror><id>central</id><mirrorOf>central</mirrorOf>
    <url>https://maven-central.storage-download.googleapis.com/maven2</url>
  </mirror></mirrors>
</settings>

Executed from the repository root:

docker run --rm \
  -v /home/ubuntu/repos/Springboot-BankApp:/src \
  -v /home/ubuntu/.m2:/root/.m2 \
  -v /home/ubuntu/.devin-files/bankapp-evidence/maven-settings.xml:/tmp/settings.xml:ro \
  -w /src maven:3.8.3-openjdk-17 \
  mvn -B -s /tmp/settings.xml -Dmaven.artifact.threads=1 clean install -DskipTests=true

docker build --build-context maven-cache=/home/ubuntu/.m2/repository \
  -f /home/ubuntu/.devin-files/bankapp-evidence/Dockerfile.cached -t bankapp:e2e .

The external Dockerfile.cached was identical to the repository Dockerfile except its build instruction:

RUN --mount=type=bind,from=maven-cache,target=/root/.m2/repository,rw mvn -o clean install -DskipTests=true

Remaining limitations

  • The existing image build skips Java unit tests; these results are Cypress/browser coverage, not a Java-unit-test claim. Jenkins was not executed.
  • Whole-dollar UI inputs only: the existing HTML number inputs use the default integer step. No fractional, negative/zero, concurrent, or load/performance coverage was added.
  • Reseeding deletes all test accounts/transactions. Use only the disposable Compose database; parallel executions need separate projects/ports.
  • Local npm ci reported five dependency vulnerabilities (three moderate, two high). Dependencies were not changed; this is not a dependency-remediation PR.

Initial smoke-suite verification (baseline)

Headed run against the compose stack after re-seeding — 4 specs, 10/10 passing (26 s):

Cypress smoke suite running headed, all specs passed

Full-resolution MP4: https://devin-gtm.devinenterprise.com/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmctZWJiMGQ1NzliYmM3NDBjMjkwOGQwZGRhYWNhMDQ5Y2IvMWRiYTVlNTgtNDIwOC00MDlmLTllNzEtNmQwYzY2YTUxY2JjIiwiaWF0IjoxNzkzOTEwNzM1LCJvcmdfaWQiOiJvcmctZWJiMGQ1NzliYmM3NDBjMjkwOGQwZGRhYWNhMDQ5Y2IiLCJmaWxlbmFtZSI6ImJhbmthcHAtaGVhZGVkLXNtb2tlLWVkaXRlZC5tcDQifQ.UKPc5SN3NVLw5zLRQ-TVcO9yGRApQBZFVrXSQv8FLQc · headless videos from the CI run are in the cypress-videos artifact of the workflow run on this PR.

Task as given

In COG-GTM/Springboot-BankApp, create and maintain an automated end-to-end test environment using Cypress.

1. Add a Cypress project under e2e/ with a smoke suite covering: register page renders and creates a user, login succeeds and lands on dashboard.html, the transactions page lists seeded data, and a transfer form submits and shows the updated balance. Use the existing docker-compose.yml to stand up the app and database; add seed data as needed.
2. Add a Cypress stage to the existing Jenkinsfile and an equivalent GitHub Actions workflow that build the app, start the stack, run the suite headless, and archive screenshots and videos on failure.
3. Make the suite pass in CI on this PR. Record a short video of the suite running and reference it in the PR body.
4. Add docs/testing/e2e.md describing how to add a test and how to run the suite locally.

Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/8531d8da9dfc498ebe9c14a5ac2624d9?variant=devin
Requested by: @erikrozi


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

Enable auto-review to review your pull requests automatically.

Devin Review (Staging)


Devin Review

…Actions workflow and Jenkins stage

- e2e/: Cypress 13 project (register, login, transactions, transfer specs),
  compose override that builds the app from source, seed SQL and helper scripts
- .github/workflows/e2e.yml: build stack, seed, run headless, archive
  screenshots/videos/logs on failure
- Jenkinsfile: 'E2E: Cypress smoke suite' stage between image build and push
- Dockerfile: runtime base openjdk:17-alpine no longer exists on Docker Hub;
  use eclipse-temurin:17-jre-alpine
- docs/testing/e2e.md: how to run locally and add a test

Co-Authored-By: Erik Rozi <erik.rozi@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from Erik

In COG-GTM/Springboot-BankApp, create and maintain an automated end-to-end test environment using Cypress.

  1. Add a Cypress project under e2e/ with a smoke suite covering: register page renders and creates a user, login succeeds and lands on dashboard.html, the transactions page lists seeded data, and a transfer form submits and shows the updated balance. Use the existing docker-compose.yml to stand up the app and database; add seed data as needed.
  2. Add a Cypress stage to the existing Jenkinsfile and an equivalent GitHub Actions workflow that build the app, start the stack, run the suite headless, and archive screenshots and videos on failure.
  3. Make the suite pass in CI on this PR. Record a short video of the suite running and reference it in the PR body.
  4. Add docs/testing/e2e.md describing how to add a test and how to run the suite locally.

@socket-security

socket-security Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​cypress@​13.17.0921008496100

View full report

devin-ai-integration[bot]

This comment was marked as resolved.

Use project bankapp-e2e with its own container names and host port 8081 so
stack:up/stack:down never replace or stop a regular docker compose up of the
root file. Add stack:logs so CI does not repeat the compose invocation.

Co-Authored-By: Erik Rozi <erik.rozi@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

Headed Cypress smoke verification

Ran the suite headed (Chrome) against the compose stack after npm run stack:seed: 4 specs / 10 tests passed, exit 0, no retries.

Suite running headed, all specs passed

Transfer spec in the real app ($375 after a $125 transfer, insufficient-funds check) Final summary
Runner: balance and insufficient-funds validation All four specs and ten tests passed

Covered: registration, duplicate rejection, valid/invalid login, anonymous redirect, seeded transaction history, successful transfer, insufficient funds, unknown recipient. Not exercised locally: Jenkins stage (no Jenkins available); GitHub Actions run is the check on this PR.

Devin session

devin-ai-integration[bot]

This comment was marked as resolved.

Reset the root file's fixed container_name values in the e2e override so
E2E_COMPOSE_PROJECT can run several e2e stacks side by side.

Co-Authored-By: Erik Rozi <erik.rozi@cognition.ai>
Co-Authored-By: Erik Rozi <erik.rozi@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

Regression verification — final head acaf192

GitHub Actions: run 42161194634 passed 13/13 tests, five specs, with five downloadable Cypress videos. Run/artifact head SHA matches this PR; checkout used GitHub's generated merge commit. All six checks passed.

Local: full Cypress 13/13, focused rerun 3/3; independent native Chrome verification against real MySQL passed deposit, withdrawal, and insufficient-funds rejection with deterministic resets. Local Maven download failures required the mirror/cache workaround documented in the description; CI used the unchanged online build. Java unit tests and Jenkins were not run.

Full annotated recording

Recorded native-browser verification

Deposit history Withdrawal history Insufficient funds
One new Deposit 125.00 One new Withdrawal 75.00 Rejected withdrawal, unchanged $500

Written by Devin

@erikrozi
erikrozi merged commit 122b8d5 into DevOps Nov 6, 2026
6 checks passed
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.

1 participant