Skip to content

Commit

Permalink
📝 Update README with PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Robdel12 committed May 6, 2021
1 parent 5171d71 commit 3ce99ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm install `@percy/cli`:
$ npm install --save-dev @percy/cli
```

gem install Percy selenium package:
gem install `percy-capybara` package:

```ssh-session
$ gem install percy-capybara
Expand All @@ -23,25 +23,23 @@ $ gem install percy-capybara
In your test setup file, require `percy/capybara`. For example if you're using
rspec, you would add the following to your `spec_helper.rb` file:


``` ruby
require 'percy/capybara'
```

Now you can use `page.percy_snapshot` to capture snapshots.

> Note: Percy requires JS to be enabled for snapshots to be captured.
> Note: you may need to add `js: true` to your specs, depending on your driver setup
```ruby
describe 'my feature, type: :feature, js: true do
describe 'my feature, type: :feature do
it 'renders the page' do
visit 'https://example.com'
page.percy_snapshot('Example snapshot')
page.percy_snapshot('Capybara snapshot')
end
end
```
Running the test above normally will result in the following log:
```sh-session
Expand All @@ -57,7 +55,7 @@ $ export PERCY_TOKEN=[your-project-token]
$ percy exec -- [test command]
[percy] Percy has started!
[percy] Created build #1: https://percy.io/[your-project]
[percy] Snapshot taken "Ruby example"
[percy] Snapshot taken "Capybara example"
[percy] Stopping percy...
[percy] Finalized build #1: https://percy.io/[your-project]
[percy] Done!
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/percy/percy_capybara_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
page.__percy_clear_cache!
end

describe 'snapshot', type: :feature, js: true do
describe 'snapshot', type: :feature do
it 'disables when healthcheck version is incorrect' do
stub_request(:get, "#{PercyCapybara::PERCY_SERVER_ADDRESS}/percy/healthcheck")
.to_return(status: 200, body: '', headers: {'x-percy-core-version': '0.1.0'})
Expand Down

0 comments on commit 3ce99ef

Please sign in to comment.