{"id":13878881,"url":"https://github.com/percy/percy-capybara","last_synced_at":"2025-07-16T14:33:15.450Z","repository":{"id":32178994,"uuid":"35752402","full_name":"percy/percy-capybara","owner":"percy","description":"Visual testing for Capybara with Percy.","archived":false,"fork":false,"pushed_at":"2024-04-29T15:40:35.000Z","size":582,"stargazers_count":44,"open_issues_count":2,"forks_count":25,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-29T16:58:09.512Z","etag":null,"topics":["capybara","percy","percy-agent","percy-capybara","percy-sdk","rails","ruby","visual-testing"],"latest_commit_sha":null,"homepage":"https://docs.percy.io/docs/capybara","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/percy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-17T04:48:37.000Z","updated_at":"2024-06-02T19:29:56.277Z","dependencies_parsed_at":"2024-01-13T20:50:30.757Z","dependency_job_id":"80b91c3c-6bce-4ce0-bc49-57602dfb49f2","html_url":"https://github.com/percy/percy-capybara","commit_stats":{"total_commits":305,"total_committers":23,"mean_commits":13.26086956521739,"dds":"0.45245901639344266","last_synced_commit":"397b9c2b5cbbde96604dc44fcff4b0b70cb19d1f"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percy%2Fpercy-capybara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percy%2Fpercy-capybara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percy%2Fpercy-capybara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percy%2Fpercy-capybara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/percy","download_url":"https://codeload.github.com/percy/percy-capybara/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226138849,"owners_count":17579496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capybara","percy","percy-agent","percy-capybara","percy-sdk","rails","ruby","visual-testing"],"created_at":"2024-08-06T08:02:03.116Z","updated_at":"2024-11-24T07:31:23.586Z","avatar_url":"https://github.com/percy.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# percy-capybara\n[![Gem Version](https://badge.fury.io/rb/percy-capybara.svg)](https://badge.fury.io/rb/percy-capybara)\n![Test](https://github.com/percy/percy-capybara/workflows/Test/badge.svg)\n\n[Percy](https://percy.io) visual testing for Ruby Selenium.\n\n## Installation\n\nnpm install `@percy/cli`:\n\n```sh-session\n$ npm install --save-dev @percy/cli\n```\n\ngem install `percy-capybara` package:\n\n```ssh-session\n$ gem install percy-capybara\n```\n\n## Usage\n\nIn your test setup file, require `percy/capybara`. For example if you're using\nrspec, you would add the following to your `spec_helper.rb` file:\n\n``` ruby\nrequire 'percy/capybara'\n```\n\nNow you can use `page.percy_snapshot` to capture snapshots.\n\n\u003e Note: you may need to add `js: true` to your specs, depending on your driver setup\n\n```ruby\ndescribe 'my feature, type: :feature do\n  it 'renders the page' do\n    visit 'https://example.com'\n    page.percy_snapshot('Capybara snapshot')\n  end\nend\n```\n\nRunning the test above normally will result in the following log:\n\n```sh-session\n[percy] Percy is not running, disabling snapshots\n```\n\nWhen running with [`percy\nexec`](https://github.com/percy/cli/tree/master/packages/cli-exec#percy-exec), and your project's\n`PERCY_TOKEN`, a new Percy build will be created and snapshots will be uploaded to your project.\n\n```sh-session\n$ export PERCY_TOKEN=[your-project-token]\n$ percy exec -- [test command]\n[percy] Percy has started!\n[percy] Created build #1: https://percy.io/[your-project]\n[percy] Snapshot taken \"Capybara example\"\n[percy] Stopping percy...\n[percy] Finalized build #1: https://percy.io/[your-project]\n[percy] Done!\n```\n\n## Configuration\n\n`page.snapshot(name[, options])`\n\n- `name` (**required**) - The snapshot name; must be unique to each snapshot\n- `options` - [See per-snapshot configuration options](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#per-snapshot-configuration)\n\n## Upgrading\n\n### Automatically with `@percy/migrate`\n\nWe built a tool to help automate migrating to the new CLI toolchain! Migrating\ncan be done by running the following commands and following the prompts:\n\n``` shell\n$ npx @percy/migrate\n? Are you currently using percy-capybara? Yes\n? Install @percy/cli (required to run percy)? Yes\n? Migrate Percy config file? Yes\n? Upgrade SDK to percy-capybara@^5.0.0? Yes\n? The Capybara API has breaking changes, automatically convert to the new API? Yes\n```\n\nThis will automatically run the changes described below for you, with the\nexception of changing the `require`.\n\n### Manually\n\n#### Require change\n\nThe name of the require has changed from `require 'percy'` to `require\n'percy/capybara'`. This is to avoid conflict with our [Ruby Selenium SDK's](https://github.com/percy/percy-selenium-ruby)\nrequire statement.\n\n#### API change\n\nThe previous version of this SDK had the following function signature:\n\n``` ruby\nPercy.snapshot(driver, name, options)\n```\n\nv5.x of this SDK has a significant change to the API. There no longer is a stand\nalone module to call and you no longer need to pass the page/driver. It's\navailable on the current Capybara session (`page`):\n\n``` ruby\npage.percy_snapshot(name, options)\n```\n\nIf you were using this SDK outside of Capybara, you'll likely find the [Ruby\nSelenium SDK a better fit](https://github.com/percy/percy-selenium-ruby)\n\n#### Installing `@percy/cli` \u0026 removing `@percy/agent`\n\nIf you're coming from a 4.x version of this package, make sure to install `@percy/cli` after\nupgrading to retain any existing scripts that reference the Percy CLI\ncommand. You will also want to uninstall `@percy/agent`, as it's been replaced\nby `@percy/cli`.\n\n```sh-session\n$ npm uninstall @percy/agent\n$ npm install --save-dev @percy/cli\n```\n\n#### Migrating config\n\nIf you have a previous Percy configuration file, migrate it to the newest version with the\n[`config:migrate`](https://github.com/percy/cli/tree/master/packages/cli-config#percy-configmigrate-filepath-output) command:\n\n```sh-session\n$ percy config:migrate\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercy%2Fpercy-capybara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercy%2Fpercy-capybara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercy%2Fpercy-capybara/lists"}