Skip to content

currents-dev/currents-nx-example

Repository files navigation

currents-nx-example

Example of using @currents/nx plugin for integrating cypress with alternative orchestration services - Currents and Sorry Cypress

Walkthrough

@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 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.

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

Misc

Here's a visual example of this demo project sending the results to Currents dashboard

Kapture 2021-11-19 at 01 14 50

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published