Cucumber

Use the installation instructions below if you're using Cucumber as your testing framework and would like to add your existing tests to Helios for complete E2E troubleshooting.

Navigate to your project's root directory, and install the latest Helios OpenTelemetry SDK:

npm install --save @heliosphere/opentelemetry-sdk

In your test file, paste the following code snippet before all other imports:

const { instrumentTests } = require('@heliosphere/opentelemetry-sdk');

instrumentTests({
    apiToken: <API_TOKEN>,
    environment: <ENVIRONMENT>,  // Defaults to process.env.NODE_ENV if omitted.
});
import { instrumentTests } from '@heliosphere/opentelemetry-sdk';

instrumentTests({
    apiToken: <API_TOKEN>,
    environment: <ENVIRONMENT>,  // Defaults to process.env.NODE_ENV if omitted.
});

Create a file with the following content:

const { wrapCucumber } = require('@heliosphere/opentelemetry-sdk');

wrapCucumber(require('@cucumber/cucumber'));
import { wrapCucumber } from '@heliosphere/opentelemetry-sdk';

import Cucumber from '@cucumber/cucumber';
wrapCucumber(Cucumber);

Make sure this file is loaded before all Cucumber step definitions.

You may optionally specify a mode parameter to the wrapCucumber command.
Values can either be:

  • SingleTest - creating a single Helios test from the entire Cucumber scenario.
  • TestPerStep - creating a Helios test per each Cucumber step.

πŸ‘

All set

Now when you run your tests - the results will show up in the Helios application and the URL of the exact test trace will be handily printed after each test run.


Did this page help you?