ndr_dev_support 5.3.1 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/code_safety.yml +9 -9
- data/lib/ndr_dev_support/integration_testing/drivers/chrome.rb +3 -0
- data/lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb +10 -1
- data/lib/ndr_dev_support/integration_testing/drivers/firefox.rb +3 -0
- data/lib/ndr_dev_support/integration_testing/drivers/poltergeist.rb +3 -0
- data/lib/ndr_dev_support/integration_testing/drivers/switchable.rb +27 -16
- data/lib/ndr_dev_support/integration_testing/dsl.rb +10 -5
- data/lib/ndr_dev_support/version.rb +1 -1
- data/ndr_dev_support.gemspec +2 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0e0d87efe5b091c6083e781b712ebb2d20613d292f6593264b45cd7faa4d990
|
4
|
+
data.tar.gz: 77405caeed1891584a713451456df807bb3bcee98fae5c144f09d202ec2e4db5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2537e824771e6abbac152b2f2c1006613c9ec52582d65b0665040d9f81ddfe0a5407d7ac191b5e9ce2b5de7bde3b3362206d8cd4abd2deeac40c09e8175804a3
|
7
|
+
data.tar.gz: 24d97bdfa01f28f8da310c28282cabf2dcb5172b2a0ad39b9f8230467a05660929b4723d7780163ace34e5f25388126a864ebcdba183bf5c9d7003e4f2baee48
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
*no unreleased changes*
|
3
3
|
|
4
|
+
## 5.4.0 / 2019-05-30
|
5
|
+
### Added
|
6
|
+
* Introduce `show_me_the_cookies` into the integration testing DSL
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
* Use command line args to prevent headless Chrome hanging
|
10
|
+
|
4
11
|
## 5.3.1 / 2019-05-20
|
5
12
|
### Fixed
|
6
13
|
* Use `webdrivers` gem for Selenium WebDriver managements.
|
data/code_safety.yml
CHANGED
@@ -19,7 +19,7 @@ file safety:
|
|
19
19
|
CHANGELOG.md:
|
20
20
|
comments:
|
21
21
|
reviewed_by: josh.pencheon
|
22
|
-
safe_revision:
|
22
|
+
safe_revision: ca4471b6dbd4f8ef72574738f66f7f523721218c
|
23
23
|
CODE_OF_CONDUCT.md:
|
24
24
|
comments:
|
25
25
|
reviewed_by: timgentry
|
@@ -115,27 +115,27 @@ file safety:
|
|
115
115
|
lib/ndr_dev_support/integration_testing/drivers/chrome.rb:
|
116
116
|
comments:
|
117
117
|
reviewed_by: josh.pencheon
|
118
|
-
safe_revision:
|
118
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
119
119
|
lib/ndr_dev_support/integration_testing/drivers/chrome_headless.rb:
|
120
120
|
comments:
|
121
121
|
reviewed_by: josh.pencheon
|
122
|
-
safe_revision:
|
122
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
123
123
|
lib/ndr_dev_support/integration_testing/drivers/firefox.rb:
|
124
124
|
comments:
|
125
125
|
reviewed_by: josh.pencheon
|
126
|
-
safe_revision:
|
126
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
127
127
|
lib/ndr_dev_support/integration_testing/drivers/poltergeist.rb:
|
128
128
|
comments:
|
129
129
|
reviewed_by: josh.pencheon
|
130
|
-
safe_revision:
|
130
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
131
131
|
lib/ndr_dev_support/integration_testing/drivers/switchable.rb:
|
132
132
|
comments:
|
133
133
|
reviewed_by: josh.pencheon
|
134
|
-
safe_revision:
|
134
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
135
135
|
lib/ndr_dev_support/integration_testing/dsl.rb:
|
136
136
|
comments:
|
137
137
|
reviewed_by: josh.pencheon
|
138
|
-
safe_revision:
|
138
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
139
139
|
lib/ndr_dev_support/rake_ci/brakeman_helper.rb:
|
140
140
|
comments:
|
141
141
|
reviewed_by: josh.pencheon
|
@@ -203,7 +203,7 @@ file safety:
|
|
203
203
|
lib/ndr_dev_support/version.rb:
|
204
204
|
comments:
|
205
205
|
reviewed_by: josh.pencheon
|
206
|
-
safe_revision:
|
206
|
+
safe_revision: ca4471b6dbd4f8ef72574738f66f7f523721218c
|
207
207
|
lib/tasks/audit_code.rake:
|
208
208
|
comments: Identical to the version reviewed by josh.pencheon when contained within
|
209
209
|
ndr_support
|
@@ -276,7 +276,7 @@ file safety:
|
|
276
276
|
ndr_dev_support.gemspec:
|
277
277
|
comments:
|
278
278
|
reviewed_by: josh.pencheon
|
279
|
-
safe_revision:
|
279
|
+
safe_revision: f1a32b1f2d1851b87a883dbf8620aa0e921e436c
|
280
280
|
test/daemon/ci_server_test.rb:
|
281
281
|
comments:
|
282
282
|
reviewed_by: josh.pencheon
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'selenium-webdriver'
|
2
|
+
require 'show_me_the_cookies'
|
2
3
|
|
3
4
|
Capybara.register_driver(:chrome) do |app|
|
4
5
|
Capybara::Selenium::Driver.new app, browser: :chrome
|
@@ -7,3 +8,5 @@ end
|
|
7
8
|
Capybara::Screenshot.register_driver(:chrome) do |driver, path|
|
8
9
|
driver.browser.save_screenshot(path)
|
9
10
|
end
|
11
|
+
|
12
|
+
ShowMeTheCookies.register_adapter(:chrome, ShowMeTheCookies::SeleniumChrome)
|
@@ -1,8 +1,15 @@
|
|
1
1
|
require 'selenium-webdriver'
|
2
|
+
require 'show_me_the_cookies'
|
2
3
|
|
3
4
|
Capybara.register_driver(:chrome_headless) do |app|
|
4
5
|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
5
|
-
|
6
|
+
chromeOptions: {
|
7
|
+
args: %w[
|
8
|
+
headless disable-gpu no-sandbox
|
9
|
+
--window-size=1920,1080
|
10
|
+
--enable-features=NetworkService,NetworkServiceInProcess
|
11
|
+
]
|
12
|
+
}
|
6
13
|
)
|
7
14
|
|
8
15
|
Capybara::Selenium::Driver.new(
|
@@ -15,3 +22,5 @@ end
|
|
15
22
|
Capybara::Screenshot.register_driver(:chrome_headless) do |driver, path|
|
16
23
|
driver.browser.save_screenshot(path)
|
17
24
|
end
|
25
|
+
|
26
|
+
ShowMeTheCookies.register_adapter(:chrome_headless, ShowMeTheCookies::SeleniumChrome)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'selenium-webdriver'
|
2
|
+
require 'show_me_the_cookies'
|
2
3
|
|
3
4
|
Capybara.register_driver(:firefox) do |app|
|
4
5
|
Capybara::Selenium::Driver.new app, browser: :firefox
|
@@ -7,3 +8,5 @@ end
|
|
7
8
|
Capybara::Screenshot.register_driver(:firefox) do |driver, path|
|
8
9
|
driver.browser.save_screenshot(path)
|
9
10
|
end
|
11
|
+
|
12
|
+
ShowMeTheCookies.register_adapter(:firefox, ShowMeTheCookies::Selenium)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# The driver for PhantomJS is poltergeist:
|
2
2
|
require 'capybara/poltergeist'
|
3
|
+
require 'show_me_the_cookies'
|
3
4
|
|
4
5
|
Capybara.register_driver(:poltergeist) do |app|
|
5
6
|
options = { phantomjs_options: ['--proxy-type=none'], timeout: 60 }
|
@@ -13,3 +14,5 @@ Capybara::Screenshot.register_driver(:poltergeist) do |driver, path|
|
|
13
14
|
# Take full-height screenshots, rather than just capturing the viewport:
|
14
15
|
driver.render(path, full: true)
|
15
16
|
end
|
17
|
+
|
18
|
+
ShowMeTheCookies.register_adapter(:poltergeist, ShowMeTheCookies::Poltergeist)
|
@@ -1,21 +1,32 @@
|
|
1
|
-
|
2
|
-
# environment variable (e.g. for a CI matrix), assuming that driver has been pre-registered
|
3
|
-
# with Capybara.
|
1
|
+
require 'show_me_the_cookies'
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
Capybara.register_driver(:switchable) do |app|
|
12
|
-
choice = ENV.fetch('INTEGRATION_DRIVER', 'poltergeist').to_sym
|
3
|
+
module NdrDevSupport
|
4
|
+
module IntegrationTesting
|
5
|
+
module Drivers
|
6
|
+
# A meta-driver that allows the driver to be set using the `INTEGRATION_DRIVER`
|
7
|
+
# environment variable (e.g. for a CI matrix), assuming that driver has been pre-registered
|
8
|
+
# with Capybara.
|
13
9
|
|
14
|
-
|
15
|
-
|
10
|
+
# Although the aim is to move to Chrome headless, we keep poltergeist as the default
|
11
|
+
# driver for now. For motivation behind not changing immediately, see the "Differences
|
12
|
+
# between Poltergeist and Selenium" section of:
|
13
|
+
#
|
14
|
+
# https://about.gitlab.com/2017/12/19/moving-to-headless-chrome/
|
15
|
+
#
|
16
|
+
module Switchable
|
17
|
+
DEFAULT = :poltergeist
|
18
|
+
CONFIGURED = ENV.fetch('INTEGRATION_DRIVER', DEFAULT).to_sym
|
19
|
+
|
20
|
+
Capybara.register_driver(:switchable) do |app|
|
21
|
+
Capybara.drivers.fetch(CONFIGURED).call(app)
|
22
|
+
end
|
16
23
|
|
17
|
-
Capybara::Screenshot.register_driver(:switchable) do |driver, path|
|
18
|
-
|
24
|
+
Capybara::Screenshot.register_driver(:switchable) do |driver, path|
|
25
|
+
Capybara::Screenshot.registered_drivers.fetch(CONFIGURED).call(driver, path)
|
26
|
+
end
|
19
27
|
|
20
|
-
|
28
|
+
ShowMeTheCookies.register_adapter(:switchable, ShowMeTheCookies.adapters.fetch(CONFIGURED))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
21
32
|
end
|
@@ -1,20 +1,25 @@
|
|
1
1
|
require 'capybara/rails'
|
2
|
+
require 'show_me_the_cookies'
|
2
3
|
|
3
4
|
module NdrDevSupport
|
4
5
|
module IntegrationTesting
|
5
6
|
# Additional integration testing DSL:
|
6
7
|
module DSL
|
7
|
-
|
8
|
+
include ShowMeTheCookies
|
9
|
+
|
10
|
+
# Instruct the browser to clear its session:
|
8
11
|
def clear_headless_session!
|
9
12
|
page.driver.reset!
|
10
13
|
end
|
11
14
|
|
12
|
-
# Get the
|
15
|
+
# Get the browser to delete all of the cookies
|
13
16
|
# for the current page without resetting:
|
14
17
|
def delete_all_cookies!
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
ActiveSupport::Deprecation.warn(<<~MSG)
|
19
|
+
`delete_all_cookies!` is deprecated in favour of `expire_cookies`
|
20
|
+
MSG
|
21
|
+
|
22
|
+
expire_cookies
|
18
23
|
end
|
19
24
|
|
20
25
|
# Wrap up interacting with modals. The assumption is that the modal
|
data/ndr_dev_support.gemspec
CHANGED
@@ -33,10 +33,11 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_dependency 'unicode-display_width', '>= 1.3.3'
|
34
34
|
|
35
35
|
# Integration test dependencies:
|
36
|
-
spec.add_dependency 'capybara'
|
36
|
+
spec.add_dependency 'capybara', '>= 3.20'
|
37
37
|
spec.add_dependency 'capybara-screenshot'
|
38
38
|
spec.add_dependency 'poltergeist', '>= 1.8.0'
|
39
39
|
spec.add_dependency 'selenium-webdriver'
|
40
|
+
spec.add_dependency 'show_me_the_cookies'
|
40
41
|
spec.add_dependency 'webdrivers', '>= 3.9'
|
41
42
|
|
42
43
|
# CI server dependencies:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndr_dev_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NCRS Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '3.20'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '3.20'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: capybara-screenshot
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: show_me_the_cookies
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: webdrivers
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|