# Cucumber JS framework

If your testing framework is [Cucumber.js](https://cucumber.io/docs/installation/javascript/), the SeaLights agent integrates directly with it and reports the test results to the server directly.

{% hint style="info" %}
See <https://www.npmjs.com/package/sealights-cucumber-plugin> for details.
{% endhint %}

## Configuration

{% stepper %}
{% step %}

#### Installing Sealights plugin

<pre data-overflow="wrap" data-line-numbers><code><strong>npm install sealights-cucumber-plugin
</strong></code></pre>

{% endstep %}

{% step %}

#### Using the Sealights plugin with the Cucumber command <a href="#using-the-sealights-plugin-with-cucumber-command" id="using-the-sealights-plugin-with-cucumber-command"></a>

From the command line, add sealights parameters with `--sl-` prefix in addition to the `--require` argument specifying the Sealights plugin

{% code overflow="wrap" lineNumbers="true" %}

```
node_modules/.bin/cucumber-js ./features --require sealights-cucumber-plugin --sl-tokenfile <path/to/token-file> --sl-labid <lab-id> --sl-testStage <test-stage-name>
```

{% endcode %}
{% endstep %}
{% endstepper %}

## Using the Sealights plugin with Protractor configuration <a href="#using-the-sealights-plugin-with-protractor-configuration" id="using-the-sealights-plugin-with-protractor-configuration"></a>

If you're running your Cucumber.JS tests with Protactor, in addition to the `sealights-protractor-plugin`, you need to specify in your `protractor.conf.js` file the required Sealights Cucumber plugin installed above.

{% code overflow="wrap" lineNumbers="true" %}

```json
cucumberOpts: {
    require: [
      './src/steps/*.steps.ts',
      require.resolve('sealights-cucumber-plugin')
    ]
  },
```

{% endcode %}

{% hint style="warning" %}
For more details about the `sealights-protractor-plugin`, please refer to the following page: <https://www.npmjs.com/package/sealights-protractor-plugin>
{% endhint %}

## Parameters details <a href="#parameters-details" id="parameters-details"></a>

<table><thead><tr><th width="211.0482177734375">Parameter</th><th width="117">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td><code>sl-token</code> or <code>sl-tokenFile</code></td><td>Yes</td><td>Access token generated from the SeaLights server provided directly or via the path to file containing it</td></tr><tr><td><code>sl-testStage</code></td><td>Yes</td><td>Name of the test stage</td></tr><tr><td><code>sl-labid</code></td><td>Yes</td><td>Unique ID for the test environment (lab). Used to associate test results with the correct build.</td></tr><tr><td><code>sl-buildSessionId</code> or <code>sl-buildSessionIdFile</code></td><td>No</td><td>(Deprecated) Build Session ID. Use <code>sl-labid</code> instead.</td></tr><tr><td><code>sl-proxy</code></td><td>Optional</td><td>Address of proxy to run connection through</td></tr></tbody></table>

{% hint style="info" %}
To enable logging, please refer to the slnodejs agent command reference documentation page: [Command Reference](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/command-reference.md#logging)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-testing-plugins/cucumber-js-framework.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
