Skip to content

E2e - #7

Open
EHandtkeBasis wants to merge 12 commits into
mainfrom
e2e
Open

E2e#7
EHandtkeBasis wants to merge 12 commits into
mainfrom
e2e

Conversation

@EHandtkeBasis

Copy link
Copy Markdown
Member

No description provided.

@EHandtkeBasis
EHandtkeBasis requested a review from hyyan September 16, 2026 11:54

@hyyan hyyan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The build setup around the tests is too complicated and has bugs. Replace it with a standard Maven and Failsafe setup.

Remove

  • The docker-e2e and container-e2e profiles, the exec-maven-plugin config, and the second Maven run inside Docker.
    • Every verify builds the step twice, and the inner clean deletes the host's target/.
    • The container writes root-owned files into target/, so mvn clean on the host fails afterwards.
    • The Playwright Java image has no Java CA certificates, so the Maven run inside it can't download dependencies on a fresh runner.
    • docker-e2e is always active, which switches off the default dev profile.
  • scripts/run-e2e.sh and .gitattributes.
  • The custom it.test, skipTests, skipITs and maven.test.skip properties. Failsafe already supports -Dit.test, -DskipITs, -DskipTests and -Dmaven.test.skip.
  • The junit-jupiter.version override. It downgrades Spring Boot 4's JUnit 6.
  • TutorialApp and the E2E_IN_DOCKER checks.
  • <hotswap> on spring-boot-maven-plugin. It isn't a parameter of that plugin. Restore excludeDevtools, and remove the second spring-boot-maven-plugin declaration in steps 3–6.
  • The application.properties changes in steps 2–6. They have nothing to do with testing, they duplicate keys, and they remove the app name, the datasource settings and the H2 console.
  • The node_modules, playwright-report and test-results entries in .gitignore.
  • The copied helper code. Each step has about 510 lines of the same helpers. Once TutorialApp is replaced, keep only what each step actually needs.

Replace with

  1. Root aggregator POM. Add a root pom.xml with packaging set to pom that only lists the six steps as modules. Don't add a shared parent, so each step still builds on its own with cd <step> && mvn verify.
    • Full suite: mvn -B -ntp -fae verify
    • One step: -pl :customer-app-step-N
  2. Failsafe. Go back to the Failsafe setup from main: the integration-test and verify goals with trimStackTrace=false.
    • Pass the baseline and artifact folders as systemPropertyVariables.
    • Enable redirectTestOutputToFile so each test's log is kept.
  3. App startup. Replace TutorialApp with @SpringBootTest(webEnvironment = RANDOM_PORT) and @LocalServerPort, as the webforJ Spring archetype does.
    • Add @ActiveProfiles("test") and a src/test/resources/application-test.properties that turns off devtools browser opening, livereload, craftforj and debug.
    • Add @DirtiesContext(AFTER_EACH_TEST_METHOD) if each test needs a fresh app.
    • Spring then handles startup, readiness, the port and shutdown. That also fixes the overwritten server.log, readiness accepting a 404, and the port race.
  4. Browser in Docker. Run only the browser in Docker.
    • Use Testcontainers to start mcr.microsoft.com/playwright/java:v${playwright.version}-noble running Playwright's run-server.
    • Connect with chromium().connect(wsUrl, new BrowserType.ConnectOptions().setExposeNetwork("<loopback>")).
    • Keep this exact image, because the baselines depend on its fonts. Don't regenerate the baselines.
  5. Workflow.
    • Run the Maven command above instead of the script.
    • Add a pull_request trigger and permissions: contents: read.
    • Always upload the surefire and failsafe reports, visual-diffs and playwright-traces.
  6. READMEs. Only list the final commands: mvn verify, -pl, -Dit.test=Class#method, -DupdateScreenshots=true and the skip flags. Leave out internal details.

Keep

  • The StepNIT tests and their assertions
  • VisualAssertions
  • The existing baselines
  • The Playwright traces
  • The browser-error checks

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.

2 participants