-
Notifications
You must be signed in to change notification settings - Fork 64
Run e2e tests inside a docker container #1057
Changes from 36 commits
5550f4d
70f8d4f
ffb2515
1aa75c3
f07a35d
fb68359
76f09bf
3df4726
f93c2db
89c1a76
d7bfb0f
b16e674
4da0758
cdb9354
ac8b217
4e18ad2
11d0631
7daf4b0
855394a
8f2dda4
05acc05
fa5695f
b64f5a7
137f012
1528a28
824d162
1d1315e
7d545e6
51988cb
21cd355
b17a18b
fc96fd3
d5bcfce
2e2f444
a389bb2
cb6eddb
7ffc52d
66cffee
139f4c7
3f0d35e
b0ab0f1
99d5e35
7a9a526
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
# directories | ||
node_modules/ | ||
dist/ | ||
test/ | ||
.storybook/ | ||
.husky/ | ||
.github/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG PLAYWRIGHT_VERSION | ||
|
||
FROM mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION}-focal | ||
|
||
RUN npm install -g pnpm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/bash | ||
|
||
# todo: find a way to make this portable for Windows users so it can be used for the package.json script | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we can re-write this script using Node/JS to make it cross-platform? Not for this PR :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could... node's sub-process control is pretty weird, I could never really figure out how best to manage them, but could definitely be a solution! Actually, switching to |
||
|
||
export PLAYWRIGHT_VERSION=$(pnpm ls --dev --depth=0 | grep playwright | awk '{print $2}') | ||
export TEST_TYPE=$1 | ||
docker-compose -f docker-compose.playwright.yml run playwright |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: "3" | ||
services: | ||
playwright: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.playwright | ||
args: | ||
- PLAYWRIGHT_VERSION=${PLAYWRIGHT_VERSION} | ||
volumes: | ||
- .:/app | ||
user: ${PW_USER:-pwuser} | ||
working_dir: /app | ||
command: pnpm test:${TEST_TYPE}:local | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could do something here to log a message like so:
|
||
environment: | ||
- UPDATE_TAPES=${UPDATE_TAPES:-false} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,20 +14,25 @@ | |
"scripts": { | ||
"dev": "pnpm install && pnpm i18n:create-locales-list && pnpm i18n:update-locales && cross-env nuxt --hostname 0.0.0.0", | ||
"build": "pnpm i18n:get-translations && nuxt build", | ||
"build-only": "nuxt build", | ||
"generate": "nuxt generate", | ||
"start": "nuxt start", | ||
"prod": "pnpm build-only && pnpm start", | ||
"storybook": "nuxt storybook", | ||
"test": "jest", | ||
"test:all": "pnpm e2e:ci & jest", | ||
"test:all": "pnpm test:e2e & jest", | ||
"test:watch": "jest --collectCoverage=false --watch", | ||
"test:e2e": "playwright test", | ||
"test:e2e-debug": "PWDEBUG=1 playwright test", | ||
"build-and-e2e": "start-server-and-test 'cross-env API_URL=http://localhost:49152/ nuxt build && pnpm start' http://localhost:8443 test:e2e", | ||
"talkback": "node ./test/proxy.js", | ||
"pretest:e2e": "pnpm install", | ||
"test:e2e": "cross-env PLAYWRIGHT_VERSION=1.17.1 TEST_TYPE=e2e docker-compose -f docker-compose.playwright.yml up --abort-on-container-exit --exit-code-from playwright", | ||
"test:e2e:local": "playwright test -c test/e2e", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know we can have double There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah! I've used this package ( |
||
"test:e2e:debug": "cross-env PWDEBUG=1 pnpm test:e2e:local", | ||
"test:e2e:update-tapes": "npm-run-all delete-tapes update-tapes fix-tape-permissions --continue-on-error", | ||
"ci:unit-test": "jest --collectCoverage=false", | ||
"ci:e2e-test": "sh ./e2e.sh", | ||
"recreate-tapes": "rimraf test/tapes && sh ./e2e.sh -u", | ||
"update-tapes": "sh ./e2e.sh -u", | ||
"generate-e2e-tests": "playwright codegen localhost:8443/", | ||
"delete-tapes": "rimraf test/tapes", | ||
"update-tapes": "cross-env UPDATE_TAPES=true pnpm test:e2e", | ||
"fix-tape-permissions": "docker run -it --rm --mount type=bind,source=$(pwd),target=/app node:alpine chmod -R 0777 /app/test/tapes", | ||
"generate-playwright-test": "playwright codegen localhost:8443/", | ||
"types": "tsc --noEmit", | ||
"lint": "eslint --ext .js,.vue,.ts --ignore-path .gitignore --ignore-path .eslintignore .", | ||
"lintfix": "pnpm run lint -- --fix", | ||
|
@@ -123,13 +128,13 @@ | |
"jest": "^26.6.3", | ||
"jest-transform-stub": "^2.0.0", | ||
"lint-staged": "^11.1.1", | ||
"npm-run-all": "^4.1.5", | ||
"pinia": "^2.0.11", | ||
"postcss": "^8.4.5", | ||
"prettier": "^2.2.1", | ||
"rimraf": "^3.0.2", | ||
"sass": "^1.34.0", | ||
"sass-loader": "^10.1.1", | ||
"start-server-and-test": "^1.14.0", | ||
"tailwindcss": "^3.0.7", | ||
"tailwindcss-rtl": "^0.8.0", | ||
"talkback": "^2.5.0", | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition!