capybara-puppeteer-driver 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -25
- data/capybara-puppeteer-driver.gemspec +1 -1
- data/lib/capybara/puppeteer/browser_options.rb +1 -0
- data/lib/capybara/puppeteer/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4a084da1c3ac06585dea3d4451e01b816fccf701daff22df2b61c36ec414163
|
4
|
+
data.tar.gz: c5c3f0dc1de999c6a55fad8a969b2702ff669fb94c9b33f0c4f260e750a5c001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b76eb4692f1cfcaad5f7a1db172f2f56a6cce9b4327bda1ab8ea0235bb18e5bd781fdc75abe80a41f7b862628c696a5d7f6465657b82e0195be833d2400b1be
|
7
|
+
data.tar.gz: aa4df315c8b32dfb6a589386651f456963223c5f183f9f97cdbdc95b9556076fdd6470bae76a895fc909d474f99777cf214e98551061f79ab38601de438ab309
|
data/README.md
CHANGED
@@ -1,38 +1,52 @@
|
|
1
|
-
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/capybara-puppeteer-driver.svg)](https://badge.fury.io/rb/capybara-puppeteer-driver)
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capybara/puppeteer`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
3
|
|
5
|
-
|
4
|
+
# `puppeteer-ruby`-based driver for Capybara
|
6
5
|
|
7
|
-
|
6
|
+
Alternative headless-Chrome driver for Capybara, using [puppeteer-ruby](https://github.com/YusukeIwaki/puppeteer-ruby)
|
8
7
|
|
9
|
-
|
8
|
+
![image](https://github.com/YusukeIwaki/puppeteer-ruby/blob/main/puppeteer-ruby.png?raw=true)
|
10
9
|
|
11
10
|
```ruby
|
12
11
|
gem 'capybara-puppeteer-driver'
|
13
12
|
```
|
14
13
|
|
15
|
-
|
14
|
+
## Example
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
16
|
+
```ruby
|
17
|
+
require 'capybara/puppeteer'
|
18
|
+
|
19
|
+
# Setup
|
20
|
+
Capybara.register_driver(:puppeteer) do |app|
|
21
|
+
Capybara::Puppeteer::Driver.new(app,
|
22
|
+
# Specify browser type.
|
23
|
+
# Either of 'chrome', 'chrome-beta', 'chrome-canary', 'chrome-dev', 'msedge'.
|
24
|
+
# chrome is used by default.
|
25
|
+
channel: 'msedge',
|
26
|
+
# Or specify the executable path of Google Chrome.
|
27
|
+
# Useful option for Docker integration.
|
28
|
+
# When channel is specified, executable_path is ignored.
|
29
|
+
executable_path: '/usr/bin/google-chrome',
|
30
|
+
|
31
|
+
# `headless: false` -> headful mode.
|
32
|
+
# `headless: true` -> headless mode. (default)
|
33
|
+
headless: false,
|
34
|
+
)
|
35
|
+
end
|
36
|
+
Capybara.default_max_wait_time = 15
|
37
|
+
Capybara.default_driver = :puppeteer
|
38
|
+
Capybara.save_path = 'tmp/capybara'
|
39
|
+
|
40
|
+
# Run
|
41
|
+
Capybara.app_host = 'https://github.com'
|
42
|
+
visit '/'
|
43
|
+
fill_in('q', with: 'Capybara')
|
44
|
+
find('a[data-item-type="global_search"]').click
|
45
|
+
|
46
|
+
all('.repo-list-item').each do |li|
|
47
|
+
puts li.all('a').first.text
|
48
|
+
end
|
49
|
+
```
|
36
50
|
|
37
51
|
## License
|
38
52
|
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
26
|
spec.add_dependency 'capybara'
|
27
|
-
spec.add_dependency 'puppeteer-ruby', '>= 0.
|
27
|
+
spec.add_dependency 'puppeteer-ruby', '>= 0.35.0'
|
28
28
|
spec.add_development_dependency 'bundler', '~> 2.2.3'
|
29
29
|
spec.add_development_dependency 'launchy', '>= 2.0.4'
|
30
30
|
spec.add_development_dependency 'pry-byebug'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-puppeteer-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.35.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.35.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|