-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
19 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 |
---|---|---|
@@ -1,29 +1,67 @@ | ||
name: Playwright Tests | ||
name: Playwright Tests - 2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '**' | ||
- 'frontend/**' | ||
- '.github/workflows/playwright.yml' | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
playwright-run: | ||
name: 'Playwright Tests' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
- name: 'Checking Out Code' | ||
uses: actions/checkout@v4 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'yarn' | ||
|
||
- name: Get yarn cache directory path | ||
working-directory: frontend | ||
id: yarn-cache-dir-path | ||
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: 'Installing Dependencies' | ||
working-directory: frontend/testing/playwright | ||
run: yarn | ||
- name: Install Playwright Browsers | ||
run: yarn playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: yarn playwright-e2e | ||
run: yarn install --immutable --inline-builds | ||
env: | ||
YARN_ENABLE_GLOBAL_CACHE: 'false' | ||
YARN_NM_MODE: 'hardlinks-local' | ||
HUSKY: '0' | ||
|
||
- name: Attempt to wait for deploy to environment (10 minutes sleep) | ||
run: sleep 10m | ||
shell: bash | ||
|
||
- name: Playwright run | ||
with: | ||
install: false | ||
working-directory: frontend/testing/playwright | ||
env: environment=dev,autoTestUserPwd=${{ secrets.AUTO_TEST_USER_PWD }},accessToken=${{ secrets.AUTO_TEST_USER_TOKEN_DEV }} | ||
spec: src/integration/studio/*.js | ||
record: true | ||
parallel: false | ||
env: | ||
PLAYWRIGHT_TEST_BASE_URL: 'https://dev.altinn.studio' | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Store artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
name: playwright-screenshots | ||
path: frontend/testing/playwright/screenshots |