mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
build(examples): auto install playwright browsers (#1114)
This commit is contained in:
parent
dfd03d4f27
commit
af7e1d6a0f
2 changed files with 8 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
[tasks.web-test]
|
||||
dependencies = ["auto-setup", "cargo-leptos-e2e"]
|
||||
dependencies = ["auto-playwright-setup", "cargo-leptos-e2e"]
|
||||
|
||||
[tasks.clean-all]
|
||||
dependencies = ["clean-cargo", "clean-node_modules", "clean-playwright"]
|
||||
|
|
|
@ -60,9 +60,10 @@ description = "Runs end to end tests with cargo leptos"
|
|||
command = "cargo"
|
||||
args = ["leptos", "end-to-end"]
|
||||
|
||||
[tasks.setup]
|
||||
description = "Setup e2e dependencies"
|
||||
[tasks.setup-playwright]
|
||||
description = "Setup playwright and install browsers"
|
||||
cwd = "${END2END_DIR}"
|
||||
env = { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1" }
|
||||
script = '''
|
||||
BOLD="\e[1m"
|
||||
GREEN="\e[0;32m"
|
||||
|
@ -71,17 +72,19 @@ script = '''
|
|||
|
||||
if command -v pnpm; then
|
||||
pnpm install
|
||||
pnpm playwright install
|
||||
elif command -v npm; then
|
||||
npm install
|
||||
npx playwright install
|
||||
else
|
||||
echo "${RED}${BOLD}ERROR${RESET} - pnpm or npm is required by this task"
|
||||
exit 1
|
||||
fi
|
||||
'''
|
||||
|
||||
[tasks.auto-setup]
|
||||
[tasks.auto-playwright-setup]
|
||||
script = '''
|
||||
if [ ! -d "${END2END_DIR}/node_modules" ]; then
|
||||
cargo make setup
|
||||
cargo make setup-playwright
|
||||
fi
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue