Skip to content

Commit

Permalink
Replace most pnpx with pnpm exec and fix running sub-make cmds in Win…
Browse files Browse the repository at this point in the history
…dows
  • Loading branch information
myieye committed May 24, 2024
1 parent d65aacb commit d4b2dc6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ ui-builder:
.PHONY: e2e-tests-ci
e2e-tests-ci:
pnpm install
$(MAKE) e2e-app
pnpx playwright install ${browser} --with-deps
pnpx playwright test -c ./test/e2e/playwright.config.ts --project=${browser} --shard=${shard}
"$(MAKE)" e2e-app
pnpm exec playwright install ${browser} --with-deps
pnpm exec playwright test -c ./test/e2e/playwright.config.ts --project=${browser} --shard=${shard}

.PHONY: e2e-tests
e2e-tests: ui-builder
pnpm install
$(MAKE) e2e-app
pnpx playwright install chromium firefox
pnpx playwright test -c ./test/e2e/playwright.config.ts $(params)
"$(MAKE)" e2e-app
pnpm exec playwright install chromium firefox
pnpm exec playwright test -c ./test/e2e/playwright.config.ts $(params)

.PHONY: e2e-app
e2e-app:
# delete any cached session storage state files if the service isn't running
docker compose ps e2e-app > /dev/null 2>&1 || $(MAKE) clean-test
docker compose ps e2e-app > /dev/null 2>&1 || "$(MAKE)" clean-test
docker compose up -d e2e-app --build

.PHONY: unit-tests
Expand Down Expand Up @@ -87,7 +87,7 @@ clean-test:

.PHONY: clean-powerwash
clean-powerwash: clean
$(MAKE) clean-test
"$(MAKE)" clean-test
docker system prune -f --volumes
- docker rmi -f `docker images -q "lf-*"` sillsdev/web-languageforge:base-php
docker builder prune -f
4 changes: 2 additions & 2 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ ngrok will return two URLs, one http and one https, that contain what is being s

### Running Playwright E2E Tests

Before running Playwright tests for the first time use `pnpx playwright install --with-deps chromium` to install chromium with its dependencies. It will ask for root access.
After Playwright updates, you'll likely need to run `pnpx playwright install` to update the browsers, but Playwright should provide fairly explicit failure logs if that's the case.
Before running Playwright tests for the first time use `pnpm exec playwright install --with-deps chromium` to install chromium with its dependencies. It will ask for root access.
After Playwright updates, you'll likely need to run `pnpm exec playwright install` to update the browsers, but Playwright should provide fairly explicit failure logs if that's the case.

1. `make e2e-tests`
1. Test results will appear in your terminal
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"webpack:dev:watch": "webpack -w --config webpack-dev.config.js",
"webpack:prd": "webpack --config webpack-prd.config.js",
"compile-test-e2e": "tsc -p test/app",
"test-e2e": "pnpx playwright test -c ./test/e2e/playwright.config.ts",
"test-e2e-report": "pnpx playwright show-report ./test/e2e/test-results/_html-report",
"test-e2e": "pnpm exec playwright test -c ./test/e2e/playwright.config.ts",
"test-e2e-report": "pnpm exec playwright show-report ./test/e2e/test-results/_html-report",
"prepare": "husky install"
},
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/playwright_guide/playwright_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Notice the useful options in the test side bar above:

Standard usage:

- From root: `pnpx playwright test -c ./test/e2e/playwright.config.ts [other options]`
- From root: `pnpm exec playwright test -c ./test/e2e/playwright.config.ts [other options]`
- Or simply: `pnpm run test-e2e [-- other options]`

Tips:
Expand Down

0 comments on commit d4b2dc6

Please sign in to comment.