cds-cucumber
Behaviour-driven tests for CAP applications: Gherkin scenarios that drive a running service rather than assertions written against handlers.
Facts
Where it sits
Who is behind it
In the atlas: maintains 10@cap-js-communitymaintainerChristian GeorgiContributes to this
In the atlas: maintains 1, contributes to 53@chgeoChristian NeuContributes to this
In the atlas: contributes to 5@christianneuVladislav LeonkevContributes to this
In the atlas: contributes to 12, wrote 1@vl-leon3 contributors
Before choosing this
Conditions
LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
- § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
- § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
- § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
What it declares
Every artifact
- Type
- CDS plugin
- Origin
- By a community org
As a CDS plugin
- Distributed through
- npm
Connections
Proving a service still does what it did, without a deployment
Download
Install
npm add cds-cucumberDerived from the package name. No recipe recorded; the README has the configuration.
Learn more
- CAP full-stack testing with BDD flavourCAP full-stack testing with BDD flavourIntroduces Behavior-Driven Development for CAP applications: specifications written in Gherkin against a running app, validated by Cucumber, using cds-cucumber's ready-made step definitions for SAP Fiori elements and OData screens. The library handles service lifecycle — starting the app, assigning a port, driving the browser and authenticating a named user — and its OData steps know the service's entities and fields from the CDS model itself, so a scenario can open a list report, search it and assert row counts without hand-written glue code.published 2023-10-10Vladislav Leonkev, SAP Community
- v0.3.7
The browser is chosen with
CDS_CUCUMBER_BROWSER=chrome|firefox, and the variableCDS_CUCUMBER_FIREFOXis removed. When Application Studio is detected, the default browser is Firefox.Makes stale:Test setups that set
CDS_CUCUMBER_FIREFOXto run the UI steps in Firefox.
2 earlier
- v0.3.5
The step
Given we have started the CAP applicationis removed; scenarios useGiven we have started the applicationinstead.Makes stale:Feature files that open with
Given we have started the CAP application. - v0.2.1
The UI step
we select additional row in value help dialogis removed, andwe select one row in value help dialogno longer clears the previous selection.Makes stale:Scenarios that use the step
we select additional row in value help dialog.
README
quoted from cap-js-community/cds-cucumber under Apache-2.0, readCDS for Cucumber
Provides a library for behaviour-driven tests of CAP applications. It contains ready-to-use steps that help you write tests in a BDD style. The cucumber project provides framework for that.
As of now, the library supports SAP Fiori® Elements as UI framework and OData as communication protocol.
A typical test looks like this:
Feature: Fiori preview page
Scenario: Open first Fiori preview page
Given we have started the application
And we have opened the url "/"
When we click on first Fiori preview page
And we search for "jane"
Then we expect to have 1 table records
The project is in early beta phase, please expect changes.
Documentation
List of steps and details is available in the documentation.
Usage
Setup
Install the CAP development toolkit:
npm add -g @sap/cds-dk
Create a project
Make sure you have a CAP project. You can create one with the following command:
cds init --add sample bookshop
cd bookshop
Configure
npm add -D @cap-js-community/cds-cucumber
npx cds-add-cucumber
Add feature files
File: test/features/first.feature
Feature: Bookshop first feature file
Scenario: Open "Manage Books" as "alice" and search for "jane"
Given we have started the application
And we have opened the url "/" with user "alice"
When we select tile "Manage Books"
And we search for "jane"
Then we expect to have 2 table records
For existing projects you have to adjust the example above.
Run feature tests
npx cucumber-js test
A recent version of the chrome browser should be present on the system.
More
For additional information see the details page.
Support, Feedback, Contributing
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
Code of Conduct
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Licensing
Copyright 2023 SAP SE or an SAP affiliate company and cds-cucumber contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
History
Removed, Features, Changed, Fixes
Notes
Added
Changed
Removed
Fixed
Fixes 1
Notes
Fixed
- process management - set TEMP and TMPDIR environment variables for @cap-js-community/odata-v2-adapter
Changed 1, Fixes 1
Notes
Changed
- dependencies: make @sap/cds a peer dependency
Fixed
- process management - set TMP environment variable for @cap-js-community/odata-v2-adapter
Features 2
Notes
Added
- server-side code-coverage
- OData:
- support protocol version 2: Given we require communication protocol "odata-v2"
- perform actions: When we execute action {word} with payload
Features 1, Fixes 1
Notes
Added
- cds-add-cucumber - create an example github actions workflow file
Fixed
- UI - skip InvisibleText elements
Removed 1, Features 1, Changed 1, Fixes 1
Notes
Added
- Environment variable: CDS_CUCUMBER_BROWSER=chrome|firefox
Changed
- Browser: default browser set to 'firefox' when Application Studio is detected
Removed
- Environment variable: CDS_CUCUMBER_FIREFOX
Fixed
- Secure working directory removal
Fixes 2
Notes
Fixed
- Plugin: generated test using removed step
- Documentation: README referencing removed step
Removed 1, Features 1, Fixes 1
Notes
Added
- Documentation: environment variable CDS_COMMAND_ARGn
Removed
- Steps Given we have started the CAP application
alternative: Given we have started the application
Fixed
- selenium-webdriver: add option --headless
Features 1, Fixes 1
Notes
Added
- Firefox support enabled via environment variable CDS_CUCUMBER_FIREFOX=1
Fixed
- OData: retrieve service path via annotation "@path"
Features 2, Changed 2, Fixes 1
Notes
Added
- UI: enable SAP UI5 1.120.1
- cds-add-cucumber: create vscode extensions recommendation file when missing
Changed
- chromedriver: changed dependency to "latest"
- UI: reuse TableUtils when selecting rows in ValueHelp dialogs
Fixed
- Security issue in axios - dependency tree update
Changed 2
Notes
Changed
- UI
- step "modify field" extended with ValueHelp dialog support
- node
- require engine >= 18
- UI
Removed 1, Features 3, Changed 2, Fixes 2
Notes
Added
- Windows OS support
- UI
- enable CORS
- specify Accept-Language
- OData
- expectation for count(*) result
Changed
- Simplified "Getting started" guide
- UI
- step "we select one row in value help dialog" does not clear the previous selection
Removed
- UI
- step "we select additional row in value help dialog"
Fixed
- UI
- step "we select one row in value help dialog" works with all target UI5 versions
- temporary directory creation when running in parallel
Features 1, Changed 1, Fixes 5
Notes
Added
- OData steps
Changed
- Readme: switch to bookshop sample "cds add sample"
Fixed
- Readme: install from npm repository
- Plugins:
- reject failing commands
- hide test plugins
- Concurrency:
- allow cucumber parallel jobs:
npx cucumber-js test --parallel 2 - create new working directory (username and process ID dependent) using it as follows:
- Chrome: user data directory
- CAP services: home directory
- allow cucumber parallel jobs:
- Steps:
- detect technical issues when selecting tiles
- detect missing ValueHelp popup
- add new step: remove ValueHelp selection
- locating active dialog
- cucumber:
- remove deprecated configuration: publishQuiet
Others providing
Compare all 8 on the Testing page →- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- @cap-js/cds-test@cap-js/cds-testTest support for CAP Node.js, installed as a dev dependency: it starts the project's server for the test, hands the test an HTTP client bound to it, and carries the assertions.sap official, capTest support for CAP Node.js: server start, HTTP client, assertionsfrom CAP
- sapbrunosapbrunoA terminal UI that runs Bruno collections against a CAP service, fetching an OAuth2 client_credentials token before each run so collections that fail with 401 under bru run work in CI.independent, capTerminal UI running Bruno collections against a CAP servicefrom CAP
- cds-launchpad-plugincds-launchpad-pluginIndexes every SAPUI5 application in a workspace into one sandbox launchpad served by the CDS server, so all of them can be opened from a single page while developing.independent, capSandbox launchpad for all SAPUI5 apps in a CAP workspacefrom CAP
- enforce-export-coverageenforce-export-coverageA static-analysis command line that checks every exported TypeScript function has a corresponding test, without running the test suite.independent, generalStatic check that each exported TypeScript function has a testfrom General
- @sap-ux/fe-mockserver-plugin-cds@sap-ux/fe-mockserver-plugin-cdsLets the Fiori Elements mock server take a CDS file as its metadata source, so a UI is developed against the real model before a service exists.sap official, capFiori Elements mock server plugin taking a CDS file as metadatafrom CAP
- @saptools/bruno@saptools/brunoA command line that runs Bruno collections against XSUAA-protected apps on Cloud Foundry, fetching the app's token and writing it into the selected environment file before each run.independent, btpRunner for Bruno collections against XSUAA-protected CF appsfrom BTP/BAIP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Flavors
“npm add -D @cap-js-community/cds-cucumber” — cap-js-community/cds-cucumber — README
Contributors
History in the atlas
- Behaviour-driven tests for CAP applications: Gherkin scenarios that drive a running service rather than assertions written against handlers.
- First seen.
For your agent
- Ref
artifact:cap-js-community-cds-cucumber- JSON
- /artifacts/cap-js-community-cds-cucumber.json
- MCP
- Connecting an agent