mirror of
https://github.com/modelec/modelec.club.git
synced 2026-01-18 16:37:30 +01:00
Add cypress for e2e testing
This commit is contained in:
20
.github/workflows/deploy-test.yml
vendored
20
.github/workflows/deploy-test.yml
vendored
@@ -26,6 +26,26 @@ jobs:
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Install http-server
|
||||
run: npm install --save-dev http-server
|
||||
|
||||
- name: Start HTTP server
|
||||
run: npx http-server ./dist -p 8080 &
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Run Cypress tests and Browserslist
|
||||
run: npm run test
|
||||
env:
|
||||
CYPRESS_baseUrl: http://localhost:8080
|
||||
|
||||
- name: Upload Cypress screenshots
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cypress-screenshots
|
||||
path: cypress/screenshots
|
||||
|
||||
- name: Copy build directory to server
|
||||
uses: Dylan700/sftp-upload-action@v1.2.3
|
||||
with:
|
||||
|
||||
20
.github/workflows/deploy.yml
vendored
20
.github/workflows/deploy.yml
vendored
@@ -26,6 +26,26 @@ jobs:
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Install http-server
|
||||
run: npm install --save-dev http-server
|
||||
|
||||
- name: Start HTTP server
|
||||
run: npx http-server ./dist -p 8080 &
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Run Cypress tests and Browserslist
|
||||
run: npm run test
|
||||
env:
|
||||
CYPRESS_baseUrl: http://localhost:8080
|
||||
|
||||
- name: Upload Cypress screenshots
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cypress-screenshots
|
||||
path: cypress/screenshots
|
||||
|
||||
- name: Copy build directory to server
|
||||
uses: Dylan700/sftp-upload-action@v1.2.3
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user