Skip to content

Commit

Permalink
initial backstop.json config and setup of action
Browse files Browse the repository at this point in the history
  • Loading branch information
miriamgoldman committed Jul 31, 2024
1 parent b0ec1a3 commit 42014cf
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 25 deletions.
Empty file added .github/workflows/backstop.yml
Empty file.
37 changes: 12 additions & 25 deletions .github/workflows/multidev-removal.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
name: Delete closed PR multidevs
name: VRT with Backstop JS
on:
pull_request:
types: [closed]
branches:
- main

jobs:
configure_env:
name: Configure environment and Terminus
install_node:
name: Run BackstopJS
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Install Node 20
uses: actions/setup-node@v1
with:
php-version: "8.2"
- name: Install Terminus
uses: pantheon-systems/terminus-github-actions@main
with:
pantheon-machine-token: ${{ secrets.TERMINUS_TOKEN }}
node-version: 20.9

- name: Install Backstop
run: npm install backstopjs



remove_pr_env:
runs-on: ubuntu-latest
needs: [ configure_env ]
if: github.event_name == 'pull_request'
steps:
- name: Install Terminus
uses: pantheon-systems/terminus-github-actions@v1
with:
pantheon-machine-token: ${{ secrets.TERMINUS_TOKEN }}

- name: Determine target environment and maybe delete it
run: |
# Use the PR number as the environment name
prnum="pr-${{ github.event.pull_request.number }}"
terminus env:delete ${{ vars.SITE_NAME }}.$prnum --delete-branch --yes
59 changes: 59 additions & 0 deletions backstop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
},
{
"label": "desktop",
"width": 1920,
"height": 1080
}
],
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js",
"scenarios": [
{
"label": "Homepage",
"cookiePath": "backstop_data/engine_scripts/cookies.json",
"url": "https://dev-miriam-workflows-2.pantheonsite.io/",
"referenceUrl": "",
"readyEvent": "",
"readySelector": "",
"delay": 20,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": 0,
"selectors": [],
"selectorExpansion": true,
"expect": 0,
"misMatchThreshold" : 0.1,
"requireSameDimensions": true
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"engine_scripts": "backstop_data/engine_scripts",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"]
},
"asyncCaptureLimit": 5,
"asyncCompareLimit": 50,
"debug": false,
"debugWindow": false
}

0 comments on commit 42014cf

Please sign in to comment.