Lesson 5 of 6
End-to-end tests across SAP BTP and SAP S/4HANA
9 min
Listen to this lesson
End-to-end tests prove that the business process works across both platforms with real configuration: identity, destinations, Cloud Connector, event broker, role collections and SAP S/4HANA data. They are expensive, so Contoso keeps a short list, chosen with Dan and Maria as the scenarios the business would notice first if they broke.
| Scenario | Systems touched | Pass criteria |
|---|---|---|
| E2E-01 Fleet desk sees order status | Identity, app, destination, Cloud Connector, CMQ Sales Order API | Status in the app matches the order in CMQ for Great Lakes Fleet Services |
| E2E-02 Order change raises an inquiry update | CMQ, event channel, broker, app | Maria changes the requested delivery date in CMQ; the app's inquiry shows the change within the agreed time |
| E2E-03 Supervisor closes an inquiry | App, authorization, database | Closed with resolution; agent cannot close; audit fields correct |
| E2E-04 Supervisor action written to SAP S/4HANA | App, principal propagation, Cloud Connector, CMQ | Change appears in CMQ under the supervisor's own user |
| E2E-05 Fleet customer sees only own data | Identity attributes, app | Great Lakes Fleet Services contact sees only their inquiries |
| E2E-06 Same event delivered twice | Broker, app | One inquiry update, no duplicate |
Contoso's end-to-end scenarios for the fleet app's first release.
Make the landscape ready first
A readiness check takes an hour and saves days. Each layer gets one quick proof: a smoke call per destination, a test event published and seen in the broker, a sign-in per test identity, and a look at the prepared orders in CMQ. Only when all are green does the end-to-end cycle start, so failures during the cycle point to the process, not the plumbing.
Asynchronous steps and timing
Event-driven steps, such as E2E-02, are asynchronous: the change is saved in CMQ before the app has received and processed the event. Tests must wait for a condition, not a fixed time: poll the app's inquiry until the new date appears, with a time-out based on the agreed service level, and record how long it took. A fixed wait is either too short (random failures) or too long (slow suites). When the time-out passes, the evidence should show where the event stopped: in CMQ, in the broker queue, or in the app.
- Act in SAP S/4HANAMaria changes the requested delivery date of a test fleet order in CMQ
- Event publishedThe sales order changed event leaves CMQ through the channel
- BrokerDelivered to the fleet app's queue
- App processesReads the order through the API and updates the inquiry
- Poll until trueThe test checks the inquiry until the new date appears or the time-out passes
- RecordResult, elapsed time and, on failure, where the event stopped
If an app is multitenant, end-to-end testing adds a dimension: run the key scenarios in at least two subscriber tenants and prove that data, users and configuration do not leak between them. The fleet app is single-tenant, so Contoso skips this, but its approach to proving data separation between fleet customers (E2E-05) follows the same idea.
What would you do?
E2E-02 passes on some runs and fails on others. The test waits 10 seconds after Maria's change and then checks the inquiry. Logs show the event sometimes takes 14 seconds to be processed. What should the test team change?
- Keep a short list of end-to-end scenarios chosen with process owners and key users.
- Run a readiness check of data, SAP S/4HANA configuration, connectivity, identity and app version first.
- Wait for conditions, not fixed times, in asynchronous steps; record the elapsed time.
- For multitenant apps, prove isolation across at least two subscriber tenants.
- Record scenarios, evidence and sign-off in SAP Cloud ALM.
Check your understanding · not graded
Lesson check
1. Why run a readiness check before an end-to-end cycle?
2. How should a test wait for an event-driven update?
3. Which evidence proves scenario E2E-04 (supervisor action written to SAP S/4HANA)?
4. What does a multitenant app add to end-to-end testing?