|
1 | | -name: Regression tests |
| 1 | +name: Cypress Tests |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - master |
6 | | - workflow_dispatch: |
7 | | -# schedule: |
8 | | -# - cron: "0 0 1 * *" // At 00:00 on day-of-month 1. |
| 7 | + pull_request: |
9 | 8 |
|
10 | 9 | jobs: |
11 | | - tests: |
12 | | - name: Regression test suite |
| 10 | + cypress: |
| 11 | + name: Run Cypress Tests |
13 | 12 | runs-on: ubuntu-latest |
| 13 | + |
14 | 14 | steps: |
15 | | - - name: Checkout to master branch |
16 | | - uses: actions/checkout@v2 |
17 | | - - name: Cypress run |
18 | | - uses: cypress-io/github-action@v2 |
| 15 | + # Step 1: Checkout the code |
| 16 | + - name: Checkout repository |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + # Step 2: Set up Node.js environment |
| 20 | + - name: Set up Node.js |
| 21 | + uses: actions/setup-node@v3 |
| 22 | + with: |
| 23 | + node-version: 18 |
| 24 | + |
| 25 | + # Step 3: Install dependencies |
| 26 | + - name: Install dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + # Step 4: Run Cypress tests |
| 30 | + - name: Run Cypress |
| 31 | + uses: cypress-io/github-action@v5 |
19 | 32 | with: |
20 | | - record: false |
21 | | - start: npx echo "Starting regression tests" |
22 | | - config: pageLoadTimeout=100000,retries=2,video=false |
23 | 33 | browser: chrome |
24 | | - env: |
25 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
26 | | - CYPRESS_username: ${{ secrets.USER }} |
27 | | - CYPRESS_password: ${{ secrets.PASS }} |
| 34 | + headless: true |
| 35 | + video: false |
| 36 | + |
| 37 | + # Step 5: Upload artifacts (optional, for videos/screenshots) |
| 38 | + - name: Upload artifacts |
| 39 | + if: always() # Ensure artifacts are uploaded even if the tests fail |
| 40 | + uses: actions/upload-artifact@v3 |
| 41 | + with: |
| 42 | + name: cypress-artifacts |
| 43 | + path: cypress/videos/ |
0 commit comments