percy-capybara 5.0.0.pre.3 → 5.0.0.pre.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/lib/percy/capybara.rb +4 -4
- data/lib/percy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad47828506156e4e07dfc481315f03b6754e56754728dc781d7d112e4c436429
|
4
|
+
data.tar.gz: 6a44e3220c49e4feb480d91bcdd3a5f4f65564ad75231b9455b377f7a69f7b09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6b98bb4aabe555640e2ad075507e413edc94259396a6d7523531097e0678949a1190dc5e9d5bce963aa0499cfd76b88f07d8d4da359faa52b1c1a54008b0a64
|
7
|
+
data.tar.gz: e97a00541379a162dd5da3314b62a429f79d1bfeaade1b12f689cf8479152f82202c97f86a30a23e205541a33305969686dacbb994ba970690d36c8c09e7b742
|
data/README.md
CHANGED
@@ -78,6 +78,25 @@ The name of the require has changed from `require 'percy'` to `require
|
|
78
78
|
'percy/capybara'`. This is to avoid conflict with our [Ruby Selenium SDK's](https://github.com/percy/percy-selenium-ruby)
|
79
79
|
require statement.
|
80
80
|
|
81
|
+
#### API change
|
82
|
+
|
83
|
+
The previous version of this SDK had the following function signature:
|
84
|
+
|
85
|
+
``` ruby
|
86
|
+
Percy.snapshot(driver, name, options)
|
87
|
+
```
|
88
|
+
|
89
|
+
v5.x of this SDK has a significant change to the API. There no longer is a stand
|
90
|
+
alone module to call and you no longer need to pass the page/driver. It's
|
91
|
+
available on the current Capybara session (`page`):
|
92
|
+
|
93
|
+
``` ruby
|
94
|
+
page.percy_snapshot(name, options)
|
95
|
+
```
|
96
|
+
|
97
|
+
If you were using this SDK outside of Capybara, you'll likely find the [Ruby
|
98
|
+
Selenium SDK a better fit](https://github.com/percy/percy-selenium-ruby)
|
99
|
+
|
81
100
|
#### Installing `@percy/cli` & removing `@percy/agent`
|
82
101
|
|
83
102
|
If you're coming from a 4.x version of this package, make sure to install `@percy/cli` after
|
data/lib/percy/capybara.rb
CHANGED
@@ -4,8 +4,6 @@ require 'capybara/dsl'
|
|
4
4
|
require_relative './version'
|
5
5
|
|
6
6
|
module PercyCapybara
|
7
|
-
include Capybara::DSL
|
8
|
-
|
9
7
|
CLIENT_INFO = "percy-capybara/#{VERSION}".freeze
|
10
8
|
ENV_INFO = "capybara/#{Capybara::VERSION} ruby/#{RUBY_VERSION}".freeze
|
11
9
|
|
@@ -20,10 +18,12 @@ module PercyCapybara
|
|
20
18
|
def percy_snapshot(name, options = {})
|
21
19
|
return unless percy_enabled?
|
22
20
|
|
21
|
+
page = Capybara.current_session
|
22
|
+
|
23
23
|
begin
|
24
24
|
page.evaluate_script(fetch_percy_dom)
|
25
|
-
dom_snapshot =
|
26
|
-
|
25
|
+
dom_snapshot = page
|
26
|
+
.evaluate_script("(function() { return PercyDOM.serialize(#{options.to_json}) })()")
|
27
27
|
|
28
28
|
response = fetch('percy/snapshot',
|
29
29
|
name: name,
|
data/lib/percy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.pre.
|
4
|
+
version: 5.0.0.pre.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|