Skip to content

Nightly End-to-End testing check for Playground Apps #166

Nightly End-to-End testing check for Playground Apps

Nightly End-to-End testing check for Playground Apps #166

name: Nightly End-to-End testing check for Playground Apps
env:
BRANCH_NAME_RAW: ${{ github.head_ref || github.ref_name }}
on:
workflow_dispatch:
schedule:
- cron: '10 5 * * *' # 6:10 AM CET / 7:10 AM CEST
- cron: '50 11 * * *' # 12:50 PM CET / 1:50 PM CEST
- cron: '30 18 * * *' # 7:30 PM CET / 8:30 PM CEST
jobs:
prepare:
timeout-minutes: 60
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Get installed Playwright version
id: playwright-version
run: echo "::set-output name=version::$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: |
cd packages/tests-e2e
npm list
- name: Install Dependencies
run: |
cd packages/tests-e2e
npm install
- uses: actions/cache@v3
id: playwright-cache
with:
path: '~/.cache/ms-playwright'
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright's dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: |
cd packages/tests-e2e
npx playwright install --with-deps
- name: Install and run E2E Test for react
run: |
cd packages/tests-e2e
BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')
export PLAYWRIGHT_TEST_URL="https://$BRANCH_NAME.react.playground.corbado.io"
PLAYWRIGHT_TEST_URL=$PLAYWRIGHT_TEST_URL npx playwright test --config=playwright.config.ui.ts
env:
PLAYWRIGHT_NUM_CORES: 4
PLAYWRIGHT_JWT_TOKEN: ${{ secrets.PLAYWRIGHT_JWT_TOKEN }}
PLAYWRIGHT_MICROSOFT_EMAIL: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL }}
PLAYWRIGHT_MICROSOFT_EMAIL_LINKED: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL_LINKED }}
PLAYWRIGHT_MICROSOFT_EMAIL_UNLINKED: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL_UNLINKED }}
PLAYWRIGHT_MICROSOFT_PASSWORD: ${{ secrets.PLAYWRIGHT_MICROSOFT_PASSWORD }}
GITHUB_RUN_ID: ${{ github.run_id }}
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_TOKEN }}
GITHUB_BRANCH_NAME: ${{ env.BRANCH_NAME_RAW }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-react
path: packages/tests-e2e/playwright-report/
retention-days: 30
- name: Install and run E2E Test for web-js
run: |
cd packages/tests-e2e
BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')
export PLAYWRIGHT_TEST_URL="https://$BRANCH_NAME.web-js.playground.corbado.io"
PLAYWRIGHT_TEST_URL=$PLAYWRIGHT_TEST_URL npx playwright test --config=playwright.config.ui.ts
env:
PLAYWRIGHT_NUM_CORES: 4
PLAYWRIGHT_JWT_TOKEN: ${{ secrets.PLAYWRIGHT_JWT_TOKEN }}
PLAYWRIGHT_MICROSOFT_EMAIL: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL }}
PLAYWRIGHT_MICROSOFT_EMAIL_LINKED: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL_LINKED }}
PLAYWRIGHT_MICROSOFT_EMAIL_UNLINKED: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL_UNLINKED }}
PLAYWRIGHT_MICROSOFT_PASSWORD: ${{ secrets.PLAYWRIGHT_MICROSOFT_PASSWORD }}
GITHUB_RUN_ID: ${{ github.run_id }}
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_TOKEN }}
GITHUB_BRANCH_NAME: ${{ env.BRANCH_NAME_RAW }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-web-js
path: packages/tests-e2e/playwright-report/
retention-days: 30
- name: Install and run E2E Test for web-js-script
run: |
cd packages/tests-e2e
BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')
export PLAYWRIGHT_TEST_URL="https://$BRANCH_NAME.web-js-script.playground.corbado.io"
PLAYWRIGHT_TEST_URL=$PLAYWRIGHT_TEST_URL npx playwright test --config=playwright.config.ui.ts
env:
PLAYWRIGHT_NUM_CORES: 4
PLAYWRIGHT_JWT_TOKEN: ${{ secrets.PLAYWRIGHT_JWT_TOKEN }}
PLAYWRIGHT_MICROSOFT_EMAIL: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL }}
PLAYWRIGHT_MICROSOFT_EMAIL_LINKED: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL_LINKED }}
PLAYWRIGHT_MICROSOFT_EMAIL_UNLINKED: ${{ secrets.PLAYWRIGHT_MICROSOFT_EMAIL_UNLINKED }}
PLAYWRIGHT_MICROSOFT_PASSWORD: ${{ secrets.PLAYWRIGHT_MICROSOFT_PASSWORD }}
GITHUB_RUN_ID: ${{ github.run_id }}
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_TOKEN }}
GITHUB_BRANCH_NAME: ${{ env.BRANCH_NAME_RAW }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-web-js-script
path: packages/tests-e2e/playwright-report/
retention-days: 30