npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@syngrisi/playwright-sdk

v2.2.4

Published

Syngrisi Playwright SDK

Downloads

11

Readme

Syngrisi Playwright SDK

Syngrisi Playwright SDK, @syngrisi/playwright-sdk provides a simple and powerful way to integrate visual regression testing into your Playwright tests. By using this SDK, you can send snapshots from your browser tests to the Syngrisi server for comparison against baseline images, and easily manage visual testing sessions.

Features

  • Start and stop test sessions seamlessly within your test flows.
  • Perform visual checks with automatic baseline comparison.
  • Fetch baseline and snapshot data programmatically.
  • Easily extendable to fit any Playwright-based testing framework.

Installation

To install the Syngrisi Playwright SDK, run:

npm install @syngrisi/playwright-sdk

Base Workflow Overview

There is 3 basic step for particular test:

Usage

The following is a standard workflow to use the SDK in your tests:

1. Initialize the Driver

Before starting your test session, initialize the driver with the necessary configuration.

import { PlaywrightDriver } from '@syngrisi/playwright-sdk';

const config = {
    apiKey: 'your-api-key',
    serverUrl: 'your-singrisi-url'
};

const driver = new PlaywrightDriver(config);

2. Start a Test Session

Start a test session with the desired parameters.

const sessionParams = {
    os: 'Windows',
    viewport: '1920x1080',
    browserName: 'chrome',
    browserVersion: '89.0',
    test: 'Homepage Test',
    app: 'Your App',
    run: 'Run 1',
    branch: 'main',
    runident: 'unique-run-identifier',
    suite: 'My Test Suite',
    tags: ['tag1', 'tag2']
};

await driver.startTestSession({ params: sessionParams });

3. Perform a visual Check

Perform a visual check by providing the check name, image buffer, and any additional parameters.

const fullPageSreenshot = await page.screenshot({fullPage: true});
const headerScreenshot = page.locator('#header').screenshot();
// first check
driver.check({
    checkName: 'Main Page',
    imageBuffer: fullPageSreenshot,
    params: {
        viewport: '1200x800',
        browserName: 'chrome',
        os: 'Windows',
        app: 'MyProject',
        branch: 'develop'
    }
});

// second check
driver.check({
    checkName: 'Header',
    imageBuffer: headerScreenshot,
    params: {/* other parameters */ }
});

await driver.check({ 'About Page', imageBuffer_02, params: {/* other parameters */ } });

4. Stop the Test Session

Once all checks are completed, stop the test session.

await driver.stopTestSession();

Environment variables

Environment variables are used to modify the behavior of the Syngrisi Playwright SDK without code changes.

Example: To set the log level to debug, use the following command:

Windows: set SYNGRISI_LOG_LEVEL=debug macOS/Linux: export SYNGRISI_LOG_LEVEL=debug

SYNGRISI_LOG_LEVEL - logging level ("trace" | "debug" | "info" | "warn" | "error")

Documentation

For detailed information about all available methods, parameters, and configurations, please refer to the [Syngrisi packages documentation](TODO ADD LINK TO ROOT docs folder published on github.io).

License

This project is licensed under the MIT License.