con un clic
cumulocity-local-hybrid-testing
Setup the local testing environment for Cumulocity applications to test UI and microservices.
Menú
Setup the local testing environment for Cumulocity applications to test UI and microservices.
REST API documentation and guidance for interacting with the Cumulocity AI service. Use when sending messages to the AI agent.
Multi-scope expert for Cumulocity IoT. Accesses live OpenAPI specs for Core API and Digital Twin Manager (DTM).
Critical implementation patterns for building Cumulocity microservices that act as MCP (Model Context Protocol) servers. Use when developing MCP servers.
Guidelines for developing microfrontends, plugins, and blueprints in Cumulocity, including manifest configuration and package structure. Use when working with microfrontends.
Guidelines for what needs to be ensured if you want to create a new open source repository in the Cumulocity organization.
Standard practices for developing, testing, and building Python microservices in the Cumulocity ecosystem. Use when creating or refactoring Python microservices.
| name | Cumulocity Local Hybrid Testing |
| description | Setup the local testing environment for Cumulocity applications to test UI and microservices. |
This skill enables efficient UI and integration testing of Cumulocity IoT applications using Antigravity. It manages the hybrid environment where the UI runs locally, the backend is a live cloud tenant, and specific microservices run on the local machine.
To bypass the manual Login Screen, the AI should use environment variables to handle credentials.
C8Y_BASE_URL, C8Y_TENANT, C8Y_USER, C8Y_PASSWORD, C8Y_BASE64_AUTH.Authorization: Basic {{C8Y_BASE64_AUTH}} header into initial requests to establish a session cookie and bypass the UI flow.The environment splits traffic between the cloud and the local dev machine.
| Target | Destination | Pattern |
|---|---|---|
| Local Microservice | http://localhost:port | /service/{{MICROSERVICE_NAME}}/** |
| Cloud Tenant | {{C8Y_BASE_URL}} | everything else, including calls to other /service/{{other-microservice}}/** |
proxy.conf.json)To implement hybrid routing, the Webpack/Angular dev-server proxy must be configured with a specific hierarchical structure:
"/**" to capture all remaining traffic (including other standard platform APIs, assets, and other remote microfrontends) and proxy them to the live cloud tenant.{
"/service/{{MICROSERVICE_NAME}}/**": {
"target": "http://localhost:{{LOCAL_PORT}}",
"secure": false,
"changeOrigin": true,
"pathRewrite": {
"^/service/{{MICROSERVICE_NAME}}": ""
},
"logLevel": "debug"
},
"/**": {
"target": "{{C8Y_BASE_URL}}",
"secure": true,
"changeOrigin": true,
"logLevel": "debug"
}
}
[!WARNING] Because the target cloud tenant URL (
{{C8Y_BASE_URL}}) is hardcoded in the catch-all block ofproxy.conf.json, you MUST verify and update this file whenever the target environment URL or tenant changes. Failing to do so will result in routing conflicts or 401/404 errors.
Antigravity Instructions:
proxy.conf.json) is correctly generated using the template above.proxy.conf.json exists in the UI project root, and ensure "proxyConfig": "proxy.conf.json" is added under the serve options in angular.json.Since the backend is a real cloud tenant, data created is persistent.
AG_TEST_.AG_TEST_ prefix created in the last hour and issue DELETE requests.ID and a direct link to the object in the Cumulocity Device Management/Cockpit UI for manual inspection.C8Y_TENANT variable to ensure you are not running tests against a Production environment.POST/PUT/DELETE requests, ensure the X-XSRF-TOKEN is extracted from the cookies and sent in the header if the platform session requires it.