1.0.13 • Published 9 months ago

@orangebeard-io/cypress-listener v1.0.13

Weekly downloads
-
License
AGPL-3.0
Repository
-
Last release
9 months ago

Installation

Install the npm package

npm install @orangebeard-io/cypress-listener

Configuration

In your cypress.config.js file, provide the necessary configuration for the listener and the plugin:

const { defineConfig } = require('cypress');
const registerOrangebeardPlugin = require('@orangebeard-io/cypress-listener/lib/plugin');
const glob = require('glob');
const delay = async (ms) => new Promise((res) => setTimeout(res, ms));

module.exports = defineConfig({
  "reporter": "@orangebeard-io/cypress-listener",
  "reporterOptions": {
    "endpoint": "http://tenant.orangebeard.app",
    "token": "00000000-0000-0000-0000-00000000",
    "testset": "Cypress.io test run",
    "project": "project_name",
    "description": "A description of the test run"
  },
  e2e: {
    setupNodeEvents(on, config) {
      // !Important: Keep Cypress running until the listener is finished, preventing unfinished runs in Orangebeard
      on('after:run', async () => {
        console.log('Wait for Orangebeard listener to finish reporting...');
        while (glob.sync('orangebeard-*.lock').length > 0) {
          console.log(glob.sync('orangebeard-*.lock'))
          await delay(1000);
        }
        console.log('Orangebeard listener finished');
      });
      registerOrangebeardPlugin(on, config);
      return config;
    },
  },
});

Running

Now run your tests normally using cypress run and get results in Orangebeard!

Note that when running a subset from the commandline, you will have to use the --config flag, as the --spec flag will not be passed to the reporter, resulting in the reporter to expect all specs in the project and thus not finishing up correctly.

Example:

cypress run --browser chrome --config "specPattern=cypress/e2e/somespec/*.cy.js"

or:

cypress run --browser chrome --config '{"specPattern":["cypress/e2e/somespec/*.cy.js"]}'

Using the --reporter-options or -o flag, it is also possible to provide reporter options from the command line.

1.0.2

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.1

2 years ago

1.0.0

2 years ago