test: self-contained local test account + urlencoded login
Add a dedicated, gitignored testrunner account auto-created by the suite (make test-account, also invoked from global-setup) so `make test` no longer needs the real account in .env. The target uses --admin-type both so the account has admin.login for the gpx-manager specs. test-post.sh switches its login POST to --data-urlencode to survive special chars in credentials. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Np4cMQLF77i664CAQXySzU
This commit is contained in:
@@ -36,13 +36,23 @@ $(foreach t,$(REMOTE_TARGETS),$(foreach e,$(ENVS),$(eval $(call make-env-target,
|
||||
|
||||
# ── Tests ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
# Local test account — auto-created, never committed (see user/.gitignore).
|
||||
# Keep the password free of shell/Make/URL-special chars so every consumer agrees.
|
||||
GRAV_TEST_USER ?= testrunner
|
||||
GRAV_TEST_PASS ?= Testpass1234
|
||||
|
||||
test-account:
|
||||
@docker exec intotheeast_grav sh -c 'test -f /var/www/html/user/accounts/$(GRAV_TEST_USER).yaml \
|
||||
|| php bin/plugin login new-user -u $(GRAV_TEST_USER) -p "$(GRAV_TEST_PASS)" \
|
||||
-e $(GRAV_TEST_USER)@example.test -N "Test Runner" -P b --admin-type both -s enabled -n'
|
||||
|
||||
test-config:
|
||||
@bash scripts/test-form-config.sh
|
||||
|
||||
test-post:
|
||||
test-post: test-account
|
||||
@bash scripts/test-post.sh
|
||||
|
||||
test-ui:
|
||||
test-ui: test-account
|
||||
@npx playwright test
|
||||
|
||||
test: test-config test-post test-ui
|
||||
|
||||
Reference in New Issue
Block a user