capybara-headless_chrome 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 072a6982915af40cdbd5b6c8141dd6cbb78e81c2
4
- data.tar.gz: c9f75a5a769c27861f5f93775c6a11f3be0d1894
3
+ metadata.gz: cd53f1c095c3362f804d27203aa7faa711ed97c7
4
+ data.tar.gz: 5fcbed1d9a9641012b42b52dd635957776eadb3b
5
5
  SHA512:
6
- metadata.gz: b3e174527bdf32088f5980f02aa8354dc3890b310575385ceea692bae5db45ab663605c719a5fa8469846d4cbb6ed0b5e6e58a0143ad22c882cfe7fa4f7b8521
7
- data.tar.gz: e6b9b81bbdadec609b7b4bdb79ffd9c1b98b1538794c4d11b11d4d22b57995b1781a89f8f02bb350f0457ad2f1917a01e3424c48d0c3dbe5b0a5f1c22f4b8666
6
+ metadata.gz: a4ac77dc3856fb148b72f2ae27fad53b217206a56c862157b21b886536a2f27ad62a93558cfa44e1e3823ff23c3e4edc56a2188dd12a75e3b98375e5b46c4a26
7
+ data.tar.gz: 1e19146d46e3b3df92ed6c812ed17e586679f49d5456b72f61d4b8c0996138723867c3128645ebcb515b8f78d683328dccd38b0c3b1f846795d1888947903986
@@ -9,6 +9,7 @@ module Capybara
9
9
  def initialize app
10
10
  super(app, browser: :chrome, desired_capabilities: chrome_capabilities)
11
11
  configure_downloads
12
+ fix_whitespace
12
13
  end
13
14
 
14
15
  def downloads
@@ -60,6 +61,19 @@ module Capybara
60
61
  }
61
62
  )
62
63
  end
64
+
65
+ def fix_whitespace
66
+ Capybara::Selenium::Node.prepend Module.new {
67
+ def visible_text
68
+ super
69
+ .gsub(/[\u200b\u200e\u200f]/, '')
70
+ .gsub(/[\ \n\f\t\v\u2028\u2029]+/, ' ')
71
+ .gsub(/\A[[:space:]&&[^\u00a0]]+/, '')
72
+ .gsub(/[[:space:]&&[^\u00a0]]+\z/, '')
73
+ .tr("\u00a0", ' ')
74
+ end
75
+ }
76
+ end
63
77
  end
64
78
  end
65
79
  end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module HeadlessChrome
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-headless_chrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chromedriver-helper