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

sealights-cucumber-plugin

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sealights-cucumber-plugin

Cucumber integration for sealights

  • 2.0.92
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
358
decreased by-44.41%
Maintainers
0
Weekly downloads
 
Created
Source

sealights-cucumber-plugin

This is the sealights plugin for Cucumber.js.

Install

npm install sealights-cucumber-plugin

Usage

Pass path-to-plugin as require option of cucumber command

npx cucumber-js ./features ... --require <path-to-plugin>

Or set it in config file

// cucumber.js
module.exports = {
  default: {
    ...
    require: [
      './features/support/*',
      '<path-to-plugin>',
    ]
  }
};

Note: Usage of --require option override default definition of path to step definitions. Pass it explicitly if you don't do it yet. Example:

npx cucumber-js ./features --require ./src/steps/*.steps.ts --require <path-to-plugin>

Resolve path to plugin

Resolve path to plugin dynamically

CommonJs

const pathToPlugin = require.resolve('sealights-cucumber-plugin');

ESM

import url from 'node:url';

const pluginUrl = import.meta.resolve('sealights-cucumber-plugin');
const pathToPlugin = url.fileURLToPath(new URL(pluginUrl));

Resolve in CLI

Execution of next command allow to resolve path in CLI if node available on machine

Unix:

SL_PACKAGE=$(node -p "require.resolve('sealights-cucumber-plugin')")

PowerShell:

$Env:SL_PACKAGE = node -p "require.resolve('sealights-cucumber-plugin')"

If any of this option don't work for you can use static path to plugin ./node_modules/sealight-cucumber/plugin/tsOutputs/lib/cucumber-integration.js But it is not recommended and it can be changed.

Usage in protractor.conf or wdio.conf

Pass path-to-plugin as require option of cucumber command

cucumberOpts: {
    require: [
      './src/steps/*.steps.ts',
      '<path-to-plugin>'
    ]
  },

Passing parameters

Passing parameters to plugin via config file

Create a file sl.conf and fill it with config in JSON format

{
  tokenfile: <path/to/token-file>,
  buildsessionidfile: <path/to/buildSessionId-file>,
  testStage: e2e,
}

Passing parameters to reporter via CLI

!!! Not recommended. This case won`t work in the latest version of cucumber, use file config instead

From the command line add sealights parameters with --sl- prefix

npx cucumber-js ./features --sl-tokenfile <path/to/token-file>  --sl-buildsessionidfile <path/to/buildSessionId-file> --sl-testStage e2e

Supported parameters

  • token - Sealights token
  • tokenFile - Path to file contains the Sealights token
  • buildSessionId - Sealights build session id
  • buildSessionIdFile - Path to file contains the Sealights build session id
  • testStage - Test stage current tests are relates to
  • labId - Pre-defined Sealights lab-id (optional)
  • proxy - Proxy server (optional)

Author

Sealights

FAQs

Package last updated on 29 Sep 2024

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