@wopee-io/sdk
v3.8.2
Published
JavaScript/TypeScript SDK for Wopee.io autonomous testing platform — integrate visual and functional testing into your apps
Readme
Wopee.io JavaScript SDK for Autonomous Testing
Connect any JavaScript or TypeScript test framework to Wopee.io for visual regression testing. Capture screenshots from your tests and let Wopee.io compare them against baselines — with AI-powered autonomous maintenance.
When to use this SDK
Use @wopee-io/sdk when you want to add visual testing to a framework that doesn't have a dedicated Wopee.io plugin. If you use Playwright, Cypress, or WebdriverIO, use the dedicated packages instead:
- Playwright →
@wopee-io/wopee.pw - Cypress →
@wopee-io/wopee.cy - WebdriverIO →
@wopee-io/wopee.wdio
Installation
npm install @wopee-io/sdkQuick Start
1. Get your credentials
Sign up at cmd.wopee.io and create a project. You'll need:
- API Key — from Project Settings → API Keys
- Project UUID — from Project Settings
2. Set environment variables
export WOPEE_API_URL=https://api.wopee.io
export WOPEE_API_KEY=your-api-key
export WOPEE_PROJECT_UUID=your-project-uuid3. Capture and track screenshots
import { ApolloTrackAdapterService } from '@wopee-io/sdk';
// Create a tracker instance
const tracker = ApolloTrackAdapterService.create({
apiUrl: process.env.WOPEE_API_URL,
apiKey: process.env.WOPEE_API_KEY,
projectId: process.env.WOPEE_PROJECT_UUID,
});
// Start a test suite
await tracker.startSuite('My Test Suite');
// Track a screenshot (pass a base64-encoded image)
await tracker.track({
stepName: 'Homepage',
imageBase64: screenshotData,
});
// Track another step
await tracker.track({
stepName: 'After Login',
imageBase64: anotherScreenshot,
});
// End the suite
await tracker.stopSuite();Example: Integration with Puppeteer
import { ApolloTrackAdapterService } from '@wopee-io/sdk';
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
const tracker = ApolloTrackAdapterService.create({
apiUrl: process.env.WOPEE_API_URL,
apiKey: process.env.WOPEE_API_KEY,
projectId: process.env.WOPEE_PROJECT_UUID,
});
await tracker.startSuite('Puppeteer Visual Tests');
await page.goto('https://example.com');
const screenshot = await page.screenshot({ encoding: 'base64' });
await tracker.track({ stepName: 'Homepage', imageBase64: screenshot });
await tracker.stopSuite();
await browser.close();How it works
- Your test captures a screenshot (any method — Puppeteer, Selenium, custom)
- The SDK sends the base64 image to the Wopee.io API
- Wopee.io compares it against the stored baseline
- Results are available in the Wopee.io dashboard
- AI-powered maintenance automatically handles expected UI changes
Links
- Documentation — setup guides and API reference
- Wopee.io Platform — manage baselines, review results
- Wopee.io Website — learn more about autonomous testing
