added some configs to debug test #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Debug Widget Tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'tests/**' | |
| - 'src/widget/**' | |
| - 'playwright.config.ts' | |
| - '.github/workflows/debug-tests.yml' | |
| jobs: | |
| debug: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build widget | |
| run: npm run build:widget | |
| - name: List built files | |
| run: | | |
| echo "=== Contents of dist directory ===" | |
| ls -la dist/ | |
| echo "=== Size of widget.umd.js ===" | |
| wc -c dist/widget.umd.js | |
| - name: Test serve command | |
| run: | | |
| echo "=== Testing serve command ===" | |
| npx serve --version | |
| npx serve -s . -p 3000 & | |
| SERVER_PID=$! | |
| echo "Server started with PID: $SERVER_PID" | |
| sleep 5 | |
| echo "=== Testing server responses ===" | |
| curl -I http://localhost:3000/test-widget-embed.html || echo "Failed to access HTML" | |
| curl -I http://localhost:3000/dist/widget.umd.js || echo "Failed to access JS" | |
| curl -I http://localhost:3000/dist/style.css || echo "Failed to access CSS" | |
| kill $SERVER_PID | |
| - name: Run single test with debug | |
| run: | | |
| echo "=== Running test with debug output ===" | |
| DEBUG=pw:api npx playwright test tests/widget-embed.spec.ts:9:3 --reporter=list || true | |
| - name: Check widget content | |
| run: | | |
| echo "=== First 50 lines of widget.umd.js ===" | |
| head -n 50 dist/widget.umd.js | |
| echo "=== Last 50 lines of widget.umd.js ===" | |
| tail -n 50 dist/widget.umd.js | |
| echo "=== Searching for WidgetLoader in widget.umd.js ===" | |
| grep -n "WidgetLoader" dist/widget.umd.js | head -20 || echo "WidgetLoader not found" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debug-results | |
| path: | | |
| test-results/ | |
| playwright-report/ | |
| retention-days: 7 |