Playwright Tests #367
This file contains 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: | |
deployment_status: | |
jobs: | |
test: | |
timeout-minutes: 20 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v4 | |
id: cache-node-modules | |
with: | |
path: | | |
./node_modules | |
./web/node_modules | |
./cli/node_modules | |
./worker/node_modules | |
./shared/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Install Playwright Browsers | |
run: yarn web playwright install --with-deps | |
- name: Run Playwright Tests | |
shell: bash | |
env: | |
STAGE: ${{ github.event.deployment.environment }} | |
BASE_URL: ${{ github.event.deployment_status.target_url }} | |
DEADROP_API_URL: ${{ secrets.DEADROP_API_URL }} | |
REDIS_REST_URL: ${{ secrets.REDIS_REST_URL }} | |
REDIS_REST_TOKEN: ${{ secrets.REDIS_REST_TOKEN }} | |
run: | | |
export STAGE=$STAGE | |
echo "Running '$STAGE' environment tests..." | |
export DEADROP_API_URL=$DEADROP_API_URL | |
echo $DEADROP_API_URL | |
export REDIS_REST_URL=$REDIS_REST_URL | |
export REDIS_REST_TOKEN=$REDIS_REST_TOKEN | |
if [ ${{ github.event.deployment.environment }} == 'Production' ]; then | |
export TEST_URI="https://deadrop.io/" | |
else | |
export TEST_URI=$BASE_URL | |
fi | |
echo $TEST_URI | |
CI=true yarn test:e2e --trace on | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: web/test-results/ | |
retention-days: 30 |