Skip to content

Commit

Permalink
test: playwright docker script
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVidra committed Jan 12, 2024
1 parent 82c6f45 commit 14f4bc2
Show file tree
Hide file tree
Showing 78 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
name: test-results
path: test-results/
retention-days: 30
8 changes: 8 additions & 0 deletions docker_playwright_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# This script is run inside the docker container to run all playwright tests

cd app
npm i -g pnpm
pnpm i
pnpm run playwright
10 changes: 10 additions & 0 deletions docker_run_playwright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Run this script to start docker container and run all playwright tests

docker run -it --rm --ipc=host \
--mount type=bind,src=.,dst=/app \
--mount type=volume,dst=/app/node_modules \
--mount type=volume,dst=/app/.pnpm-store \
mcr.microsoft.com/playwright:v1.40.0-jammy \
/app/docker_playwright_script.sh
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"test:watch": "jest --watch",
"tsc": "tsc -p tsconfig.lib.json",
"playwright": "playwright test",
"playwright:docker": "./docker_run_playwright.sh",
"serve:test": "vite"
},
"dependencies": {
Expand Down
3 changes: 1 addition & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export default defineConfig({
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL: "http://localhost:3000",
Expand All @@ -21,6 +19,7 @@ export default defineConfig({
},
webServer: {
command: "npm run serve:test",
url: "http://localhost:3000",
},

/* Configure projects for major browsers */
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
1 change: 1 addition & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- This file is for the server to respond to / request -->

0 comments on commit 14f4bc2

Please sign in to comment.