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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b6ce352841199c3218ea9b9ea07c24e54e8c25b72ef01c0f08614a49e7761e3
4
- data.tar.gz: 5a81ff21fc5fbc5fc937076591ec622cb7d2c78b7ea2a636b40f84c41ef514af
3
+ metadata.gz: b4a084da1c3ac06585dea3d4451e01b816fccf701daff22df2b61c36ec414163
4
+ data.tar.gz: c5c3f0dc1de999c6a55fad8a969b2702ff669fb94c9b33f0c4f260e750a5c001
5
5
  SHA512:
6
- metadata.gz: cec655cd4c177f542aa34121fd8bc3ec756c7c75752fdda1ae7c1068ae4bafa0ef8c38fcb623e476db66eff9d6ae2aac644d048f1d1e5a6d2929ca5f491deeeb
7
- data.tar.gz: 75b0259ac206c9dd9a0f407344f15850319bd476d96faca3322c7523c6fc5d65fec33fc004d431dfa16a9adf27d4c18890483aea9fc005c0c5e02d580b7259e7
6
+ metadata.gz: 0b76eb4692f1cfcaad5f7a1db172f2f56a6cce9b4327bda1ab8ea0235bb18e5bd781fdc75abe80a41f7b862628c696a5d7f6465657b82e0195be833d2400b1be
7
+ data.tar.gz: aa4df315c8b32dfb6a589386651f456963223c5f183f9f97cdbdc95b9556076fdd6470bae76a895fc909d474f99777cf214e98551061f79ab38601de438ab309
data/README.md CHANGED
@@ -1,38 +1,52 @@
1
- # capybara-puppeteer-driver
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
- TODO: Delete this and the text above, and describe your gem
4
+ # `puppeteer-ruby`-based driver for Capybara
6
5
 
7
- ## Installation
6
+ Alternative headless-Chrome driver for Capybara, using [puppeteer-ruby](https://github.com/YusukeIwaki/puppeteer-ruby)
8
7
 
9
- Add this line to your application's Gemfile:
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
- And then execute:
14
+ ## Example
16
15
 
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install capybara-puppeteer-driver
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/capybara-puppeteer-driver. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
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.34.3'
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'
@@ -6,6 +6,7 @@ module Capybara
6
6
  end
7
7
 
8
8
  LAUNCH_PARAMS = {
9
+ channel: nil,
9
10
  executable_path: nil,
10
11
  headless: nil,
11
12
  }.keys
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capybara
4
4
  module Puppeteer
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
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.0
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-06-30 00:00:00.000000000 Z
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.34.3
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.34.3
40
+ version: 0.35.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement