Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sealights-cypress-plugin

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sealights-cypress-plugin

Support and config files for Cypress to support Sealights integration.

  • 2.0.25
  • npm
  • Socket score

Version published
Weekly downloads
162
decreased by-39.55%
Maintainers
1
Weekly downloads
 
Created
Source

sealights-cypress-plugin

sealights-cypress-plugin is a custom plugin for the Cypress testing framework that enhances your testing capabilities by providing additional support for various tasks and configurations.
This plugin adds support for Sealights, reporting coverage and test skipping as well.

Supported Node / Cypress versions

  • Node >= 12
  • Cypress >= 9

Features

  • Support File: The plugin introduces a support file, it is automatically loaded before each test, providing a centralized location to manage the Sealights information and execute the required hooks

  • Config File: The config file empowers the Cypress tests run by adding the required tasks and communicates with Sealights

Installation

To use sealights-cypress-plugin in your Cypress project, follow these steps:

  1. Install and Setup Cypress if you haven't already:

    npm install cypress --save-dev
    
  2. Install the plugin from GitHub/npm

    npm install sealights-cypress-plugin
    

Cypress v10+

In your cypress.config.js register the plugin:

const { defineConfig } = require('cypress');
const { registerSealightsTasks } = require('sealights-cypress-plugin');

module.exports = defineConfig({
  e2e: {
    experimentalInteractiveRunEvents: true,
    testIsolation: false,
    setupNodeEvents(on, config) {
      registerSealightsTasks(on, config);
    },
  },
});

Add to your cypress/support/e2e.js:

// This is your existing support/e2e.js file content
// ...

// Import sealights-cypress-plugin's support file
import 'sealights-cypress-plugin/support';

Cypress v9

Add to your cypress/plugins/index.js file

const { registerSealightsTasks } = require('sealights-cypress-plugin');

module.exports = (on, config) => {
  registerSealightsTasks(on, config);
  // IMPORTANT: return the config object
  // because the plugin might have changed it
  return config;
};

Add to your cypress/support/index.js file

import 'sealights-cypress-plugin/support';

Configuration

In order for the Sealights integration to work, three parameters have to be exported to the Cypress config.
This can be done using environment variables and exposing them to Cypress. The three environment variables are:

SL_BUILD_SESSION_ID // this or labId
SL_LAB_ID // this or buildSessionId
SL_TOKEN
SL_TEST_STAGE

For them to be available to Cypress, they have to be prefixed with CYPRESS_, for example:

export CYPRESS_SL_TOKEN={token}
export CYPRESS_SL_BUILD_SESSION_ID={buildSessionId}
export CYPRESS_SL_LAB_ID={labId}
export CYPRESS_SL_TEST_STAGE={your-test-stage}

More about defining the environment variables in Cypress at the following link: https://docs.cypress.io/guides/guides/environment-variables

FAQs

Package last updated on 22 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc