@@ -52,13 +52,16 @@ jobs:
5252 run : yarn --cwd docs-site build
5353
5454 - name : Install Playwright
55- run : npx playwright install --with-deps chromium
55+ run : |
56+ npm install playwright
57+ npx playwright install --with-deps chromium
5658
5759 - name : Start docs preview server
5860 run : yarn --cwd docs-site preview --host 0.0.0.0 --port 4173 &
5961
60- - name : Wait for server to start
61- run : sleep 5
62+ - name : Wait for server to be ready
63+ run : |
64+ timeout 30 bash -c 'until curl -s http://localhost:4173 > /dev/null; do sleep 1; done'
6265
6366 - name : Test docs site with Playwright
6467 run : |
@@ -70,10 +73,10 @@ jobs:
7073 const page = await browser.newPage();
7174
7275 try {
73- // Navigate to the docs site
76+ console.log('🚀 Navigating to docs site...');
7477 await page.goto('http://localhost:4173', { waitUntil: 'networkidle' });
7578
76- // Wait for and check that "React Datepicker" text is visible
79+ console.log('🔍 Looking for "React Datepicker" text...');
7780 await page.waitForSelector('text=React Datepicker', { timeout: 10000 });
7881
7982 // Additional checks
9699
97100 // Log page content for debugging
98101 const content = await page.content();
99- console.log('Page content preview:', content.substring(0, 500));
102+ console.log('🔍 Page content preview:');
103+ console.log(content.substring(0, 1000));
100104
101105 process.exit(1);
102106 } finally {
@@ -105,7 +109,7 @@ jobs:
105109 })();
106110 EOF
107111
108- npx playwright test test-docs.js || node test-docs.js
112+ node test-docs.js
109113
110114 - name : Upload screenshot on failure
111115 if : failure()
0 commit comments