Skip to content

Commit 472c0f5

Browse files
puppeteer
1 parent 3a0e057 commit 472c0f5

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

.github/workflows/integration.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,37 @@ jobs:
5252
export default App
5353
EOF
5454
55+
- name: Install Puppeteer
56+
run: |
57+
cd integration
58+
npm i puppeteer
59+
5560
- name: Build Integration Project
5661
run: |
5762
cd integration
5863
npm run build || exit 1
5964
60-
- name: Start React App
65+
- name: Create Puppeteer Script
6166
run: |
62-
cd integration
63-
npm start &
64-
sleep 60
65-
curl http://localhost:3000 -o output.html || exit 1
67+
cat <<EOF > integration/integration.js
68+
const puppeteer = require('puppeteer')
69+
(async () => {
70+
const browser = await puppeteer.launch({
71+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
72+
})
73+
const page = await browser.newPage()
74+
await page.goto('http://localhost:3000', { waitUntil: 'networkidle0' })
75+
await page.waitForSelector('div[style*="display: flex"]', { timeout: 5000 })
76+
.catch(() => {
77+
process.exit(1)
78+
})
79+
await browser.close()
80+
})()
81+
EOF
6682
67-
- name: Validate Rendered Output
83+
- name: Test For FetchLoading Component
6884
run: |
6985
cd integration
70-
grep "fetch-loading" output.html || (cat output.html && exit 1)
86+
npm start &
87+
sleep 60
88+
node integration.js

0 commit comments

Comments
 (0)