Testing

Proving the service still does what it did — against the model and the handlers, without a deployed system and without a database somebody has to keep clean.

Overview

InCAPassessed
SAP SHIPSby design
Node.js →

@cap-js/cds-test Test 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.

Java →

com.sap.cds:cds-services-bom Test support for the three layers the guide names: event handlers in isolation, services dispatching to them, and the application through its API with Spring Boot test support.

Not covered: At the service boundary. Driving a UI, running a scenario in a browser, and anything needing a real BTP binding are outside it, and that is where every other entry here sits.

Sourcecds.test — capirechecked
InBTP/BAIPassessed

Checking a service already deployed to Cloud Foundry from outside it: requests sent to its routes with a token its XSUAA binding issues, and what comes back compared with what was expected.

SAP SHIPS

No core answer is documented.

Not covered: At the deployed service's routes. What runs inside it, the handlers and the queries, is tested before deployment, on the CAP door.

No SAP page read for this intake names a tool for testing a service after it is deployed to Cloud Foundry, so this is a assessment of the corpus rather than a quote from the core; the one provider here is independent.

THE COMMUNITY ADDS

InSAP Digital Manufacturingassessed

Automated tests of the production processes behind Digital Manufacturing's standard apps, built from the test modules SAP publishes for a test automation tool.

SAP SHIPS

No core answer is documented.

Assessed the day the SAP Digital Manufacturing door opened, before its entries were taken in.

NOBODY YET

No artifact is documented here yet.

Artifacts8

Group by8 of 8 artifacts
ArtifactSignals
CDS plugins2
cds-cucumberGherkin scenarios driving a running CAP service
Signals
none
cds-launchpad-pluginSandbox launchpad for all SAPUI5 apps in a CAP workspace
Signals
none
CLI tools3
@saptools/brunoRunner for Bruno collections against XSUAA-protected CF apps
Signals
none
sapbrunoTerminal UI running Bruno collections against a CAP service
Signals
none
enforce-export-coverageGeneralStatic check that each exported TypeScript function has a test
Signals
Functional boundary
Packages3
@cap-js/cds-testTest support for CAP Node.js: server start, HTTP client, assertions
Signals
none
@sap-ux/fe-mockserver-plugin-cdsFiori Elements mock server plugin taking a CDS file as metadata
Signals
none
com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
Signals
none

Content12

Group by12 of 12 pieces
Piece, what it offers
How to Restrict CRUD Operations in SAP CAPM Using @Capabilities, @readonly and Test APIs with .http
SAP Community, DeepaRagho, BlogThe reasoningA recipeRunnable code
New tutorial for UI5 Middleware FE Mockserver
SAP Community, Marian Zeis, Blog
Enhancing Unit Testing in SAP CAP Java Applications with GitHub Copilot
SAP Community, Anjali_Pathak, BlogThe reasoning
Show 9 more
Getting Started with Unit Testing in SAP CAP Java Applications
SAP Community, Anjali_Pathak, BlogThe reasoningRunnable code
Core changed
Simplifying SAP BTP Authentication in Pipelines with SAP Passport and Playwright
SAP Community, Marian Zeis, BlogThe reasoningRunnable code
CAP full-stack testing with BDD flavour
SAP Community, Vladislav Leonkev, Blog
Testing your CAP HANA Artifacts with jest – including multitenancy, hdbprocedure and hdbview
SAP Community, Tristan, BlogThe reasoningA recipeRunnable code
Core changed
CAP: Unit Testing using Mocha and Chai
SAP Community, jhodel18, BlogThe reasoningRunnable code
Core changed
Using Postman for API Testing with XSUAA
SAP Community, mariusobert, BlogThe reasoningRunnable code
Integration Tests in a Cloud Foundry Java App using SAP Cloud Application Programming Model
SAP Community, former_member428487, BlogThe reasoningRunnable code
Core changed
Create Automated System Tests for SAP Cloud Application Programming Model Projects
SAP Developer Center, SAP, TutorialThe reasoningA recipe
Accelerating SAP solution transformations with the agent-led toolchain
SAP TechEd — session catalogue, TalkThe reasoning
CAP full-stack testing with BDD flavour
SAP Community, Vladislav Leonkev, Blog

Seen working3

ArtifactSignals
Samples3
cap-java-snippetsTen short CAP Java references, one document per topic
none
SAP-archive/digital-manufacturing-test-automation-samplesTricentis test modules for SAP Digital Manufacturing applications
Archived
SAP-samples/cap-bookshop-wdi5CAP bookshop with wdi5 system tests for a CI/CD tutorial
none

Details

What changed — and what it makes stale3
@cap-js/cds-test 1.0.0, CAP

Through its 0.x releases, cds.test's HTTP shortcuts (GET, PUT, POST…) ran on axios. Version 1.0 dropped that dependency in favour of Node's native Fetch API across the package — cds.test.axios remains only as a deprecated, partial fallback — and moved the default assertion library to Chai 6 while adding Vitest as a fully supported test runner alongside Jest, Mocha and node:test.

Makes stale:

Any description of cds.test as axios-backed, or troubleshooting written around cds.test.axios as the primary HTTP client — since 1.0 that path is deprecated, not the default.

@sap/cds 9.0.2, CAP, Node.js

@cap-js/cds-test stopped being optional: cds.test now refuses to run unless the package is installed, and the axios, chai, chai-as-promised and chai-subset dependencies a project used to add by hand are no longer needed once it is. The 9.0 line reached npm as 9.0.2 on 2025-06-02 — 9.0.0 and 9.0.1 were never published.

Makes stale:

Setup steps that install axios, chai, chai-as-promised and chai-subset directly to use cds.test rather than adding @cap-js/cds-test. On cds9, cds.test does not run without the latter present, regardless of what else is installed.

SourceCAP changelog 2025 — cds@9.0.0checked
@cap-js/cds-test 0.1.0, CAP

Before this, cds.test shipped inside @sap/cds itself, and a project pulled in axios, chai, chai-as-promised and chai-subset separately to use it. Test support moved out into its own package, @cap-js/cds-test, installed as a devDependency and versioned on its own release cycle from here on.

Makes stale:

Guidance that treats cds.test as something @sap/cds provides with no extra install — from this point a project needs @cap-js/cds-test as a devDependency to get it.

Coverage
statecore and community, CAP
assessed
state in BTP/BAIPcommunity only, assessed
state in SAP Digital Manufacturingunmapped, assessed
relationshipnarrow by design
Sourcecds.test — capirechecked SourceTesting Applications (CAP Java) — capirechecked SourceTesting Applications (CAP Java) — capirechecked
For your agent