Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Using cucumber, scripts exception ends in a passing test

Open
#2,773 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
testing

Research direction

Reproduce the failure using the reported CodeceptJS 3.0.4 configuration, focusing on the gherkin features and steps configured under the gherkin section, in both UI and headless modes. Trace how a JavaScript exception from a Cucumber step is reported; done means the scenario fails and the exception is logged in both execution modes.

Written by the indexing model from the issue text.

Description

What are you trying to achieve?

I am using cucumber to write the tests.

A step for some reasons throws a javascript exception.

What do you get instead?

The scenario execution stops without any log, and test is considered as "passing".

This happens whenever I use the UI executor or the headless mode.

Details
  • CodeceptJS version: 3.0.4
  • NodeJS Version: 14.15.4
  • Operating System:
  • puppeteer
  • Configuration file:
require('ts-node/register');
const { setHeadlessWhen, setSharedCookies } = require('@codeceptjs/configure');

// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
setSharedCookies();

process.env.TEST_URL = process.env.TEST_URL || 'http://localhost:3000';

// eslint-disable-next-line no-undef
exports.config = {
  tests: './test/**/*.test.ts',
  output: './output',
  helpers: {
    Puppeteer: {
      url: process.env.TEST_URL,
      show: true,
      browser: 'chromium',
      chrome: {
        args: ['--no-sandbox'],
      },
    },
    REST: {
      endpoint: `${process.env.TEST_URL}/api`,
    },
  },
  include: {
    I: './steps_file.ts',
  },
  bootstrap: null,
  mocha: {
    reporterOptions: {
      mochaFile: 'reports/e2e/community-management-web.xml',
    },
  },
  name: 'xxx-e2e',
  plugins: {
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true,
    },
    tryTo: {
      enabled: true,
    },
    screenshotOnFail: {
      enabled: true,
    },
    allure: {
      enabled: false,
    },
  },
  gherkin: {
    features: './test/features/*.feature',
    steps: [
      './test/step-definitions/base.steps.ts',
      './test/step-definitions/xxx.steps.ts',
      './test/step-definitions/auth.steps.ts'
    ],
  },
};

Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.