Git Product home page Git Product logo

nemo-eyes's Introduction

nemo-eyes

A nemo plugin for automated visual testing using Applitools Eyes.

Installation

  1. Add dependencies to package.json and install.
	...
    "nemo": "^1.0.0",
    "nemo-eyes": "^0.0.4",
	...
  1. Add nemo-eyes plugin to your nemo config JSON object. Also note eyes section under data
{
  "driver": {
    ...
  },
  "plugins": {
    "eyes": {
      "module": "path:../",
      "arguments": [
        {
          "sdk": {
            "setApiKey": "env:applitools_api_key",
            "setBatch": "desktop",
            "setForceFullPageScreenshot": true
          },
          "viewport": {
            "width": 1200,
            "height": 600
          },
          "mock": "env:applitools_mock"
        }
      ]
    }
  }
}

How to use

Once nemo-eyes plugin is registered, eyes namespace will be attached to nemo and methods for visual testing are exposed. Idea is to,

  1. Initialize your application and test using nemo.eyes.open('Sample Application','Homepage test');
  2. Trigger a visual check using nemo.eyes.checkWindow("PayPal Home Page");. If base image for the window in question is present, new screenshot will be compared against it. Otherwise new screenshot will be saved as a base image
  3. Close test and resolved promise will have corresponding results
    nemo.eyes.close().then( function(testResults){
        console.log(testResults.isPassed);
        console.log(testResults.url);
    });

Configuration

Configure nemo-eyes via the arguments section in the plugin configuration as above.

For any Eyes SDK method that can takes string arguments, you can program the Eyes SDK via the sdk section of the arguments object.

If you supply "mock": true or "mock": "true" via the config (as shown above), you can run your scripts without having to duck-type around the eyes calls in your script. This is handy if you're working on other aspects of your script and do not want to incur cost or any latency associated with calling out to Applitools.

Running a sample visual test using Applitools.

  1. In order to run a test you need to have an Applitools account (free track is available).
  2. Copy your API key from the tutorial page (choose "Automated visual tests", then scroll down to step 4), and set it in nemo examples/config/config.json file.
  3. go to the repository's root folder and run node examples/eyesTest.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.