Repository navigation
test(e2e): add a Playwright suite for the v5 admin workstreams - #179
Open
ericwang401 wants to merge 3 commits into
Open
ericwang401 wants to merge 3 commits into
ericwang401 wants to merge 3 commits into
Conversation
…lations
The admin API is registered with scopeBindings(), which resolves a child
route parameter through a parent relation named after it: `{image_definition}`
under `{image_group}` through ImageGroup::imageDefinitions(), and
`{image_version}` under `{image_definition}` through
ImageDefinition::imageVersions(). Neither exists -- the relations are
definitions() and versions() -- so every route below
/image-groups/{group}/images/{definition} answered 500, taking the Versions
dialog, image edit and version publishing with it.
Map those two parameters onto the existing relations, and cover the routes
over HTTP, including a child requested under the wrong parent still 404ing.
Runs inside the ddev web container (`ddev npm run test:e2e`), with headless Chromium's libraries added to the web image and the browser kept under node_modules/.cache. Global setup seeds E2eSeeder, which resets a superadmin, a plain user and a guest, and clears what earlier runs imported or uploaded, so a run works the same on a fresh migrate as on a reused database. Covers, without a Proxmox node: - catalogue import from a local registry.json fixture served on :4174 (one version per import, re-import adds nothing, Windows Server 2025 gets a v2.0 TPM) - chunked upload of a 48 MiB image in three chunks, and resuming an interrupted one from the server's offset - a limited admin role: only its nav items, 403s elsewhere, and no role authoring for a non-superadmin - the guest-accounts switch locking out a signed-in guest Live-node specs (adoption, migration, sharing) are tagged @LiVe and skip without PROXMOX_* in the runner's environment. A new `e2e` CI job runs the rest against `php artisan serve`.
.env.ci ends without a newline, so echoing IMAGE_REGISTRY_URL onto the copied file joined it to PHP_XDEBUG_MODE and Dotenv refused to parse it.
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.
Adds a Playwright end-to-end suite in
tests/e2e/for the PR #168 workstreams that don't need a Proxmox node, plus ane2eCI job.Running it
Node and the browser both run in the ddev web container, so nothing is installed on the host.
The catalogue specs need
IMAGE_REGISTRY_URL=http://127.0.0.1:4174/registry.jsonin.env. The suite servestests/e2e/fixtures/registry.jsonthere while it runs, so nothing depends on the live CDN. Full details are in the new End-to-end tests (Playwright) section of AGENTS.md.Fixtures
Global setup runs
php artisan db:seed --class=E2eSeederbefore every run. It resets:admin@e2e.test(Superadmin),user@e2e.test(no role) andguest@e2e.test(guest), all with passwordpasswordE2E …roles deletedE2E Uploadsimage recreatedA run therefore behaves the same on a fresh
migrate:freshas on a reused database. The seeder refuses to run in production.Specs
cataloguecreated: false, still one version, Import disabled; Windows Server 2025 getstpm: v2.0uploadroles/adminguests/auth/login; standard accounts are unaffectedlive/live-node@live: a node smoke check, plusfixmestubs for adoption, migration and sharing; skips unlessPROXMOX_FQDN,PROXMOX_TOKEN_IDandPROXMOX_TOKEN_SECRETare in the runner's environmentOther changes
npm run tcalso typecheckstests/e2e(its owntsconfig.json; adds@types/node).Verified
Against a fresh
migrate:freshin ddev, run repeatedly: 16 passed, 4@liveskipped. Also run over plain HTTP againstphp artisan serveinside the container, which is how the CI job runs. This PR's CI run is that job's first run on GitHub Actions.