Registry / testing / generic-cucumber-protractor-framework

generic-cucumber-protractor-framework

JSON →
library1.8.7jsnpmunverified

A generic, reusable automation framework combining Cucumber, Protractor, and WebDriverJS for end-to-end testing of Angular and non-Angular applications. The current stable version is 1.8.7. It provides a large set of pre-built step definitions for form interactions, navigation, alert handling, REST API calls, and fake data generation. The framework is opinionated, requiring a specific folder structure and environment variables. It depends on Protractor, Cucumber, and several other libraries. Compared to building from scratch, this framework reduces boilerplate but may be overkill for small projects and is not actively maintained by a large community.

npm install generic-cucumber-protractor-framework
INSTALL
IMPORT
SIG · GENERIC-CUCUMBER-P
G
generic-cucumber-protractor-framework
testingjavascriptv1.8.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

generic-cucumber-protractor-framework
require generic-cucumber-protractor-framework as part of project setup
import ... from 'generic-cucumber-protractor-framework'
This is a framework that is used by referencing its support files via require. No direct import of symbols.
step_definitions
require('../../node_modules/generic-cucumber-protractor-framework/step_definitions/step_definitions_manager.js')
require the individual step files directly without using the manager
Use the step_definitions_manager to load all steps automatically.
pageObjects
require('../../node_modules/generic-cucumber-protractor-framework/support/pageObjects.js')
Page object utility is provided to lookup elements from JSON files.

Shows how to require the framework's support modules and define a custom Cucumber step.

// e2e/features/custom_steps/custom_steps.js const { defineSupportCode } = require('cucumber'); const pageObjects = require('../../node_modules/generic-cucumber-protractor-framework/support/pageObjects.js'); const helpers = require('../../node_modules/generic-cucumber-protractor-framework/support/helpers.js'); defineSupportCode(function({ Then }) { Then(/^I see the "([^"]*)" element$/, async function(elementName) { const element = await pageObjects.findElement(this.page, elementName); await expect(element.isDisplayed()).to.eventually.be.true; }); });
Debug
Known issues
deprecatedThe framework may not be compatible with latest Protractor/Cucumber versions (e.g., Cucumber v7+, Protractor v7+).
fix
Check GitHub for updates or consider migrating to a more modern framework like WebdriverIO + Cucumber.
affects: >=1.8.7
gotchaRequires specific environment variables (WEB_SERVER, WEB_SERVER_PORT, etc.) to be set. Missing them may cause unexpected defaults or failures.
fix
Ensure all required environment variables are defined in CI or local environment.
affects: >=1.0.0
gotchaFolder structure must match expected layout exactly (e.g., /e2e/features/custom_steps). Deviation will break step loading.
fix
Follow the documented folder structure strictly; do not rename or reorganize directories.
affects: >=1.0.0
deprecatedOld Cucumber support (`defineSupportCode`) is used. This is deprecated in Cucumber v7+.
fix
If using Cucumber >6, update steps to use new API (e.g., `Given`, `When`, `Then` imports).
affects: >=1.0.0
breakingThe framework relies on Protractor's `browser.waitForAngular()`. It may time out on non-Angular pages.
fix
Set `ignoreSynchronization = true` in your config or use `browser.waitForAngularEnabled(false)` before tests on non-Angular pages.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module '../../node_modules/generic-cucumber-protractor-framework/support/pageObjects.js'
Relative path is incorrect or node_modules is not installed.
fix
Ensure the framework is installed via npm and use the correct relative path from your step file.
TypeError: defineSupportCode is not a function
Using defineSupportCode from older versions of Cucumber (pre-v7).
fix
Update Cucumber to a version that supports defineSupportCode (e.g., 5.x) or switch to newer Cucumber API.
WebDriverError: process exited with code null
Protractor driver session crashed; often due to incompatible browser driver version.
fix
Update WebDriver (e.g., `npm install webdriver-manager@latest` and run `webdriver-manager update`).
Upgrade
Version history
1.8.7latest on npm
Audit
Dependencies
protractorrequiredCore browser automation library
cucumberrequiredBDD test framework
protractor-cucumber-frameworkrequiredIntegration between Protractor and Cucumber
Agent activity
2 hits · last 30 days
node
2
Resources
generic-cucumber-protractor-framework — npm install generic-cucumber-protractor-framework · libregistry