{"library":"protractor-cucumber-framework","title":"Protractor Cucumber Framework","description":"The `protractor-cucumber-framework` package provides the integration layer to run Cucumber.js tests within the Protractor end-to-end testing framework, primarily for Angular applications. Currently at version `9.19.0`, this framework is actively maintained to support recent versions of Cucumber.js (up to `v12.0.0`) and Serenity/JS (up to `v3.42.1`), even though Protractor itself has reached its official end-of-life. Originally bundled with `angular/protractor`, it was later extracted as a separate module to allow independent development and broader support for various Cucumber.js versions. A key differentiator is its deep integration with Serenity/JS, which enhances reporting capabilities beyond Cucumber.js-native reporters, offering rich, highly detailed BDD reports and living documentation. While the project ensures compatibility with a broad range of its peer dependencies, users should be aware that Protractor's deprecation means new projects are advised to migrate to modern alternatives like WebdriverIO or Playwright with Serenity/JS for continued test automation.","language":"javascript","status":"deprecated","last_verified":"Sun Apr 19","install":{"commands":["npm install protractor-cucumber-framework"],"cli":null},"imports":["exports.config = {\n  framework: 'custom',\n  frameworkPath: require.resolve('protractor-cucumber-framework'),\n  // ... other config\n}","import { Given, When, Then } from '@cucumber/cucumber';\n// ...","exports.config = {\n  // ...\n  cucumberOpts: {\n    require: [\n      'features/step_definitions/**/*.steps.ts',\n      'features/support/*.ts',\n    ],\n    requireModule: ['ts-node/register'],\n  },\n};"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"/* protractor.conf.ts */\nimport * as path from 'path';\n\nexport const config: import('protractor').Config = {\n  directConnect: true,\n  // For testing Angular applications on a non-Angular site, set this to true.\n  // This will bypass Angular's readiness checks.\n  ignoreSynchronization: false,\n\n  framework: 'custom',\n  frameworkPath: require.resolve('protractor-cucumber-framework'),\n\n  specs: [\n    path.resolve('./e2e/features/**/*.feature')\n  ],\n\n  capabilities: {\n    browserName: 'chrome'\n  },\n\n  cucumberOpts: {\n    compiler: [],\n    require: [\n      path.resolve('./e2e/steps/**/*.steps.ts'),\n      path.resolve('./e2e/support/**/*.ts')\n    ],\n    format: 'json:./e2e/reports/cucumber-results.json',\n    tags: '',\n    profile: false,\n    'no-source': true,\n    colors: true,\n    requireModule: ['ts-node/register'],\n  },\n\n  onPrepare: () => {\n    // Ensure the browser instance is configured to wait for non-Angular elements as needed\n    browser.waitForAngularEnabled(true);\n  },\n};\n\n/* e2e/features/example.feature */\nFeature: Protractor Cucumber Example\n  As a user\n  I want to use Protractor with Cucumber\n  So that I can write BDD tests\n\n  Scenario: Basic navigation and title check\n    Given I open \"https://www.angularjs.org/\"\n    Then the title should be \"AngularJS — Superheroic JavaScript MVW Framework\"\n\n/* e2e/steps/example.steps.ts */\nimport { Given, Then } from '@cucumber/cucumber';\nimport { browser, expect } from 'protractor';\n\nGiven('I open {string}', async (url: string) => {\n  await browser.get(url);\n});\n\nThen('the title should be {string}', async (expectedTitle: string) => {\n  const actualTitle = await browser.getTitle();\n  await expect(actualTitle).toEqual(expectedTitle);\n});","lang":"typescript","description":"This quickstart demonstrates setting up `protractor-cucumber-framework` with TypeScript. It includes a `protractor.conf.ts` for configuration, an example Gherkin feature file, and corresponding TypeScript step definitions to navigate to a URL and verify its title. It showcases how to integrate `ts-node` for in-memory transpilation of TypeScript step files and configures Cucumber.js output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}