How to use the @percy/puppeteer.Percy function in @percy/puppeteer

To help you get started, we’ve selected a few @percy/puppeteer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / polaris-react / scripts / percy-snapshots.js View on Github external
(async () => {
  // If a build is from a forked repository, CircleCI does not pass environment
  // environment variables into the build to prevent credential leakage.
  // In that case, exit cleanly so the build does not fail.
  // Once we start using @percy/puppeteer v1 this can be removed as it is
  // checked within Percy. See https://github.com/percy/percy-puppeteer/pull/3
  if (!process.env.PERCY_TOKEN) {
    console.log('No PERCY_TOKEN provided. Skipping snapshots.');
    process.exit();
  }

  const percy = new Percy({
    loaders: [
      new FileSystemAssetLoader({
        buildDir: './playground/build/assets',
        mountPath: '/assets',
      }),
    ],
  });

  const browsers = [
    {
      browser: await puppeteer.launch(),
      taken: new Promise((resolve) => {
        resolve();
      }),
    },
    {

@percy/puppeteer

Pupppeteer client library for visual testing with Percy

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular @percy/puppeteer functions