Skip to content

Commit 7cc7caf

Browse files
DavertMikclaude
andcommitted
feat: add timeout investigation workflow and test script
- Created focused workflow to test specific scenarios with/without browser restart - Added local test script to debug timeout issue - Tests individual scenarios: within, config, session, and react tests - Each scenario has 3-minute timeout to identify problematic tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b035844 commit 7cc7caf

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Playwright Timeout Investigation
2+
3+
on:
4+
push:
5+
branches: [feat/esm]
6+
pull_request:
7+
branches: [feat/esm, 3.x]
8+
9+
jobs:
10+
test-specific-scenarios:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
scenario:
17+
- { name: 'within tests', grep: 'within' }
18+
- { name: 'config tests', grep: 'change config' }
19+
- { name: 'session tests', grep: 'session.*@Playwright' }
20+
- { name: 'react tests', grep: 'react.*@Playwright' }
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js 20.x
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20.x
28+
- uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: 7.4
31+
- name: npm install
32+
run: |
33+
npm i --force
34+
env:
35+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
36+
- name: Allow Release info Change
37+
run: |
38+
sudo apt-get update --allow-releaseinfo-change
39+
- name: Install browsers and deps
40+
run: npx playwright install && npx playwright install-deps
41+
- name: check
42+
run: './bin/codecept.js check -c test/acceptance/codecept.Playwright.js'
43+
timeout-minutes: 2
44+
- name: start a server
45+
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
46+
- name: start json-server
47+
run: 'npm run json-server &'
48+
- name: wait for servers
49+
run: 'sleep 3'
50+
- name: run ${{ matrix.scenario.name }} with restart==browser
51+
run: |
52+
echo "Testing ${{ matrix.scenario.name }}..."
53+
timeout 180 env BROWSER_RESTART=browser ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep "${{ matrix.scenario.grep }}" --verbose
54+
echo "Exit code: $?"
55+
timeout-minutes: 4
56+
continue-on-error: true
57+
- name: run ${{ matrix.scenario.name }} without restart
58+
run: |
59+
echo "Testing ${{ matrix.scenario.name }} without restart..."
60+
timeout 180 ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep "${{ matrix.scenario.grep }}" --verbose
61+
echo "Exit code: $?"
62+
timeout-minutes: 4
63+
continue-on-error: true

test-playwright-debug.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Test script to debug Playwright timeout issue
4+
# Tests individual files and then all together
5+
6+
echo "=== Testing Playwright with browser restart ==="
7+
8+
# Start servers
9+
echo "Starting servers..."
10+
php -S 127.0.0.1:8000 -t test/data/app > /dev/null 2>&1 &
11+
PHP_PID=$!
12+
npm run json-server > /dev/null 2>&1 &
13+
JSON_PID=$!
14+
15+
sleep 3
16+
17+
# Create config files for individual tests
18+
echo "Creating config files..."
19+
cp test/acceptance/codecept.Playwright.js test/acceptance/codecept.Playwright.within.js
20+
sed -i 's/tests: ".\/\\*_test.js"/tests: ".\/within_test.js"/' test/acceptance/codecept.Playwright.within.js
21+
22+
cp test/acceptance/codecept.Playwright.js test/acceptance/codecept.Playwright.config.js
23+
sed -i 's/tests: ".\/\\*_test.js"/tests: ".\/config_test.js"/' test/acceptance/codecept.Playwright.config.js
24+
25+
# Test individual files
26+
echo "=== Testing within_test.js ==="
27+
timeout 120 env BROWSER_RESTART=browser ./bin/codecept.js run --config test/acceptance/codecept.Playwright.within.js --grep @Playwright --verbose
28+
echo ""
29+
30+
echo "=== Testing config_test.js ==="
31+
timeout 120 env BROWSER_RESTART=browser ./bin/codecept.js run --config test/acceptance/codecept.Playwright.config.js --grep @Playwright --verbose
32+
echo ""
33+
34+
echo "=== Testing both files together ==="
35+
timeout 120 env BROWSER_RESTART=browser ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --grep @Playwright --verbose --grep "within on form|change config"
36+
echo ""
37+
38+
echo "=== Testing all Playwright tests ==="
39+
timeout 300 env BROWSER_RESTART=browser ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --grep @Playwright --verbose
40+
echo ""
41+
42+
# Cleanup
43+
echo "Cleaning up..."
44+
kill $PHP_PID $JSON_PID 2>/dev/null
45+
rm -f test/acceptance/codecept.Playwright.within.js test/acceptance/codecept.Playwright.config.js
46+
47+
echo "Done!"

0 commit comments

Comments
 (0)