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:
52
52
export default App
53
53
EOF
54
54
55
+ - name : Install Puppeteer
56
+ run : |
57
+ cd integration
58
+ npm i puppeteer
59
+
55
60
- name : Build Integration Project
56
61
run : |
57
62
cd integration
58
63
npm run build || exit 1
59
64
60
- - name : Start React App
65
+ - name : Create Puppeteer Script
61
66
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
66
82
67
- - name : Validate Rendered Output
83
+ - name : Test For FetchLoading Component
68
84
run : |
69
85
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