Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit 80cbafb

Browse files
feat(tests): Add Percy Visual Snapshots
1 parent 3b440a9 commit 80cbafb

File tree

4 files changed

+674
-25
lines changed

4 files changed

+674
-25
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Visual Snapshots
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Install
10+
run: yarn install
11+
- name: Build
12+
run: yarn build
13+
- name: Run Percy to check visual changes
14+
uses: percy/[email protected]
15+
with:
16+
command: "yarn test:e2e"
17+
env:
18+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@material-ui/icons": "4.11.2",
5050
"@material-ui/styles": "^4.11.2",
5151
"@octokit/rest": "16.43.2",
52+
"@percy/puppeteer": "^1.1.0",
5253
"@testing-library/dom": "^7.29.0",
5354
"@testing-library/jest-dom": "^5.11.6",
5455
"@testing-library/react": "10.4.9",

test/e2e/e2e.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { percySnapshot } = require('@percy/puppeteer');
2+
13
const protectedPackageMetadata = require('./partials/pkg-protected');
24
const scopedPackageMetadata = require('./partials/pkg-scoped');
35

@@ -58,6 +60,7 @@ describe('/ (Verdaccio Page)', () => {
5860
await page.waitFor(1000);
5961

6062
expect(text).toContain('verdaccio-server-e2e');
63+
await percySnapshot(page, 'main page - should display a title');
6164
});
6265
//
6366

0 commit comments

Comments
 (0)