Playwright Tests #14
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
| name: Playwright Tests | |
| on: | |
| workflow_dispatch: | |
| env: | |
| BASE_URL: https://localhost:8080 | |
| jobs: | |
| test: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: cd php/tests && npm ci | |
| - name: Install Playwright Browsers | |
| run: cd php/tests && npx playwright install --with-deps chromium | |
| - name: Start fresh development server | |
| run: | | |
| docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true | |
| docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true | |
| docker pull ghcr.io/nextcloud-releases/all-in-one:develop | |
| docker run \ | |
| -d \ | |
| --init \ | |
| --name nextcloud-aio-mastercontainer \ | |
| --restart always \ | |
| --publish 8080:8080 \ | |
| --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ | |
| --volume /var/run/docker.sock:/var/run/docker.sock:ro \ | |
| --env SKIP_DOMAIN_VALIDATION=true \ | |
| --env APACHE_PORT=11000 \ | |
| ghcr.io/nextcloud-releases/all-in-one:develop | |
| echo Waiting for 10 seconds for the development container to start ... | |
| sleep 10 | |
| - name: Run Playwright tests for initial setup | |
| run: | | |
| cd php/tests | |
| export DEBUG=pw:api | |
| if ! npx playwright test tests/initial-setup.spec.js; then | |
| docker logs nextcloud-aio-mastercontainer | |
| docker logs nextcloud-aio-borgbackup | |
| exit 1 | |
| fi | |
| - name: Start fresh development server | |
| run: | | |
| docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true | |
| docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true | |
| docker run \ | |
| -d \ | |
| --init \ | |
| --name nextcloud-aio-mastercontainer \ | |
| --restart always \ | |
| --publish 8080:8080 \ | |
| --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ | |
| --volume /var/run/docker.sock:/var/run/docker.sock:ro \ | |
| --env SKIP_DOMAIN_VALIDATION=false \ | |
| --env APACHE_PORT=11000 \ | |
| ghcr.io/nextcloud-releases/all-in-one:develop | |
| echo Waiting for 10 seconds for the development container to start ... | |
| sleep 10 | |
| - name: Run Playwright tests for backup restore | |
| run: | | |
| cd php/tests | |
| export DEBUG=pw:api | |
| if ! npx playwright test tests/restore-instance.spec.js; then | |
| docker logs nextcloud-aio-mastercontainer | |
| docker logs nextcloud-aio-borgbackup | |
| exit 1 | |
| fi | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: php/tests/playwright-report/ | |
| retention-days: 14 | |
| overwrite: true |