@@ -52,13 +52,16 @@ jobs:
52
52
run : yarn --cwd docs-site build
53
53
54
54
- name : Install Playwright
55
- run : npx playwright install --with-deps chromium
55
+ run : |
56
+ npm install playwright
57
+ npx playwright install --with-deps chromium
56
58
57
59
- name : Start docs preview server
58
60
run : yarn --cwd docs-site preview --host 0.0.0.0 --port 4173 &
59
61
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'
62
65
63
66
- name : Test docs site with Playwright
64
67
run : |
@@ -70,10 +73,10 @@ jobs:
70
73
const page = await browser.newPage();
71
74
72
75
try {
73
- // Navigate to the docs site
76
+ console.log('🚀 Navigating to docs site...');
74
77
await page.goto('http://localhost:4173', { waitUntil: 'networkidle' });
75
78
76
- // Wait for and check that "React Datepicker" text is visible
79
+ console.log('🔍 Looking for "React Datepicker" text...');
77
80
await page.waitForSelector('text=React Datepicker', { timeout: 10000 });
78
81
79
82
// Additional checks
96
99
97
100
// Log page content for debugging
98
101
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));
100
104
101
105
process.exit(1);
102
106
} finally {
@@ -105,7 +109,7 @@ jobs:
105
109
})();
106
110
EOF
107
111
108
- npx playwright test test-docs.js || node test-docs.js
112
+ node test-docs.js
109
113
110
114
- name : Upload screenshot on failure
111
115
if : failure()
0 commit comments