capybara-chrome 0.1.22 → 0.1.23

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: 8541435afe87267dc82259cc09f0c1ca7484588a
4
- data.tar.gz: b80fe620c9549091dab72dfe7e62a505dbbbe83b
3
+ metadata.gz: ce723ad2c2527db322a9a686e4ad825cf0014f63
4
+ data.tar.gz: 488a93a848ecee15501114a57b509fea228624ed
5
5
  SHA512:
6
- metadata.gz: c90f45a45e4f3f96ce46c48956b73afd65c01bb39b4b3830c9905fb3b101f4ccbe31f5806b581b74cc6d533ad9495b8f655a9af1270fa45e867a1c200dd118c1
7
- data.tar.gz: c678cd3da799220fb700e873562a8586ec850b86460049c92cbb65b28e2921fc2a5e0cc511cfb647614e8406f4f90a3f50b6c2c0b4094e4ac1abce1e25f189bf
6
+ metadata.gz: 21d9b56997dc444197aa0f582c8da4b6bf8863c8a37f0b4bb8c38616af6d35cded9f142ea6907fbb155a1fc33aba0c2e9dba26ffbfec7475ffb07085c41758b2
7
+ data.tar.gz: 869e7d15b90eaf13247bf3cabddf155cc31317156bfcae87b03445625b5b397602d0c3916e480e49d4db9bf04db12c0efa40e7ac618f28b30319cee6fd687553
data/README.md CHANGED
@@ -17,6 +17,21 @@ And then execute:
17
17
  Or install it yourself as:
18
18
 
19
19
  $ gem install capybara-chrome
20
+
21
+ ### Using Docker
22
+
23
+ Add this line to your Dockerfile to install Chrome:
24
+
25
+ ```dockerfile
26
+ RUN curl -sL -o chrome-stable.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb ; dpkg -i chrome-stable.deb ; apt-get install -fy; rm -rf /var/lib/apt/lists/*
27
+ ```
28
+
29
+ In my experience, headless Chrome cannot be run as root, so you need to run `rspec` as an unprivileged user and use this flag with `docker run`
30
+
31
+ ```bash
32
+ docker run --security-opt seccomp=unconfined
33
+ ```
34
+
20
35
 
21
36
  ## Usage
22
37
 
@@ -28,4 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "bundler", "~> 1.16"
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
+ spec.add_development_dependency "puma"
31
32
  end
@@ -1,6 +1,7 @@
1
1
  require "capybara/chrome/version"
2
2
  require "capybara"
3
3
  require "websocket/driver"
4
+ require "json"
4
5
 
5
6
  module Capybara
6
7
  module Chrome
@@ -305,6 +305,7 @@ module Capybara::Chrome
305
305
  @js_dialog_handlers[params["type"]].delete(params["type"].size - 1)
306
306
  else
307
307
  puts "WARNING: Accepting unhandled modal. Use #accept_modal or #dismiss_modal to handle this modal properly."
308
+ puts "Details: #{params.inspect}"
308
309
  remote.send_cmd("Page.handleJavaScriptDialog", accept: true)
309
310
  end
310
311
  end
@@ -118,7 +118,7 @@ module Capybara::Chrome
118
118
  strategy = rand(0..xd.size-1)
119
119
  cx = (dim["x"] + xd[strategy]).floor
120
120
  cy = (dim["y"] + yd[strategy]).floor
121
- move_mouse(cx, cy, steps: 0)
121
+ move_mouse(cx, cy, steps: [cx, cy].max)
122
122
  expect_node_at_position(cx, cy)
123
123
  send_cmd! "Input.dispatchMouseEvent", type: "mousePressed", x: cx, y: cy, clickCount: 1, button: "left"
124
124
  send_cmd! "Input.dispatchMouseEvent", type: "mouseReleased", x: cx, y: cy, clickCount: 1, button: "left"
@@ -104,6 +104,7 @@ module Capybara::Chrome
104
104
  ensure
105
105
  server.close if server
106
106
  end
107
+ module_function :find_available_port
107
108
 
108
109
  end
109
110
  end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Chrome
3
- VERSION = "0.1.22"
3
+ VERSION = "0.1.23"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-chrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Turriate
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-08 00:00:00.000000000 Z
11
+ date: 2018-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: puma
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Chrome driver for capybara using remote debugging protocol.
98
112
  email:
99
113
  - sandro.turriate@gmail.com