Skip to content

Commit ecd422a

Browse files
authored
Add E2E Cypress testing workflow (e2e-tests.yml)
- Created e2e-tests.yml to run Cypress end-to-end tests after deployment to the staging environment. - Configured workflow to trigger after the Staging Deployment workflow completes. - Includes steps to set up Node.js, install dependencies, start the staging server, and execute Cypress tests. - This workflow ensures comprehensive testing of the entire user workflow in a staging environment. This addition automates E2E testing to verify functionality across the user journey before production deployment.
1 parent 47abbf9 commit ecd422a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: End-to-End (E2E) Testing
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Staging Deployment"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
e2e-tests:
11+
name: Run E2E Tests with Cypress
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '16'
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Install Cypress
27+
run: npm install cypress --save-dev
28+
29+
- name: Start Staging Server
30+
# This should start your staging server for Cypress to test against.
31+
# Replace 'npm run start-staging' with the actual command that starts your staging environment.
32+
run: npm run start-staging &
33+
env:
34+
STAGING_API_KEY: ${{ secrets.STAGING_API_KEY }}
35+
STAGING_API_URL: ${{ secrets.STAGING_API_URL }}
36+
37+
- name: Run Cypress Tests
38+
run: npx cypress run

0 commit comments

Comments
 (0)