Example of using @currents/nx
plugin for integrating cypress with alternative orchestration services - Currents and Sorry Cypress
@currents/nx
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.
# 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"
{
"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
andrecordKey
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.
nx run frontend-e2e:currents --record --key <key> --ci-build-id hello-currents-nx
While having those options defined, you can omit the corresponding CLI flags:
nx run frontend-e2e:currents --ci-build-id hello-currents-nx-001
- Learn more about Parallelizing Cypress tests
- Explore how to use CI Build ID to organize your builds
Here's a visual example of this demo project sending the results to Currents dashboard