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.
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
https://cucumber.io/
"Cucumber" is a tool that is used to validate features of software systems and it empowers BDD as a development life-cycle.
The "Cucumber" module can understand the specifications and evaluate them just like tests that are validating the system features.
In order to evaluate the specifications "Cucumber" requires step definitions written in any of the supported programming language.
https://cap-js-community.github.io/cds-cucumber/
CAP provides a Nodejs 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: step definitions.
https://cap-js-community.github.io/cds-cucumber/#usage
npm add -g @sap/cds-dk
cds init --add sample bookshop
cd bookshop
npm add -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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
12 | |
11 | |
10 | |
9 | |
9 | |
9 | |
8 | |
6 | |
6 |