Skip to content

Commit 283db33

Browse files
authored
docs: rewrite readme working directory description (#1005)
1 parent 895faa9 commit 283db33

1 file changed

Lines changed: 7 additions & 33 deletions

File tree

README.md

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -920,24 +920,9 @@ See the [example-custom-ci-build-id.yml](.github/workflows/example-custom-ci-bui
920920

921921
### Working directory
922922

923-
In a monorepo, the end-to-end or component test might be placed in a different sub-folder from the application itself.
923+
In a monorepo, the end-to-end or component test might be placed in a different sub-folder from the application itself. This sub-folder is the Cypress "working directory" which you can specify using the `working-directory` parameter.
924924

925-
Using a [Cypress legacy configuration](https://docs.cypress.io/guides/references/legacy-configuration) (Version 9 or earlier) the structure could look like this:
926-
927-
```text
928-
repo/
929-
app/
930-
app-test/
931-
cypress/
932-
fixtures/
933-
integration/
934-
plugins/
935-
support/
936-
cypress.json
937-
package.json
938-
```
939-
940-
For End-to-End testing using a [Cypress configuration](https://docs.cypress.io/guides/references/configuration) for Version 10 and later, the structure could look like this :
925+
In the following example of a directory layout for end-to-end testing, the Cypress working directory is `app-test`. The working directory contains the Cypress tests and a package manager lock file:
941926

942927
```text
943928
repo/
@@ -949,23 +934,10 @@ repo/
949934
support/
950935
cypress.config.js
951936
package.json
937+
package-lock.json
952938
```
953939

954-
Similarly for Component Testing with a [Cypress configuration](https://docs.cypress.io/guides/references/configuration) for Version 10 and later, the structure could look like this:
955-
956-
```text
957-
repo/
958-
app/
959-
app-test/
960-
cypress/
961-
component/
962-
fixtures/
963-
support/
964-
cypress.config.js
965-
package.json
966-
```
967-
968-
You can specify the `app-test` working directory when running Cypress tests using the `working-directory` parameter
940+
We use `working-directory: app-test` to match the above example directory structure:
969941

970942
```yml
971943
on: push
@@ -980,7 +952,9 @@ jobs:
980952
working-directory: app-test
981953
```
982954

983-
See [example-basic.yml](.github/workflows/example-basic.yml) for an End-to-End test example and [example-component-test.yml](.github/workflows/example-component-test.yml) for a Component test example, using the parameter `working-directory`.
955+
See the Cypress documentation [Folder structure](https://on.cypress.io/guides/core-concepts/writing-and-organizing-tests#Folder-Structure) section for examples of standard directory layouts, covering end-to-end testing and component testing with both JavaScript and TypeScript options.
956+
957+
Each of the examples in this monorepo is separated from other examples by using different working directories. See [example-basic.yml](.github/workflows/example-basic.yml) for one end-to-end test example using the parameter `working-directory` and [example-component-test.yml](.github/workflows/example-component-test.yml) for a component test example.
984958

985959
### Subfolders
986960

0 commit comments

Comments
 (0)