-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include web-js and web-js-script in e2e tests (#471)
* add projectId to url path in web-js * serve all assets from root * prettier * add nightly test workflow * fix e2e workflows * test out web-js on commitly workflow * test * fix workflow * fix workflow * fix workflow * fix warning * handle block hash * debug * fix passkeys for local tests * reduce flakiness of tests * preserve query string for email link in web-js * don't enforce signup-init as default landing page (to allow auth component to choose login-init in some cases) * add query and hash to every route in web-js * add rewrite rule to vercel web-js * add projectId to path in web-js-script * prettier * run tests only when deployment succeeded * add web-js-script to nightly tests * don't recalculate branch name in nightly tests
- Loading branch information
Showing
21 changed files
with
421 additions
and
243 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,7 @@ on: | |
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- feature-refactor-to-thin-frontend | ||
|
||
jobs: | ||
deploy: | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
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: '42 1 * * *' # 1:42 AM UTC = 3:42 AM 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_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_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_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 |
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
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
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
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.