CPI Test Generator
Last updated
Last updated
The CPI Test Generator helps automate the process of testing SAP Cloud Platform Integration (CPI) Integration Flows (iFlows). It allows you to generate, execute, and review test results, making the integration testing process efficient and error-free. This guide will walk you through the steps for deploying, configuring, testing, and mocking your iFlows using the ReleaseOwl platform.
1. SAP Process Integration Runtime Service Instance
Navigate to Instances and Subscriptions and click Create.
Fill in the following details:
Service: SAP Process Integration Runtime
Plan: integration-flow
Runtime Environment: Cloud Foundry
Space: Dev
Instance Name: Choose a suitable name
Click Next, then Create to set up the instance.
Create Service Key
Enable Custom Idp
Enable Test Automation in ReleaseOwl CPI Environment Configuration
Update the OAuth credentials and Instance URLs in the ReleaseOwl CPI Environment using the details from the Service Key in SAP BTP Cockpit.
Enable Trace in Artifact Runtime Log Configuration
In SAP BTP Cockpit, go to Integration and APIs and select the iFlow you want to test.
Navigate to Artifact Details and change the Log Level to Trace to track detailed logs during testing.
Trigger the iFlow with the expected input using Postman or another tool.
In CPI Test Generator, click Generate Test Cases.
Select the Artifact Name for the iFlow.
After the iFlow execution, go to the ReleaseOwl Dashboard and click Fetch Activity Messages.
This will retrieve messages from the latest iFlow execution. The first message will be the input message, and the remaining messages will be treated as output messages.
Click the Eye Icon to view the messages.
Select the Message Group ID and click Generate Test Case.
Enter the Test Case Name and Description, then click OK.
Click Run to execute the test case.
After execution, click the Actions button (···) and select Last Test Results to view test case results.
You can view the executed test cases, including details such as:
Run ID
Artifact Name
Environment
Run on button: It provides an option to select a particular environment before executing the test case.
Test Runs: Displays all test runs with timestamps, executed artifact versions, and environments.
Expected Output: The message recorded during test case creation.
Actual Output: The message from the current test execution.
Differences: Differences between the header and exchange properties of the expected and actual messages.
The Ignore List allows you to exclude specific paths, header properties, and exchange properties (e.g., timestamps, generated IDs, etc.).
If a test case needs adjustments (e.g., missing parameters in the iFlow), click Edit to modify it.
If steps are added or removed in the actual iFlow, the messages in the testcase should also be updated. Click on Update Messages will execute the iFlow using the input from the testcase, which will display the latest messages from the trace.
The user can review these messages and update the testcase with the new message steps. Click on the Save button to save the updated messages to the testcase.
Active Button
If you need to temporarily disable the execution of a test case, uncheck the Active button.
Once the issue is resolved, re-enable the test case by checking the Active button again.
When enabled, ReleaseOwl mocks all receiver channels in the iFlow with HTTPS receivers pointing to the ReleaseOwl mock service.
ReleaseOwl creates a new iFlow with the name ROMOCK and prefixes the package name with ROMOCK.
The mock service simulates responses returned by external calls using recorded messages from the test case generation.
This allows integration flow testing without relying on actual external APIs.
Test cases can be executed against iFlows using the following sender adapters:
HTTP Adapter
SOAP Adapter
IDoc Adapter
Process Direct Adapter
JMS Adapter
Process Direct Adapter and JMS Adapter do not have HTTP endpoints, so test cases cannot be executed directly.
To test them, import the CPI Connector Package provided by ReleaseOwl into your CPI tenant.
After importing the package, deploy the iFlow artifacts so they can have endpoints.
ReleaseOwl mocks all the receiver channels in the iFlow with https receivers pointing to ReleaseOwl mock service.
Edit the test case and enable Mock Endpoints to simulate receiver endpoints using the HTTP receiver provided by ReleaseOwl.
Run the test case with mock enabled.
Mock Package and iFlow:
A Mock Package and Mock iFlow will be created in the CPI tenant with the prefix ROMOCK.
Executed on Artifact ID: Displays the artifact name against which the test case was executed.
Executed Artifact Version: Shows the version of the artifact used for the test case execution.