1.0.5 • Published 2 years ago

@pixolith/percy-cli v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Percy Cli

How to use

Put the following percy object inside the projects package.json. Setup percy.io and connect the project to github. Builds will run on every deployment.

Options

Optional parameters can be omitted and will be filled with the default percy configuration of this package.

If you only want to use the default settings from this package, just place the following object inside your projects package.json

"percy": {
  "version": 2
}

Full Config Example

"percy": {
  // percy version (required)
  "version": 2,
  // percy snapshot options (optional) (default see package json)
  "snapshot": {
    // screen widths to be snapshotted by percy (max-width is 2000)
    "widths": [
        320,
        468,
        768,
        1024,
        1920
    ],
    // screen min-height to be applied in snapshots
    "minHeight": 2000,
    // add custom css to e.G hide an iframe or layer (css string only)
    "percyCss": "iframe { display: none; }",
    // number specifying the pixel density to render the page in (default=1)
    "device-pixel-ratio": 1
  },
  // discovery options to use for this snapshot's asset discovery (optional) (default see percy docs)
  "discovery": {
    // additional hostnames to save asset contents from (no default)
    "allowedHostnames": [],
    // hostnames to immediately abort requests from (no default)
    "disallowedHostnames": [],
    // HTTP headers to be sent for each request made during asset discovery (no default)
    "requestHeaders": {
      "Authorization": ""
    },
    // username/password combo to authenticate requests for Percy (no default)
    "authorization": {
      "username": "",
      "password": ""
    },
    // amount of time in miliseconds when the snapshot gets canceled after the page had zero network requests (no default)
    "networkIdleTimeout": 500,
    // maximum concurrency in snapshotting - usually this is fine (should not exceed 6) (no default)
    "concurrency": 3,
    // Disables asset discovery caches (no default)
    "disableCache": false,
    // Options for the asset discovery (default see below)
    "launchOptions": {
      // Path to a Chromium browsers executable on disk (no default)
      "executable": "/path/to/chromium/executable",
      // Hide or show browser (default=true)
      "headless": true,
      // Browser args (no default)
      "args": [],
      // Timeout for how long the browser will try to launch (default=30000) 
      "timeout": 30000
    }
  },
  // Percy stage (optional) (default see package json)
  "stage": {
    // Server environment (optional)
    "staging": {
      // Urls to test (optional)
      "urls": [
        "/",
        "/kontakt",
        "/saisonale-dekoration",
      ]
    },
    "production": {
      "urls": [
        "/",
        "/kontakt",
        "/saisonale-dekoration",
      ]
    }
  }
}