Skip to content

Commit 00ad492

Browse files
committed
fix(ci): simplify to use bunx playwright like working example
Simplifies the script to use 'bunx playwright' directly, which Bun automatically resolves from the local installation. This matches the pattern used in other working projects.
1 parent 4074fd7 commit 00ad492

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

frontend/run-e2e-tests.sh

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,14 @@ if [ ! -d "node_modules" ]; then
5050
exit 1
5151
fi
5252

53-
# Try multiple methods to find and run Playwright
54-
# Method 1: Use node to run node_modules/.bin/playwright (most reliable)
55-
if [ -f "node_modules/.bin/playwright" ]; then
56-
PLAYWRIGHT_CMD="node node_modules/.bin/playwright"
57-
echo "Using: node node_modules/.bin/playwright"
58-
# Method 2: Try node require.resolve to find CLI directly
59-
elif PLAYWRIGHT_CLI=$(node -e "console.log(require.resolve('@playwright/test/cli.js'))" 2>/dev/null); then
60-
if [ -n "$PLAYWRIGHT_CLI" ] && [ -f "$PLAYWRIGHT_CLI" ]; then
61-
PLAYWRIGHT_CMD="node $PLAYWRIGHT_CLI"
62-
echo "Using: node $PLAYWRIGHT_CLI"
63-
fi
53+
# Use bunx to run playwright - Bun will automatically use the locally installed version
54+
# This matches the working pattern from other projects
55+
if ! command -v bunx >/dev/null 2>&1; then
56+
echo -e "${RED}Error: bunx not found. Bun is required to run tests.${NC}"
57+
exit 1
6458
fi
6559

66-
# Fallback methods if local installation not found
67-
if [ -z "$PLAYWRIGHT_CMD" ]; then
68-
# Method 3: Try using bunx (Bun's package runner)
69-
if command -v bunx >/dev/null 2>&1; then
70-
PLAYWRIGHT_CMD="bunx playwright"
71-
echo "Using: bunx playwright (fallback)"
72-
# Method 4: Try using npx as last resort
73-
elif command -v npx >/dev/null 2>&1; then
74-
PLAYWRIGHT_CMD="npx playwright"
75-
echo "Using: npx playwright (fallback)"
76-
else
77-
echo -e "${RED}Error: Could not find Playwright. Run 'bun install' first.${NC}"
78-
echo "Current directory: $(pwd)"
79-
exit 1
80-
fi
81-
fi
60+
PLAYWRIGHT_CMD="bunx playwright"
8261

8362
# Run each test file
8463
for test_file in "${TEST_FILES[@]}"; do

0 commit comments

Comments
 (0)