Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@guardian/paparazzi

Package Overview
Dependencies
Maintainers
18
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guardian/paparazzi

Takes a ton of screenshots

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
85
decreased by-43.71%
Maintainers
18
Weekly downloads
 
Created
Source

Paparazzi

Automated manual visual regression testing

Sometimes you are working in a project with a couple of GET routes and you are changing an element that's quite global and you want to make sure you aren't accidentally breaking some obscure part of the site sitting elsewhere. If this is you please keep reading!

screenshot 2018-12-17 at 10 31 45 am

Paparazzi spins up a ton of browsers using puppeteer and takes screenshots of all paths you specify at any sizes you specify.

Install and setup

Clone this repo and run npm i to install all dependencies (it's just puppeteer and chalk to make logs colourful. Very important.). Then run npm link to get a global paparazzi command(1). Let this sit wherever.

Now let's create a blank folder for our tests, in it we need to create a .paparazzirc config file, it's JSON and here's an example:

{
  // Name of the folder where screenshots will go to
  "out": "screenies",
  
  // List of routes you wanna screenshot
  "routes": [
    "uk",
    "showcase",
    "uk/subscribe",
    "uk/subscribe/paper",
    "uk/subscribe/digital",
    "uk/subscribe/weekly",
    "uk/contribute",
    "uk/contribute/recurring",
    "paypal/return"
  ],
  
  // Domain you want to test the routes against
  "prefix": "https://support.thegulocal.com/",
  
  // Screen size pairs
  "sizes": {
    "desktop": {
      "width": 1440,
      "height": 900
    },
    "phone": {
      "width": 375,
      "height": 1100
    },
    "tablet": {
      "height": 1024,
      "width": 768
    }
  }
}

Now run paparazzi and watch the screenshots appear in front of your eyes.

Can I set this up as a CI step?

Maybe? If you do please let me know, i'd love to get this thing commenting with screenshots on PRs

Help my computer caught fire

Paparazzi spins a whole chrome instance per route, if this is a problem for you please consider either throwing sticks of ram at your laptop until the fire is out or help me implement something like this

(1) Can I use this locally?

Sure thing pal! Just run ./index.js or node index.js in the paparazzizi folder. You will have to put your .paparazzirc file in there.

FAQs

Package last updated on 17 Dec 2018

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