diff --git a/docker-compose.yml b/docker-compose.yml index 131043b..60673b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -132,6 +132,8 @@ services: command: sleep infinity depends_on: - nextcloud + extra_hosts: + - "${NEXTCLOUD_HOST:-${COMPOSE_PROJECT_NAME}.localhost}:host-gateway" restart: unless-stopped networks: - default diff --git a/tests/worker/contract.bats b/tests/worker/contract.bats index b1ab07c..a8123e3 100644 --- a/tests/worker/contract.bats +++ b/tests/worker/contract.bats @@ -112,3 +112,12 @@ setup() { [[ "$output" == *"VIRTUAL_HOST: example.test"* ]] } + + +@test "Playwright resolves the public Nextcloud hostname through the Docker host" { + run env DB_TYPE=sqlite COMPOSE_PROFILES=playwright sh "$WORKER" playwright-route config + [ "$status" -eq 0 ] + [[ "$output" == *"PLAYWRIGHT_BASE_URL: https://ncdev-playwright-route.localhost"* ]] + [[ "$output" == *"ncdev-playwright-route.localhost"* ]] + [[ "$output" == *"host-gateway"* ]] +}