Backstop JS and Lando

by Stephen Cross


Posted on Mar 23rd, 2019


Backstop and Lando

I've recently started using Backstop JS for visual regression testing. You can add the following settings to your Lando configuration, .lando.yml, to include Backstop JS.

services:
  node:
    type: node:10
    globals:
      backstopjs: "latest"
    command: npm start
    run_as_root:
      - apt-get -y update && apt-get -y install software-properties-common
      - wget https://dl-ssl.google.com/linux/linux_signing_key.pub && apt-key add linux_signing_key.pub
      - add-apt-repository "deb http://dl.google.com/linux/chrome/deb/ stable main"
      - apt-get -y update && apt-get -y install google-chrome-stable
tooling:
  backstop:
    service: node

You will need to use the .internal URL from Lando to access the local website. For example:

  "scenarios": [
    {
      "label": "Homepage",
      "url": "http://appserver_nginx.your-site-name.internal"
    }

The backstop commands will be run through Lando tooling:

lando backstop reference
lando backstop test

-S


Comments


Tags: Drupal


This Website
This website is an experiment. It's built with Sculpin, which is a static site generator written in PHP. It converts Markdown files, Twig templates and standard HTML into a static HTML site that can be easily deployed. Learn more about this website build.