capybara-headless_chrome 0.3.0 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef4f12c23030bdb00d8c24f495d8ebe76689b2ff
|
4
|
+
data.tar.gz: fc54211a643936f225f6a7a50c16bf37d99b0074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af7ac8e05e5a984067441fd4ff969a3ac2fd38ae2c305e63a6bfe44be3fae681b88191d099f8591d9214f61e14f1f7d7a91d073f8836732fe6c784743214a075
|
7
|
+
data.tar.gz: 41691d7b8f3d1f006c03a7de7bebb3b9a61f3ff3c21e3797e275f4b40f537f8aa4a982b579f9400a7e5d4097e0f3a67400929172c588c7106307afe22c8db741
|
@@ -2,3 +2,16 @@ Before do
|
|
2
2
|
page.downloads.reset
|
3
3
|
end
|
4
4
|
|
5
|
+
AfterStep do
|
6
|
+
aggregate_failures 'javascript errors' do
|
7
|
+
page.javascript_errors.each do |error|
|
8
|
+
fail error
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
page.javascript_warnings.each do |warning|
|
13
|
+
STDERR.puts 'WARN: javascript warning'
|
14
|
+
STDERR.puts warning
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -16,8 +16,24 @@ module Capybara
|
|
16
16
|
@downloads ||= Downloads.new
|
17
17
|
end
|
18
18
|
|
19
|
+
def javascript_errors
|
20
|
+
console_entries level: "SEVERE"
|
21
|
+
end
|
22
|
+
|
23
|
+
def javascript_warnings
|
24
|
+
console_entries level: "WARNING"
|
25
|
+
end
|
26
|
+
|
19
27
|
private
|
20
28
|
|
29
|
+
def console_entries level: nil
|
30
|
+
browser.manage.logs.get(:browser)
|
31
|
+
.select {|e| level ? e.level == level : true }
|
32
|
+
.map(&:message)
|
33
|
+
.select(&:present?)
|
34
|
+
.to_a
|
35
|
+
end
|
36
|
+
|
21
37
|
def chrome_capabilities args
|
22
38
|
::Selenium::WebDriver::Remote::Capabilities.chrome(
|
23
39
|
chromeOptions: {
|
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.
|
4
|
+
version: 0.4.0
|
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-08-
|
11
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chromedriver-helper
|