Capturing multiple asset hosts
Enable capturing assets of multiple hosts
- This feature is applicable when using Percy SDK.
- You are viewing docs for the new
@percy/cli
. Most SDKs have been updated to utilize the new CLI, so check the appropriate SDK doc for instructions for your specific SDK!
By default Percy’s SDKs will only capture assets that have a matching hostname to where the snapshot was captured.
For example, if you’re taking snapshots on https://example.com
, and the page has assets hosted on https://cdn.example.com
, the cdn.example
assets will not be captured. In order to capture assets from other hostnames, you will need to each add one to the allowed-hostnames
config.
allowed-hostnames
can be set via a command line flag (-h
or --allowed-hostname
) when using percy exec
:
$ percy exec -h cdn.example.com -- [your test command]
It also can be set in the Global SDK configuration file. Using yml as an example:
version: 2
discovery:
allowed-hostnames:
- cdn.example.com
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!