Skip to content

Commit

Permalink
Test(repo): Introduce commands for updating E2E tests
Browse files Browse the repository at this point in the history
refs #DS-1094
  • Loading branch information
literat committed Dec 18, 2023
1 parent 8f94f24 commit b28ead7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ test: ## Run tests in all packages
test-e2e: ## Run End-to-End tests
./bin/make/e2e.sh

test-e2e-update: ## Update snapshots for End-to-End tests
./bin/make/e2e.sh --update

test-e2e-report: ## Open report for End-to-End tests
./bin/make/e2e.sh --report

test-e2e-ui: ## Open UI for End-to-End tests
./bin/make/e2e.sh --ui

types: ## Check types in all packages
$(PKG_MANAGER) types

Expand Down
27 changes: 26 additions & 1 deletion bin/make/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,29 @@ set -o errexit
PLAYWRIGHT_VERSION=1.40.1
UBUNTU_VERSION=jammy

docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-$UBUNTU_VERSION yarn test:e2e
E2E_FLAG=""
XVFB=""

while [[ $# -gt 0 ]]; do
case "$1" in
--update)
E2E_FLAG=":update"
;;
--ui)
E2E_FLAG=":ui"
# https://playwright.dev/docs/next/ci#running-headed
XVFB="xvfb-run"
;;
--report)
E2E_FLAG=":report"
;;
*)
# Unknown option
echo "Unknown option: $1"
exit 1
;;
esac
shift
done

docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-$UBUNTU_VERSION $XVFB yarn test:e2e$E2E_FLAG

0 comments on commit b28ead7

Please sign in to comment.