-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimized the e2e suite, separated the yml for cron
- Loading branch information
1 parent
db02376
commit 1c55a97
Showing
14 changed files
with
248 additions
and
209 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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Monitor Cron e2e Tests | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: '0 8 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Environment to run the e2e against' | ||
required: false | ||
default: 'dev' | ||
type: choice | ||
options: | ||
- stage | ||
- prod | ||
- dev | ||
type: | ||
description: 'What Type of Test do you want to run?' | ||
required: false | ||
default: 'all' | ||
type: choice | ||
options: | ||
- all | ||
- smoke | ||
- ui | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.5.1 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Copy env var | ||
run: cp .env-dist .env | ||
- name: Store Playwright's Version | ||
run: | | ||
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') | ||
echo "Playwright's Version: $PLAYWRIGHT_VERSION" | ||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | ||
- name: Cache Playwright Browsers for Playwright's Version | ||
id: cache-playwright-browsers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | ||
|
||
- name: Setup Playwright Browser | ||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Playwright tests - ${{ inputs.environment != null && inputs.environment || 'stage' }} | ||
if: github.actor != 'dependabot[bot]' | ||
run: npm run e2e:${{ inputs.type != null && inputs.type || '' }} | ||
timeout-minutes: 10 | ||
env: | ||
E2E_TEST_ENV: ${{ inputs.environment != null && inputs.environment || 'stage' }} | ||
E2E_TEST_BASE_URL: ${{ secrets.E2E_TEST_BASE_URL }} | ||
E2E_TEST_ACCOUNT_EMAIL: ${{ secrets.E2E_TEST_ACCOUNT_EMAIL }} | ||
E2E_TEST_ACCOUNT_PASSWORD: ${{ secrets.E2E_TEST_ACCOUNT_PASSWORD }} | ||
E2E_START_LOCAL_SERVER: 'false' | ||
ADMINS: ${{ secrets.ADMINS }} | ||
FXA_ENABLED: true | ||
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }} | ||
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} | ||
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} | ||
HIBP_KANON_API_TOKEN: ${{ secrets.HIBP_KANON_API_TOKEN }} | ||
HIBP_API_TOKEN: ${{ secrets.HIBP_API_TOKEN }} | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: test-results | ||
path: src/e2e/test-results/ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ storybook-static/ | |
|
||
# testing | ||
/coverage | ||
/src/e2e/test-results | ||
playwright-report | ||
|
||
# next.js | ||
/.next/ | ||
|
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
Oops, something went wrong.