@percy/client
JavaScript API client library for Percy.
Docs here: https://percy.io/docs/api/javascript-client
Use yarn test
to run the tests
[Deprecated] JavaScript API client library for Percy.
License: MIT License
@percy/client
JavaScript API client library for Percy.
Use yarn test
to run the tests
The jssha@v2
version that you're currently using is deprecated and prints a warning during installation:
➤ YN0061: │ jssha@npm:2.4.2 is deprecated: jsSHA versions < 3.0.0 will no longer receive feature updates
Consider upgrading to v3 and then updating the other Percy packages that depend on this percy-client
package (namely @percy/agent
):
├─ @percy/agent@npm:0.28.6 (via npm:^0.28.5)
│ └─ percy-client@npm:3.8.0 (via npm:^3.2.0)
│ └─ jssha@npm:2.4.2 (via npm:^2.1.0)
Hi,
Given a Rails app with dotenv-rails
and a .env.test
file.
When running rails app tests preceded with yarn percy exec
.
.env.test
is ignored.
I built a test app reproducing this, with test green on master
, and showing the issue on a sample PR that adds percy-capybara and @percy/agent (as recommended in the doc): https://github.com/grzuy/visual_tested_app/pull/1.
Thank you!
Hi.
I'm using nightwatch.js to run e2e tests and I want to use Percy.io ?
How should I proceed ? Do I have to use the javascript low level API ?
I see you have an integration with nightmare.js : https://github.com/percy/example-percy-nightmare/blob/master/test/test.js
Do you intend to integrate with nightwatch.js ?
Best regards
This is arguably a dev dependency and should be removed from the optional deps.
Default branch recognition isn't working for Semaphore 2. I've noticed the problem when the branch shows unknown-branch
in our Percy builds.
Semaphore Classic uses the variable BRANCH_NAME
but Semaphore 2 uses SEMAPHORE_GIT_BRANCH
.
Environment Variables docs for
Need to migrate calls and variables away from the legacy /repos
API endpoint to the modern /projects
endpoint.
Getting error message
Uploading x snapshots to Percy.
Error: { StatusCodeError: 400 - {"errors":[{"status":"bad_request"},{"source":{"pointer":"/data/attributes/sha"},"detail":"Sha must be 40 hexadecimal characters"}]}
In pull requests, but the same pipeline will run fine when triggered manually or by commit. My use case is that I would like to only run percy on the main branch and on PRs to that branch, not on individual feature branch commits or the like.
My pipeline uses the pull-requests build variant, like so:
image: circleci/node:10.22.1-browsers
pipelines:
pull-requests:
'**':
- step:
caches:
- npm
script:
- npm ci
- npm run-script build:storybook // build-storybook
- npm run-script test:visual // percy-storybook --widths=320,1080
definitions:
caches:
npm: $HOME/.npm
I can work around the problem by using a configuration that always builds every commit:
image: circleci/node:10.22.1-browsers
pipelines:
default:
- step:
caches:
- npm
script:
- npm ci
- npm run-script build:storybook // build-storybook
- npm run-script test:visual // percy-storybook --widths=320,1080
definitions:
caches:
npm: $HOME/.npm
Line 160 in ed3d495
Looking at the line above, it seems that Percy is resorting to the PR builder plugin branch, however on master builds on Jenkins, the branch becomes HEAD.
I've found GIT_BRANCH to work better, however, that has an issue that it reports origin/master
and Percy uses master
for baseline snapshots. I couldn't find anywhere to change the baseline branch so I ended up writing this script:
#!/usr/bin/env node
const cli = require('@percy-io/percy-storybook/lib/cli');
process.env.PERCY_BRANCH = process.env.GIT_BRANCH === 'origin/master' ? 'master' : process.env.GIT_BRANCH;
process.env.PERCY_TOKEN = '***';
process.env.PERCY_PROJECT = '***';
cli.run([
'--build_dir=storybook-content',
'--widths = 320, 1280'
]).then(() => {
process.on('exit', () => process.exit(0));
})
.catch(err => {
console.log('Error: ', err); // eslint-disable-line no-console
process.on('exit', () => process.exit(1));
});
which I now use to run from NPM. Works for now, but would be awesome if Percy did the smart work.
We are using Percy on a project, and I am trying to explore using the percy-js module for some more custom functionality for the app. Unfortunately, there doesn't seem to be any documentation, despite the link to the percy.io site :(
Is there any plan to publish documentation for this module? Happy to help in any way I can :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.