standout-capybara 2.0.2 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gempush.yml +17 -16
- data/Gemfile.lock +17 -17
- data/README.md +3 -1
- data/lib/standout/capybara.rb +21 -8
- data/lib/standout/capybara/drivers/remote_chrome.rb +25 -0
- data/lib/standout/capybara/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2dd6fa4216d87f0ec1e70a7c785e8dafa58949a2b968349e1cde5d7c0e04a3b
|
4
|
+
data.tar.gz: 6b23b05e1c5f486c9a4babe53ec6d57f79d29b2cdcae166b51b9ef4c8a82cfa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83cfcef73a0ec078e4e5f6e2592f9ef6eb282e89a192b78d1cece31b7850393d792a613af563970c706c40ad842552091a6750c15f874711ca00b610de939a01
|
7
|
+
data.tar.gz: d0d6201bf7bc41f08f3e59499f2a907a5962738e6b2bb3ce7360a29d4712956de96a2f4fca35f2496545dcfd6f4897bfa4008c3cf44b6b692fae12fd42df461c
|
@@ -1,31 +1,32 @@
|
|
1
|
-
name:
|
1
|
+
name: Gem push
|
2
2
|
on:
|
3
3
|
release:
|
4
4
|
types: [published]
|
5
5
|
jobs:
|
6
|
-
|
7
|
-
name: Build + Publish
|
6
|
+
github:
|
7
|
+
name: Build + Publish to GitHub
|
8
8
|
runs-on: ubuntu-latest
|
9
|
-
|
10
9
|
steps:
|
11
10
|
- uses: actions/checkout@v2
|
12
11
|
- name: Set up Ruby 2.6
|
13
12
|
uses: actions/setup-ruby@v1
|
14
13
|
with:
|
15
14
|
version: 2.6.x
|
15
|
+
- name: Publish to GitHub
|
16
|
+
uses: jstastny/publish-gem-to-github@master
|
17
|
+
with:
|
18
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
19
|
+
owner: standout
|
16
20
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
|
27
|
-
OWNER: standout
|
28
|
-
|
21
|
+
rubygems:
|
22
|
+
name: Build + Publish to Rubygems
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby 2.6
|
27
|
+
uses: actions/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
version: 2.6.x
|
29
30
|
- name: Publish to RubyGems
|
30
31
|
run: |
|
31
32
|
mkdir -p $HOME/.gem
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
standout-capybara (
|
4
|
+
standout-capybara (2.1.0)
|
5
5
|
capybara
|
6
6
|
capybara-screenshot
|
7
7
|
selenium-webdriver
|
@@ -20,36 +20,36 @@ GEM
|
|
20
20
|
rack-test (>= 0.6.3)
|
21
21
|
regexp_parser (~> 1.5)
|
22
22
|
xpath (~> 3.2)
|
23
|
-
capybara-screenshot (1.0.
|
23
|
+
capybara-screenshot (1.0.25)
|
24
24
|
capybara (>= 1.0, < 4)
|
25
25
|
launchy
|
26
26
|
childprocess (3.0.0)
|
27
|
-
diff-lcs (1.
|
27
|
+
diff-lcs (1.4.4)
|
28
28
|
launchy (2.5.0)
|
29
29
|
addressable (~> 2.7)
|
30
30
|
mini_mime (1.0.2)
|
31
31
|
mini_portile2 (2.4.0)
|
32
32
|
nokogiri (1.10.10)
|
33
33
|
mini_portile2 (~> 2.4.0)
|
34
|
-
public_suffix (4.0.
|
34
|
+
public_suffix (4.0.6)
|
35
35
|
rack (2.2.3)
|
36
36
|
rack-test (1.1.0)
|
37
37
|
rack (>= 1.0, < 3)
|
38
38
|
rake (13.0.1)
|
39
|
-
regexp_parser (1.
|
40
|
-
rspec (3.
|
41
|
-
rspec-core (~> 3.
|
42
|
-
rspec-expectations (~> 3.
|
43
|
-
rspec-mocks (~> 3.
|
44
|
-
rspec-core (3.
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-expectations (3.
|
39
|
+
regexp_parser (1.8.2)
|
40
|
+
rspec (3.10.0)
|
41
|
+
rspec-core (~> 3.10.0)
|
42
|
+
rspec-expectations (~> 3.10.0)
|
43
|
+
rspec-mocks (~> 3.10.0)
|
44
|
+
rspec-core (3.10.0)
|
45
|
+
rspec-support (~> 3.10.0)
|
46
|
+
rspec-expectations (3.10.0)
|
47
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-mocks (3.
|
48
|
+
rspec-support (~> 3.10.0)
|
49
|
+
rspec-mocks (3.10.0)
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-support (3.
|
51
|
+
rspec-support (~> 3.10.0)
|
52
|
+
rspec-support (3.10.0)
|
53
53
|
rubyzip (2.3.0)
|
54
54
|
selenium-webdriver (3.142.7)
|
55
55
|
childprocess (>= 0.5, < 4.0)
|
@@ -70,4 +70,4 @@ DEPENDENCIES
|
|
70
70
|
standout-capybara!
|
71
71
|
|
72
72
|
BUNDLED WITH
|
73
|
-
1.
|
73
|
+
2.1.4
|
data/README.md
CHANGED
@@ -81,7 +81,9 @@ CAPYBARA=[driver name] test-command
|
|
81
81
|
|:-----------------|:------------|
|
82
82
|
| chrome | Regular chrome driver that will use a visual browser window. |
|
83
83
|
| headless_chrome | Headless chrome driver. The default driver. |
|
84
|
-
| nanobox_chrome
|
84
|
+
| nanobox_chrome | Default driver when inside Nanobox. |
|
85
|
+
| remote_chrome | Default driver when `ENV['HUB_URL']` is defined. |
|
86
|
+
|
85
87
|
## Development
|
86
88
|
|
87
89
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
data/lib/standout/capybara.rb
CHANGED
@@ -9,23 +9,23 @@ require 'standout/capybara/drivers/base'
|
|
9
9
|
require 'standout/capybara/drivers/chrome'
|
10
10
|
require 'standout/capybara/drivers/nanobox_chrome'
|
11
11
|
require 'standout/capybara/drivers/headless_chrome'
|
12
|
+
require 'standout/capybara/drivers/remote_chrome'
|
12
13
|
|
13
14
|
module Standout
|
14
15
|
module Capybara
|
15
|
-
|
16
|
-
driver_name = ENV['CAPYBARA']
|
17
|
-
is_using_nanobox = `whoami`.chomp == 'gonano'
|
18
|
-
fallback_driver = is_using_nanobox ? :nanobox_chrome : :headless_chrome
|
19
|
-
driver_name ||= fallback_driver
|
20
|
-
driver_name = driver_name.to_sym
|
16
|
+
class Error < StandardError; end
|
21
17
|
|
22
|
-
|
18
|
+
def self.setup_driver
|
19
|
+
case (ENV['CAPYBARA'] || fallback_driver).to_sym
|
23
20
|
when :chrome
|
24
21
|
Standout::Capybara::Drivers::Chrome.register
|
25
22
|
Standout::Capybara::Drivers::Chrome.use!
|
26
23
|
when :nanobox_chrome
|
27
24
|
Standout::Capybara::Drivers::NanoboxChrome.register
|
28
25
|
Standout::Capybara::Drivers::NanoboxChrome.use!
|
26
|
+
when :remote_chrome
|
27
|
+
Standout::Capybara::Drivers::RemoteChrome.register
|
28
|
+
Standout::Capybara::Drivers::RemoteChrome.use!
|
29
29
|
else
|
30
30
|
Standout::Capybara::Drivers::HeadlessChrome.register
|
31
31
|
Standout::Capybara::Drivers::HeadlessChrome.use!
|
@@ -38,6 +38,19 @@ module Standout
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
|
41
|
+
def self.fallback_driver
|
42
|
+
return :nanobox_chrome if nanobox?
|
43
|
+
return :remote_chrome if hub_url?
|
44
|
+
|
45
|
+
:headless_chrome
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.nanobox?
|
49
|
+
`whoami`.chomp == 'gonano'
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.hub_url?
|
53
|
+
!ENV['HUB_URL'].nil?
|
54
|
+
end
|
42
55
|
end
|
43
56
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Standout
|
4
|
+
module Capybara
|
5
|
+
module Drivers
|
6
|
+
class RemoteChrome < Standout::Capybara::Drivers::Base
|
7
|
+
self.driver_name = :remote_chrome
|
8
|
+
|
9
|
+
def self.register
|
10
|
+
::Capybara.register_driver driver_name do |driver|
|
11
|
+
chrome_capabilities = ::Selenium::WebDriver::Remote::Capabilities
|
12
|
+
.chrome('goog:chromeOptions' => {
|
13
|
+
args: %w[no-sandbox headless disable-gpu window-size=1400,1400] })
|
14
|
+
|
15
|
+
::Capybara::Selenium::Driver.new(driver,
|
16
|
+
browser: :remote,
|
17
|
+
url: ENV['HUB_URL'],
|
18
|
+
desired_capabilities: chrome_capabilities)
|
19
|
+
end
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standout-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Standout AB
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/standout/capybara/drivers/chrome.rb
|
119
119
|
- lib/standout/capybara/drivers/headless_chrome.rb
|
120
120
|
- lib/standout/capybara/drivers/nanobox_chrome.rb
|
121
|
+
- lib/standout/capybara/drivers/remote_chrome.rb
|
121
122
|
- lib/standout/capybara/setup.rb
|
122
123
|
- lib/standout/capybara/version.rb
|
123
124
|
- standout-capybara.gemspec
|
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
141
|
- !ruby/object:Gem::Version
|
141
142
|
version: '0'
|
142
143
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
144
|
+
rubygems_version: 3.1.4
|
144
145
|
signing_key:
|
145
146
|
specification_version: 4
|
146
147
|
summary: Sane defaults for capybara
|