Skip to content

ci: ensure README files match #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
node-version: '22.14.0'
- name: Checkout
uses: actions/checkout@v2
- name: Ensure README files match
run: |
diff ./README.md ./lib/README.md
- name: Prepare demo-app
run: |
cd pizza-demo
Expand Down
58 changes: 38 additions & 20 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Reduce up to 40% your Cypress suite execution time parallelizing the test run on
## Install

```
npm i cypress-parallel
npm i cypress-parallel -D
```

or

```
yarn add cypress-parallel
yarn add cypress-parallel -D
```

## Add a new script
Expand All @@ -40,7 +40,7 @@ In your `package.json` add a new script:
"scripts" :{
...
"cy:run": "cypress run", // It can be any cypress command with any argument
"cy:parallel" : "cypress-parallel -s cy:run -t 2 -d <your-cypress-specs-folder> -a '\"<your-cypress-cmd-args>\"'"
"cy:parallel" : "cypress-parallel -s cy:run -t 2 -d '<your-cypress-specs-folder>' -a '\"<your-cypress-cmd-args>\"'"
...
}
```
Expand All @@ -64,26 +64,33 @@ or
Run with npx (no package installation needed)

```
npx cy:parallel -s cy:run -t 2 -d <your-cypress-specs-folder> -a '\"<your-cypress-cmd-args>\"'
npx cy:parallel -s cy:run -t 2 -d '<your-cypress-specs-folder>' -a '"<your-cypress-cmd-args>"'
```

## Passing Specs

```
cypress-parallel -s cy:run -t 2 -a '\"<your-cypress-cmd-args>\"' --spec path/to/spec1.spec.js path/to/spec2.spec.js
```

### Scripts options

| Option | Alias | Description | Type |
| ----------------- | ----- | ---------------------------------- | ------ |
| --help | | Show help | |
| --version | | Show version number | |
| --script | -s | Your npm Cypress command | string |
| --args | -a | Your npm Cypress command arguments | string |
| --threads | -t | Number of threads | number |
| --specsDir | -d | Cypress specs directory | string |
| --weightsJson | -w | Parallel weights json file | string |
| --reporter | -r | Reporter to pass to Cypress. | string |
| --reporterOptions | -o | Reporter options | string |
| --reporterModulePath | -n | Specify the reporter module path | string |
| --bail | -b | Exit on first failing thread | string |
| --verbose | -v | Some additional logging | string |
| --strictMode | -m | Add stricter checks after running the tests | boolean |
| Option | Alias | Description | Type |
| -------------------- | ----- | ------------------------------------------- | ------- |
| --help | | Show help | |
| --version | | Show version number | |
| --script | -s | Your npm Cypress command | string |
| --args | -a | Your npm Cypress command arguments | string |
| --threads | -t | Number of threads | number |
| --specsDir | -d | Cypress specs directory | string |
| --spec | | Cypress spec file paths | string |
| --weightsJson | -w | Parallel weights json file | string |
| --reporter | -r | Reporter to pass to Cypress. | string |
| --reporterOptions | -o | Reporter options | string |
| --reporterModulePath | -n | Specify the reporter module path | string |
| --bail | -b | Exit on first failing thread | string |
| --verbose | -v | Some additional logging | string |
| --strictMode | -m | Add stricter checks after running the tests | boolean |

**NB**: If you use *cypress-cucumber-preprocesor*, please **disable** the *strictMode* to avoid possible errors:

Expand All @@ -105,10 +112,21 @@ npx cy:parallel -s cy:run -t 2 -d <your-cypress-specs-folder> -a '\"<your-cypres
}
```

## Env variables

### CYPRESS_THREAD

You can get the current thread index by reading the `CYPRESS_THREAD` variable.

```javascript
const threadIndex = process.env.CYPRESS_THREAD;
// return 1, 2, 3, 4, ...
```

# Contributors

Looking for contributors.

# License

MIT
This project is licensed under the MIT license. See [LICENSE](LICENSE).