Quality of services demonstrates commitment, leads to customer satisfaction and builds trust.
Harmonious and intuitive designed product plays a crucial role in ensuring a positive customer experience.
In this blog, we’re going to unpack a promising method that might assist us in accomplishing our goal.
Before presenting the CAP’s contribution, let’s start by giving a quick introduction to the involved components and technologies.
https://cap.cloud.sap/docs/
CAP applications consists of CDS model, service with database access and UI (graphical user interface).
A CAP service can support several protocols like OData, Rest, GraphQL.
The UI can use any framework that works with any of the mentioned service protocols.
SAP UI5 with SAP Fiori® Elements is first class citizen as it is well integrated with the CDS model and supports several paradigms offered by CAP.
https://cucumber.io/
“Cucumber” is a tool that is used to validate features of software systems.
It empowers BDD as a development life-cycle. The collaborators write specifications in human-readable format using the Gherkin language (Given-When-Then) while describing how the system behaves.
The “Cucumber” module can understand the specifications and evaluate them just like tests that are validating the system features.
https://cap-js-community.github.io/cds-cucumber/
CAP provides a library with ready-to-use steps for writing specifications utilizing the “cucumber” module.
The cds-cucumber library covers SAP Fiori® Elements and in addition the OData protocol.
It is deeply integrated with CAP providing Service-Lifecycle-Management like: process initialization, port assigning, directory management, browser control, authentication. The OData part has knowledge of the service names, entities and fields as it works directly with the CDS model.
The documentation of all steps with short examples is available under the following link: API
https://cap-js-community.github.io/cds-cucumber/#usage
npm i -g @sap/cds-dk
cds init --add sample bookshop
cd bookshop
npm i -D @cap-js-community/cds-cucumber
npx cds-add-cucumber
Feature: Bookshop first feature file
Scenario: Open "Manage Books" as "alice" and search for "jane"
Given we have started the CAP 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
npx cucumber-js test
The Visual Studio Code Editor, in conjunction with its plugins, delivers effortless integration and robust support for cucumber, enabling you to optimize your workflow when authoring your specifications. Here are some further details about it:
The module is provided as open-source. It is freely accessible and active participation is highly appreciated. Furthermore, the repository includes tests for popular sample projects, showcasing the elegance and flexibility of the solution.