https://github.com/currents-dev/currents-nx-example
https://github.com/currents-dev/currents-nx-example
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/currents-dev/currents-nx-example
- Owner: currents-dev
- Created: 2021-11-19T08:53:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T02:03:27.000Z (about 1 year ago)
- Last Synced: 2026-01-29T21:26:43.623Z (14 days ago)
- Language: TypeScript
- Size: 2.63 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# currents-nx-example
Example of using [`@currents/nx`](https://www.npmjs.com/package/@currents/nx) plugin for integrating cypress with alternative orchestration services - [Currents](https://currents.dev) and [Sorry Cypress](https://sorry-cypress.dev)
## Walkthrough
[`@currents/nx`](https://github.com/currents-dev/currents-nx/tree/main) is an NX plugin that runs cypress tests with the provided configuration options while using alternative orchestration services.
You can recreate the example following the next steps.
```sh
# Create an "empty" workspace
npx create-nx-workspace@latest currents-nx-example
cd currents-nx-example
# Create a dummy web project, choose any CSS styling
# That will create a new project with `@nrwl/cypress` pre-installed and configured
npm i -D @nx/web
nx g @nx/web:app frontend
# Install @currents/nx
npm i -D @currents/nx
# Configure a new target in apps/frontend-e2e/project.json
vim apps/frontend-e2e/project.json
```
Set executor value to `"@currents/nx:currents"`
```json
{
"executor": "@currents/nx:currents",
"options": {
"record": true,
"parallel": true,
"cypressConfig": "apps/app-e2e/cypres.config.ts",
"devServerTarget": "my-react-app:serve",
"testingType": "e2e"
}
}
```
- Get `projectId` and `recordKey` from https://app.currents.dev
- Update the projectId in `cypress.config.js` file
- Set the key either in configuration or as CLI flag
Now you can start recording your tests to Currents or Sorry Cypress.
```sh
nx run frontend-e2e:currents --record --key --ci-build-id hello-currents-nx
```
While having those options defined, you can omit the corresponding CLI flags:
```sh
nx run frontend-e2e:currents --ci-build-id hello-currents-nx-001
```
### Misc
- Learn more about [Parallelizing Cypress](https://currents.dev/readme/guides/parallelization) tests
- Explore how to use [CI Build ID](https://currents.dev/readme/guides/cypress-ci-build-id) to organize your builds
Here's a visual example of this demo project sending the results to Currents dashboard
