Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc