DAS-2144 English content further changes #293
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: 'Playwright E2E Tests' | |
| on: | |
| workflow_call: | |
| inputs: | |
| environment: | |
| description: 'Environment to test against (development, staging, production)' | |
| required: true | |
| type: string | |
| base_url: | |
| description: 'Base URL to run tests against' | |
| required: true | |
| type: string | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Environment to test against' | |
| required: true | |
| type: choice | |
| options: | |
| - development | |
| - staging | |
| - production | |
| base_url: | |
| description: 'Base URL to run tests against' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| e2e_tests: | |
| name: "E2E Tests - ${{ inputs.environment || 'PR' }} (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shardIndex: [1, 2, 3, 4, 5, 6] | |
| shardTotal: [6] | |
| steps: | |
| - name: 'Checkout repository' | |
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - name: 'Setup Node.js' | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: 'Install Dependencies' | |
| run: npm ci --no-audit | |
| - name: 'Install Playwright Browser' | |
| run: npx playwright install --with-deps chromium | |
| - name: 'Run Playwright E2E Tests (PR - Local)' | |
| if: github.event_name == 'pull_request' | |
| run: npm run e2e -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
| - name: 'Run Playwright E2E Tests (Against Environment)' | |
| if: inputs.base_url | |
| run: npm run e2e -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
| env: | |
| BASE_URL: ${{ inputs.base_url }} | |
| - name: 'Upload Playwright Report' | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | |
| with: | |
| name: playwright-report-${{ inputs.environment || 'pr' }}-shard-${{ matrix.shardIndex }}-${{ github.run_number }} | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: 'Upload Test Results' | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | |
| with: | |
| name: playwright-results-${{ inputs.environment || 'pr' }}-shard-${{ matrix.shardIndex }}-${{ github.run_number }} | |
| path: playwright-results.xml | |
| retention-days: 30 |