ci: run e2e tests on pull requests with an auto-generated test user - #1232
Open
mahdi2ba wants to merge 5 commits into
Open
ci: run e2e tests on pull requests with an auto-generated test user#1232mahdi2ba wants to merge 5 commits into
mahdi2ba wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wires the existing WebdriverIO + Cucumber E2E suite into CI so it runs automatically on every pull request, and removes the suite's dependency on shared/hardcoded test credentials by generating a unique Keycloak user per scenario
Specifically:
.github/workflows/treetracker-frontend-e2e-pr.yml("E2E Tests"): starts the app, runs the suite headless in Chrome on every PR (+ manual dispatch), and uploads the Allure HTML report and the run video as a downloadable artifact.features/support/testUser.js: registers a fresh unique user (treetracker-bdd-<timestamp>-<random>) through the Keycloak sign-up page per run,and remembers it for later steps in the same scenario.admin.feature: the one scenario needing thegreenstand-adminrole reads its credentials fromBDD_GREENSTAND_ADMIN_USERNAME/BDD_GREENSTAND_ADMIN_PASSWORDsecrets and skips cleanly when they're absent (e.g. on fork PRs).wdio.conf.jsmade CI-ready:CHROMEDRIVER_PATH/ headless via env vars, safe video-capture fallback when ffmpeg is missing, anddisableWebdriverStepsReporting: trueso typed passwords are never written into the uploaded report.README.mddocuments the CI workflow and the env vars used.Issue(s) addressed
What kind of change(s) does this PR introduce?
Please check if the PR fulfils these requirements
ci:)Issue
What is the current behavior?
The WebdriverIO + Cucumber E2E suite exists under
features/but is never executed in CI — the PR pipeline only runs lint, build and Jest unit tests. The suite also depends on a shared account whose username/password are hardcoded in plain text in the feature/step files, and the login/registration scenarios are disabled with@skip.What is the new behavior?
The E2E suite runs automatically on every pull request (headless Chrome) and publishes its report + video as an artifact. Each scenario provisions its own disposable Keycloak user at runtime, so there are no shared/hardcoded credentials; the previously skipped scenarios no run. The privileged admin scenario is driven by repository secrets and skips gracefully when they aren't available.
Breaking change
Does this PR introduce a breaking change?
No. The change is additive — a new, non-blocking CI check plus test-suite refactoring.
There are no application (
src/) code changes.Other useful information
pathsfilter first — see the workflow file).CHROMEDRIVER_PATHis set automatically in CI; local-run instructions are in the README.reports/and publishingthe report + video to a live GitHub Pages URL are intentionally left for a separate PR.