Skip to content

Commit

Permalink
refactor: ♻️ Update GitHub workflows for Cypress and Playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
singhAmandeep007 committed Oct 1, 2024
1 parent 6772e7f commit 8298526
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 26 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Cypress Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
cypress-test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: |
npm ci
npm run cy:install
- name: Run Cypress e2e tests
run: npm run cy:test
- name: Upload Cypress screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
retention-days: 5
- name: Upload Cypress videos
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos
retention-days: 5
- name: Upload HTML report
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-html-report
path: reports/cypress/result/html
retention-days: 5
- name: Upload XML report
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-xml-report
path: reports/cypress/result/xml/combined-xml-report.xml
retention-days: 5
- name: Upload JSON report
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-json-report
path: reports/cypress/result/json/combined-json-report.json
retention-days: 5
38 changes: 19 additions & 19 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
jobs:
test:
playwright-test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 5
19 changes: 12 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
# testing
/reports

# cypress
/cypress/screenshots
/cypress/videos

# playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

# production
/build

Expand All @@ -18,18 +28,13 @@
.env.test.local
.env.production.local

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# storybook
*storybook.log

/src/stories
# playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/


TODO.TODO

0 comments on commit 8298526

Please sign in to comment.