File tree Expand file tree Collapse file tree 1 file changed +25
-7
lines changed
Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments