codeceptjs-cucumber is an E2E testing framework that integrates CodeceptJS with Cucumber, enabling Behavior-Driven Development (BDD) workflows. It facilitates running tests across multiple browsers and offers out-of-the-box integration for Sauce Labs, allowing for efficient parallel test execution in the cloud. The current stable version is 5.0.0, released in late 2023. This package typically follows a major release cadence of approximately one to two years, aligning with updates in its core dependencies like CodeceptJS and Cucumber. It leverages the Should.js assertion library by default. As an opinionated framework, its key differentiator lies in simplifying the setup and configuration required to combine these powerful testing tools, particularly for complex cloud-based, cross-browser test automation scenarios, reducing the boilerplate often associated with such integrations.
npm install codeceptjs-cucumberVerified import paths — ran on the pinned version, not inferred.
This quickstart sets up a basic CodeceptJS-Cucumber project to perform a Google search. It demonstrates the `package.json` for dependencies, `codecept.conf.js` to configure the Playwright helper and the Cucumber integration, a Gherkin `.feature` file defining a search scenario, and corresponding JavaScript step definitions. Execute tests using `npm test`.
Review the official CodeceptJS v3 and Cucumber v8/v10 migration guides. Update `codecept.conf.js` to match the new helper and plugin syntax. Adjust step definitions for any Cucumber API changes. Ensure `@cucumber/cucumber` is at version 8 or higher, and `codeceptjs` is at version 3 or higher.
Refer to the `codeceptjs-cucumber` documentation for Sauce Labs integration details. Ensure Sauce Connect Proxy is running if required, and the Sauce Labs helper is correctly configured with valid credentials and desired browser capabilities in `codecept.conf.js`.
Double-check that the paths specified in `gherkin.steps` (for CodeceptJS's internal Gherkin plugin) and `Cucumber.require` (for the Cucumber helper) accurately point to your step definition files/directories. Ensure glob patterns (e.g., `./step_definitions/**/*.js`) are correct.
Upgrade your `@cucumber/cucumber` package to version 8 or newer (e.g., `@cucumber/cucumber: ^10.0.0`) and adjust your step definitions if any API changes are required from Cucumber's side.
Ensure your `codecept.conf.js` has a helper defined (e.g., `Playwright` in the `helpers` section) and that `I` is correctly imported via `const { I } = inject();` in your steps file. Also, verify that `include.I` is set in the `codecept.conf.js`.Verify that your step definition files are correctly linked in `codecept.conf.js` (check `gherkin.steps` and `Cucumber.require` paths). Ensure the regular expression in your step definition exactly matches the Gherkin step text.
Run `npm install @cucumber/cucumber` or `yarn add @cucumber/cucumber`. Check your `package.json` for the correct dependency and ensure your `node_modules` directory is up-to-date.
Run `npm install codeceptjs` or `yarn add codeceptjs`. Confirm it's listed in your `package.json` and `node_modules`.