major features update
This commit is contained in:
parent
519fb49901
commit
4e2fab67c5
48 changed files with 3925 additions and 208 deletions
57
e2e/Taskfile
Executable file
57
e2e/Taskfile
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
#!/usr/bin/env bash
|
||||
PATH=$PATH:node_modules/.bin
|
||||
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
|
||||
|
||||
_playwright_version() {
|
||||
jq -r '.devDependencies["@playwright/test"]' "$SCRIPT_DIR/package.json" | sed -e 's/\^/v/'
|
||||
}
|
||||
|
||||
playwright:local() {
|
||||
exec docker run \
|
||||
--interactive --tty --rm --ipc=host --net=host \
|
||||
--volume "$SCRIPT_DIR":/e2e:rw --env BASE_URL="$BASE_URL" \
|
||||
--env ASTRO_TELEMETRY_DISABLED=1 \
|
||||
"mcr.microsoft.com/playwright:$(_playwright_version)" \
|
||||
bash -c "cd /e2e && env PROJECT_FILTER=firefox ./Taskfile _test $*"
|
||||
}
|
||||
|
||||
playwright:ui() {
|
||||
xhost +local:docker
|
||||
exec docker run \
|
||||
--interactive --tty --rm --ipc=host --net=host\
|
||||
--env DISPLAY="$DISPLAY" \
|
||||
--volume /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
--volume "$SCRIPT_DIR":/e2e:rw --env BASE_URL="$BASE_URL" \
|
||||
--env ASTRO_TELEMETRY_DISABLED=1 \
|
||||
"mcr.microsoft.com/playwright:$(_playwright_version)" \
|
||||
/bin/bash -c "cd /e2e && ./Taskfile _test --ui $*"
|
||||
}
|
||||
|
||||
playwright:ci() {
|
||||
exec docker run \
|
||||
--interactive --tty --rm --ipc=host --net=host \
|
||||
--volume "$SCRIPT_DIR":/e2e:rw --env BASE_URL="$BASE_URL" \
|
||||
--env ASTRO_TELEMETRY_DISABLED=1 \
|
||||
"mcr.microsoft.com/playwright:$(_playwright_version)" \
|
||||
bash -c "cd /e2e && ./Taskfile _test $*"
|
||||
}
|
||||
|
||||
_test:full() {
|
||||
if ! test -f /.dockerenv; then
|
||||
echo "Don't run _test directly; use playwright:local."
|
||||
fi
|
||||
|
||||
# run only in firefox first to see if there's errors and,
|
||||
# only if not, run in everything else
|
||||
env PROJECT_FILTER=firefox playwright test "$@" && \
|
||||
env PROJECT_FILTER=!firefox playwright test "$@"
|
||||
}
|
||||
_test() {
|
||||
if ! test -f /.dockerenv; then
|
||||
echo "Don't run _test directly; use playwright:local."
|
||||
fi
|
||||
|
||||
playwright test "$@"
|
||||
}
|
||||
|
||||
"$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue