Roots Discourse

Bedrock + Vistual Testing within 10 lines of code


Catch visual bugs before they’re released to your customers


  1. Get a account
  2. Install system requirements
  3. Install the percy-capybara-bedrock gem
    $ cd /path/to/bedrock
    $ bundle add percy-capybara-bedrock

Define your tests

# <bedrock>/percy.rb
require "percy/capybara/bedrock/anywhere"

# URL pointing to the local or remote host
server = "http://localhost:8080"

# Absolute path to a web root directory
web_root = File.expand_path("../web/", __FILE__)

# Path where your webserver hosts the WordPress site
assets_base_url = "/", web_root, assets_base_url) do|page|
  Percy::Capybara.snapshot(page, name:"Homepage")

More examples at

Make sure your Bedrock site is up and running

Easilest way to make it runs at http://localhost:8080:

$ cd /path/to/bedrock
$ wp server --docroot=web

Run the tests

$ cd /path/to/bedrock
$ PERCY_TOKEN=my-secret-token PERCY_BRANCH=local PERCY_DEBUG=1 bundle exec ruby percy.rb


If you have a simpler / more elegant solution, we are hiring.

Alt text