Skip to content

Commit

Permalink
docs: rework subfolders example
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcC399 committed Sep 15, 2023
1 parent a468132 commit 68035e2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -958,23 +958,23 @@ Each of the examples in this monorepo is separated from other examples by using

### Subfolders

Sometimes Cypress and end-to-end tests have their own `package.json` file in a subfolder, like
Sometimes the application under test and the Cypress end-to-end tests may have separately defined dependencies. In the example below, Cypress has its own `package.json` file in a subfolder:

```text
root/
e2e/
(code for installing and running Cypress tests)
package.json
package-lock.json
cypress.json
cypress
cypress.config.js
cypress/
(code for running the "app" with "npm start")
package.json
yarn.lock
package-lock.json
```

In that case you can combine this action with [bahmutov/npm-install](https://github.com/bahmutov/npm-install) action to install dependencies separately.
In this case you can first install the dependencies for the application (`npm ci`), then start the application server (`npm start`) before calling `cypress-io/github-action` to install the dependencies for Cypress and to run Cypress. You may also need to use the [wait-on](#wait-on) parameter to make sure that the app server is fully available.

```yml
name: E2E
Expand All @@ -985,7 +985,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install root dependencies
uses: bahmutov/npm-install@v1
run: npm ci
- name: Start server in the background
run: npm start &
Expand Down

0 comments on commit 68035e2

Please sign in to comment.