Skip to content

Commit

Permalink
Fix GitHub Actions Workflow for Cypress Tests
Browse files Browse the repository at this point in the history
- Updated `.github/workflows/cypress.yml` to ensure the application server starts before running Cypress tests.
- Verified that `package.json` and `package-lock.json` include all necessary dependencies for the application and Cypress.
- Adjusted Cypress configuration to ensure correct `baseUrl` for server connectivity in the CI environment.

This fix addresses issues with Cypress being unable to connect to the server during GitHub Actions runs.
  • Loading branch information
Programmer-RD-AI committed Aug 8, 2024
1 parent cfae3d6 commit 5b383bb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# Install npm dependencies, cache them correctly
# and run all Cypress tests

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # Use the appropriate Node.js version for your project

- name: Install dependencies
run: npm ci

- name: Start application server
run: npm run dev &
env:
NODE_ENV: development

- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: npm run dev
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"eslint": "^8.28.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.9",
"prettier": "^3.3.3",
"vite": "^4.1.0"
}
Expand Down

0 comments on commit 5b383bb

Please sign in to comment.