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 +4 -4
- data/README.md +15 -0
- data/capybara-chrome.gemspec +1 -0
- data/lib/capybara/chrome.rb +1 -0
- data/lib/capybara/chrome/browser.rb +1 -0
- data/lib/capybara/chrome/node.rb +1 -1
- data/lib/capybara/chrome/service.rb +1 -0
- data/lib/capybara/chrome/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce723ad2c2527db322a9a686e4ad825cf0014f63
|
4
|
+
data.tar.gz: 488a93a848ecee15501114a57b509fea228624ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/capybara-chrome.gemspec
CHANGED
data/lib/capybara/chrome.rb
CHANGED
@@ -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
|
data/lib/capybara/chrome/node.rb
CHANGED
@@ -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:
|
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"
|
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.
|
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-
|
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
|