Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,34 @@ jobs:

- name: Get Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(jq -r .dependencies.playwright package.json)" >> "$GITHUB_OUTPUT"
run: echo "PLAYWRIGHT_VERSION=$(jq -r '.devDependencies["@playwright/test"]' package.json)" >> "$GITHUB_OUTPUT"
- name: Start Playwright container
run: |
CONTAINER_ID=$(docker create \
--network host \
-it \
--rm \
--init \
--workdir /home/pwuser \
--user pwuser \
mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-noble \
npx -y playwright@$PLAYWRIGHT_VERSION run-server --port 3000 --host 0.0.0.0 \
)
docker start $CONTAINER_ID
echo "CONTAINER_ID=$CONTAINER_ID" >> "$GITHUB_ENV"
env:
PLAYWRIGHT_VERSION: ${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}

- name: Install dependencies
run: pnpm install

- name: Build app
run: pnpm build

- name: Restore Playwright browsers from cache
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
restore-keys: |
${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-
${{ runner.os }}-playwright-

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Run Playwright tests
run: pnpm run test:e2e --shard=${{ matrix.shard }}
env:
PW_TEST_CONNECT_WS_ENDPOINT: "ws://127.0.0.1:3000/"
- name: Stop Playwright container
run: |
docker stop $CONTAINER_ID
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@antfu/eslint-config": "^0.41.0",
"@iconify-json/mdi": "^1.1.50",
"@intlify/unplugin-vue-i18n": "^2.0.0",
"@playwright/test": "^1.32.3",
"@playwright/test": "1.55.0",
"@rushstack/eslint-patch": "^1.2.0",
"@tsconfig/node18": "^18.2.0",
"@types/bcryptjs": "^2.4.2",
Expand Down
Loading
Loading