🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

node-spectre

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-spectre

Node Library for Spectre Visual Regression Testing tool

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
898
116.39%
Maintainers
1
Weekly downloads
 
Created
Source

node-spectre

This library is experimental and the API is likely to change.

Node Library for Spectre, a Visual Regression Testing tool.

Installation

npm install --save node-spectre

Usage

const Spectre = require('node-spectre');

spectre = new Spectre('https://path.to.spectre.server');

spectre
      .startRun('Project Name', 'Suite Name')
      .then(function (id) {
        spectre.uploadScreenshot(run_id, 'Test Name', 'Firefox', 'desktop', './screenshot.png');
      })

WebdriverIO example:

const Spectre = require('node-spectre');

describe('Login Page', () => {
  let run_id, spectre;

  before(function (done) {
    spectre = new Spectre('https://node-spectre.herokuapp.com');

    return spectre
      .startRun('Test your login', this.test.parent.fullTitle())
      .then(function (id) {
        run_id = id;
      })
  })

  afterEach(function () {
    return spectre.uploadScreenshots()
  });

  it('should let you log in', function () {
    browser.url('/');

    let ss = browser.saveScreenshot();

    spectre.queueScreenshot(run_id, 'login page', browser.desiredCapabilities.browserName, 'desktop', ss);

    browser.setValue('[name="login"]', 'username');

    ss = browser.saveScreenshot();

    spectre.queueScreenshot(run_id, 'login page', browser.desiredCapabilities.browserName, 'desktop', ss);
  })
})

Keywords

testing

FAQs

Package last updated on 25 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts