0.1.5 • Published 2 years ago

@devtools-ai/js-sdk v0.1.5

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

dev-tools.ai sdk logo

npm version

Getting started

This starts the sdk and allows us to start interacting with the DevTools AI API.

const sdk = createSDK({ apiKey: 'YOUR_API_KEY_HERE' });

Sample usage:

const response = await sdk.createCheckIn('My test name');

API Methods: | Command | Description | | --- | --- | | createCheckIn | Creates a test session | | getIfScreenshotExists| Returns if a screenshot for a test already exists | | getTestCaseBox | Returns an object with properties like width, height, and position | | getIfFrozen | Returns if an element in a test is frozen | | updateTestElement | Updates an element in a test | | uploadTestElementScreenshot | Uploads a screenshot for an element in a test |

SDK Options:

OptionDescription
apiKeySets the API key to interact with the DevTools AI API
screenMultiplierAdjusts the display scaling ratio used when comparing element position within screenshots
useClassifierDuringCreation
baseUrlChanges the root address for the API. The default will work for most users.

Development

This repo uses pnpm as its package manager for speed and efficient disk space management. In addition to having a node-js version >= 12.0 installed, you will need to install pnpm globally:

npm install -g pnpm

Afterwards you can all in the dependencies to run or build the SDK.

pnpm install

To run the TypeScript complier and build the files to regular JS files, run:

pnpm run build

This will build the files to a dist folder.