Getting Started With TestChimp
Quick Start
Step 1 - Sign Up
Sign up at https://prod.testchimp.io/signup and create a project. Once created, go to Profile (Top Right) -> Project Settings -> Select the project, and copy the project id and the session recording api key values (to use in next step).
Step 2 - Install SDK
Run:
npm install testchimp-js@latest
Step 3 - Configure SDK
Add the following to your index.js (or equivalent)
import { TestChimpSDK } from "testchimp-js";
document.addEventListener('DOMContentLoaded', function() {
TestChimpSDK.startRecording({
projectId: "[PROJECT ID]",
sessionRecordingApiKey: "[SESSION RECORDING API KEY]",
untracedUriRegexListToTrack: ".*\\.your-domain\\.com.*$",
environment:"QA"
});
});
For a more detailed configuration guide (such as sampling probability, enabling recording conditionally on different environments etc.), refer here.
Step 4 - SetCurrentUserId (Recommended)
Call TestChimpSDK.setCurrentUserId(“<user_id>”) anytime during the session to record a readable user identifier (such as email), which will enable finding sessions by those user ids in TestChimp platform.
Step 5 - EndTrackedSession (Recommended)
Call TestChimpSDK.endTrackedSession() when the user logs out.
By default, the tracked session is cleared when the browser is closed. If you want to end the session when the user logs out from your application, call TestChimpSDK.endTrackedSession() when the user logs out.
Enabling Full Stack Capture
The above steps enable capturing frontend API interactions in a session (along with the UI), which can be used to create automation tests covering the API layer.
To enable full stack recording (and tests that cover the entire stack), do the following:
Enable OpenTelemetry in your stack. Guide
Add the relevant TestChimp backend SDK (and configure) in your backend services
Change the untracedUriRegexListToTrack config key to tracedUriRegexListToTrack
Refer here for comprehensive guide on enabling OpenTelemetry and exporting to TestChimp.
Currently the following technologies are supported:
Next: Create Full Stack Tests from the captured sessions via TestChimp Test Studio.