Core

Everything has a beginning ;)

All adapters are using the core to provide a shared integration and easy extensibility. You can use one of our Adapters or write your own based on the core to be able to get updates and new features with less effort.

If you are using a different language than we provide go to this section API

If you want to use the core module than just install it

npm i @visual-knight/core

The code for the libraries are written in typescript.

How to use the core module
import {
VisualKnightCore,
IProcessScreenshotOptionsUser
} from "@visual-knight/core";
const userConfig: IProcessScreenshotOptionsUser;
const visualKnightCoreInstance = new VisualKnightCore(userConfig);
// to start a screenshot comparison just use
const testName: string = "My Testname";
const screenshot: Base64 = new Buffer() // <-- this must be your screenshot
// In additional you can put any kind of information which you need for your Variation
const additional: { [key: string]: string|number|boolean } = { someInformation: "1" }
visualKnightCoreInstance.processScreenshot(testName, screenshot, additional)
.then(() => console.log("success"))
.catch((error) => console.error(error))

Core Options

{
// Your Visual Knight Api key
// Required
key: string;
// Your project name or ID
// Required
project: string;
// Browser e.g.: Chrome
// Required
browserName: string;
// Device e.g.: Mac Os
// Required
deviceName: string;
// Accept first testsession for a variation as baseline
// Optional
// Default: false
autoBaseline?: boolean;
// The mismatch tolerance for the comparison, 0.01 is 1%
// Optional
// Default: 0.01
misMatchTolerance?: number;
// You don't want realtime feedback in your CI? ;)
// It just sends the image and continues as successful test without feedback
// Optional
// Default: true
liveResult?: boolean;
}