There is a new kid on the block, @percy/cli, that takes what @percy/agent has done and makes it more robust, more modular, more extensible, and more feature-rich than @percy/agent can ever be in its current state. This PR brings @percy/cli to this SDK by refactoring the entire SDK from the ground up, including new tests, new CI config, and other niceties. The new @percy/cli has many benefits over @percy/agent, so I won't list all of them here. But importantly, there are a few necessary breaking changes.
Breaking Changes
The require into your test helper has changed from require 'percy' to require 'percy/capybara'
percy-capybara now integrates into Capybara by adding percy_snapshot to the page method (the current Capybara session). The API changes from Percy.snapshot(page, name, options) to page.percy_snapshot(name, options).
The new CLI does not download Chromium on install, and instead does so the first time asset discovery is started. So even when choosing to install the CLI as a development dependency, it has a much smaller footprint than its predecessor. You can download this on postinstall, if you wish
The format of Percy configuration files has changed. Common options can be viewed in the @percy/core package, and previous configuration options can be migrated to the new format using percy config:migrate.
Repo Changes:
Tests were re-written to be functional. The previous tests were visual only and in reality were testing the behavior of @percy/agent using the SDK rather than testing the SDK itself. Coverage reporting has also been added and is a requirement for tests to pass to have complete coverage.
GitHub Actions are now the default CI and other CIs do not need to be tested within since this repo should be testing the SDK and not CI integrations. Separate workflows exist for linting and tests so their failures can be reported separately (rather than having tests be cancelled due to failed linting).
The changelog and release processes have also been updated to fully utilize GitHub features such as tags and releases. The semantic release bot and several semantic release packages were replaced with release-drafter which utilizes PRs and labels to create changelogs found alongside each release on the releases page.
Automatic package releasing is now a semi-manual process due to bots not always being able to correctly guess the proper version number and sometimes releasing the incorrect version. To release, the version number should be bumped appropriately and then the automatically created draft release can be published from the releases page. In the future, we can automate the version bump to reflect the release version to make this process smoother, while still requiring a human to approve the release.
TODO
[x] Update cache clearing to not be a method added to the capybara session class
[x] Review tests (make sure this has full coverage -- even if simple cov says its 100%)
[x] Update package name from percy to percy-capybara (require 'percy/capybara')
What is this?
There is a new kid on the block,
@percy/cli
, that takes what@percy/agent
has done and makes it more robust, more modular, more extensible, and more feature-rich than@percy/agent
can ever be in its current state. This PR brings@percy/cli
to this SDK by refactoring the entire SDK from the ground up, including new tests, new CI config, and other niceties. The new@percy/cli
has many benefits over@percy/agent
, so I won't list all of them here. But importantly, there are a few necessary breaking changes.Breaking Changes
The require into your test helper has changed from
require 'percy'
torequire 'percy/capybara'
percy-capybara
now integrates into Capybara by addingpercy_snapshot
to thepage
method (the current Capybara session). The API changes fromPercy.snapshot(page, name, options)
topage.percy_snapshot(name, options)
.The new CLI does not download Chromium on install, and instead does so the first time asset discovery is started. So even when choosing to install the CLI as a development dependency, it has a much smaller footprint than its predecessor. You can download this on postinstall, if you wish
The format of Percy configuration files has changed. Common options can be viewed in the
@percy/core
package, and previous configuration options can be migrated to the new format usingpercy config:migrate
.Repo Changes:
Tests were re-written to be functional. The previous tests were visual only and in reality were testing the behavior of
@percy/agent
using the SDK rather than testing the SDK itself. Coverage reporting has also been added and is a requirement for tests to pass to have complete coverage.GitHub Actions are now the default CI and other CIs do not need to be tested within since this repo should be testing the SDK and not CI integrations. Separate workflows exist for linting and tests so their failures can be reported separately (rather than having tests be cancelled due to failed linting).
The changelog and release processes have also been updated to fully utilize GitHub features such as tags and releases. The semantic release bot and several semantic release packages were replaced with release-drafter which utilizes PRs and labels to create changelogs found alongside each release on the releases page.
Automatic package releasing is now a semi-manual process due to bots not always being able to correctly guess the proper version number and sometimes releasing the incorrect version. To release, the version number should be bumped appropriately and then the automatically created draft release can be published from the releases page. In the future, we can automate the version bump to reflect the release version to make this process smoother, while still requiring a human to approve the release.
TODO
percy
topercy-capybara
(require 'percy/capybara'
)