{"id":18771043,"url":"https://github.com/rareloop/primer-backstop","last_synced_at":"2025-12-12T03:30:13.391Z","repository":{"id":62533333,"uuid":"52300974","full_name":"Rareloop/primer-backstop","owner":"Rareloop","description":"Automated regression testing for Primer based Pattern Libraries","archived":false,"fork":false,"pushed_at":"2016-02-22T20:01:53.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T07:43:14.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rareloop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-22T19:52:06.000Z","updated_at":"2016-02-22T19:58:12.000Z","dependencies_parsed_at":"2022-11-02T15:02:36.362Z","dependency_job_id":null,"html_url":"https://github.com/Rareloop/primer-backstop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rareloop%2Fprimer-backstop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rareloop%2Fprimer-backstop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rareloop%2Fprimer-backstop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rareloop%2Fprimer-backstop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rareloop","download_url":"https://codeload.github.com/Rareloop/primer-backstop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239678103,"owners_count":19679202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T19:22:58.882Z","updated_at":"2025-12-12T03:30:13.291Z","avatar_url":"https://github.com/Rareloop.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Primer Backstop\nA module for [Primer](https://github.com/Rareloop/primer) that provides simple visual regression testing using [BackstopJS](https://github.com/garris/BackstopJS).\n\n## Pre-requisites\nBackstopJS requires a few NPM modules to be installed globally:\n\n````\nsudo npm install -g gulp\nsudo npm install -g phantomjs\nsudo npm install -g casperjs\n````\n\n*This module assumes you're using a Unix based system (e.g. Linux, Mac OS X). It hasn't been tested on Windows but almost certainly won't work without some tweaking!*\n\n## Installation\nAdd the following to your `composer.json` object:\n\n````json\n\"rareloop/primer-backstop\": \"dev-master\"\n````\n\nWe also need to install some non PHP dependencies so add the following to your `composer.json`:\n\n````json\n\"scripts\": {\n    \"post-install-cmd\": [\n        \"cd vendor/rareloop/primer-backstop \u0026\u0026 npm install\"\n    ],\n\n    \"post-update-cmd\": [\n        \"cd vendor/rareloop/primer-backstop \u0026\u0026 npm install\"\n    ]\n}\n````\n\nUpdate your dependencies:\n\n````\ncomposer update\n````\n\n## Usage\nOnce installed you'll need to add some commands to Primer. Edit your `bootstrap/start.php` and add the following:\n\n````php\nEvent::listen('cli.init', function ($cli) {\n    $cli-\u003eadd(new \\Rareloop\\Primer\\Backstop\\Commands\\ConfigCommand);\n    $cli-\u003eadd(new \\Rareloop\\Primer\\Backstop\\Commands\\ReferenceCommand);\n    $cli-\u003eadd(new \\Rareloop\\Primer\\Backstop\\Commands\\TestCommand);\n});\n````\n\nThis will add 3 commands to the Primer CLI.\n\n### Configuration\n````\nphp primer backstop:config\n````\n\nThis will create a file in the root of your project called `backstop.config.js`. Edit this file to update the viewports you wish to test.\n\n### Reference Images\n````\nphp primer backstop:reference\n````\n\nThis creates reference images for all elements and components at each viewport size and stores them in `backstop/bitmaps_reference`. These images are the baseline images that future tests will be run against.\n\nBy default reference images will be created for all your `elements` and `components`. You can change this by adding which sections you want to test to the CLI, e.g.\n\n````\n# Test templates and components but not elements\nphp primer backstop:reference --templates --components\n````\n\n### Run Test\n````\nphp primer backstop:test\n````\n\nThis creates reference images for all elements and components at each viewport size and compares them against the reference images already created. Depending on the settings in `backstop.config.js` this will present a report via the CLI and/or open a browser for more visual feedback.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frareloop%2Fprimer-backstop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frareloop%2Fprimer-backstop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frareloop%2Fprimer-backstop/lists"}