PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / scripts / setup-test-environment.sh

setup-test-environment.sh in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.7, at scripts/setup-test-environment.sh

32 lines 938 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 #!/bin/bash
2 set -euo pipefail
3
4 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5 REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
6 SETUP_SH="/var/www/html/wp-content/plugins/image-optimizer/tests/wp-env/config/setup.sh"
7
8 cd "$REPO_ROOT"
9
10 echo "[1/5] Building JS assets (npm run build)..."
11 npm run build
12
13 echo "[2/5] Installing Composer dependencies (no-dev)..."
14 composer install --no-dev --no-interaction --quiet
15
16 echo "[3/5] Starting WordPress environment (wp-env start)..."
17 npx wp-env start
18
19 echo "[4/5] Configuring WordPress (wp core install + plugin activate)..."
20 npx wp-env run cli -- bash "${SETUP_SH}"
21
22 echo "[5/5] Installing Playwright Chromium browser..."
23 npx playwright install chromium --with-deps
24
25 echo ""
26 echo "✔ Environment ready."
27 echo " WP Admin : http://localhost:8888/wp-admin/"
28 echo " Login : admin / password"
29 echo ""
30 echo "Run tests : npm run test:playwright"
31 echo "Debug UI : npm run test:playwright:debug"
32