fix: portal before host #150
Workflow file for this run
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: 🌐 Test Web | |
| on: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/web-e2e-test.yml" | |
| - "package.json" | |
| - "yarn.lock" | |
| - "example/**" | |
| - "e2e/**" | |
| - "src/**" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/web-e2e-test.yml" | |
| - "package.json" | |
| - "yarn.lock" | |
| - "example/**" | |
| - "e2e/**" | |
| - "src/**" | |
| jobs: | |
| build-web: | |
| name: 🏗️ Build web | |
| defaults: | |
| run: | |
| working-directory: example | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Build web | |
| run: yarn build:web | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: web-e2e-app | |
| path: example/dist/** | |
| test-web: | |
| name: ⚙️ Automated test cases | |
| runs-on: macos-15 | |
| timeout-minutes: 60 | |
| needs: build-web | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Download a single artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: web-e2e-app | |
| path: example/dist/ | |
| - name: Start static server | |
| run: | | |
| cd example | |
| npx http-server dist -p 8080 --silent --gzip --brotli --hostname 127.0.0.1 >/dev/null 2>&1 & | |
| echo $! > .server-pid | |
| - name: Install Maestro | |
| run: | | |
| curl -fsSL "https://get.maestro.mobile.dev" | bash | |
| echo "$HOME/.maestro/bin" >> $GITHUB_PATH | |
| export MAESTRO_DRIVER_STARTUP_TIMEOUT=600000 | |
| - name: Specify web env | |
| run: | | |
| find e2e/flows -name "*.yml" -exec sh -c ' | |
| for file; do | |
| printf "url: http://localhost:8080\n" | cat - "$file" > temp && mv temp "$file" | |
| done | |
| ' sh {} + | |
| shell: bash | |
| - name: Prepare snapshot engine | |
| run: cd e2e && npm install | |
| - name: Run tests | |
| run: | | |
| node e2e/snapshot-engine.js & | |
| SERVER_PID=$! | |
| export MAESTRO_CLI_NO_ANALYTICS="true" | |
| export MAESTRO_CHROME_FLAGS="--no-sandbox --user-data-dir=/tmp/chrome-profile-$GITHUB_RUN_ID" | |
| maestro --platform web test -e DEVICE="Chrome" --headless e2e/flows/* --format html ./e2e/reports/debug --debug-output ./e2e/reports/debug --flatten-debug-output | |
| kill $SERVER_PID | |
| - name: Stop server | |
| if: always() | |
| run: | | |
| kill $(cat .server-pid) || true | |
| - name: Upload test report | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./e2e/reports | |
| name: e2e-report-web |