quke 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.config.example.yml +12 -0
- data/.rubocop.yml +22 -15
- data/CHANGELOG.md +8 -0
- data/lib/features/support/env.rb +30 -1
- data/lib/quke.rb +1 -0
- data/lib/quke/browserstack_configuration.rb +138 -0
- data/lib/quke/configuration.rb +6 -33
- data/lib/quke/driver_configuration.rb +1 -37
- data/lib/quke/driver_registration.rb +13 -7
- data/lib/quke/version.rb +1 -1
- data/quke.gemspec +7 -3
- metadata +35 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25034d29ab8437b5aacb33aaa97f41c34dc15068752eadfc09a85768e0dc2e60
|
4
|
+
data.tar.gz: 5cd03338c46d2bcae6797688d812ef2416442bf6326241a6fde6597b7a4c7a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c78cb8fe4e373e89806fd0b8d12329e1954a22861ccc59d02c01ad3646da7782c145445c62c076f862bdc324309b18e5ae2be49f0cc1338bc7231639242c37a9
|
7
|
+
data.tar.gz: 032b80527d91463412de0c97a6ae4b70ec050ee2dc6b71d2a1a6be2f316cc690f4f0b5fdb74e41e02fdb85c2a394f8bd388b61038ddd6635a3fa30abc807b013
|
data/.config.example.yml
CHANGED
@@ -103,6 +103,11 @@ browserstack:
|
|
103
103
|
username: jdoe
|
104
104
|
auth_key: 123456789ABCDE
|
105
105
|
|
106
|
+
# If you want to use local testing you must provide a key. You can find this
|
107
|
+
# in Browserstack once logged in under settings. Its typically the same value
|
108
|
+
# as the auth_key above
|
109
|
+
local_key: 123456789ABCDE
|
110
|
+
|
106
111
|
# Anything set under capabilities will be passed directly by Quke to
|
107
112
|
# browserstack as means of configuring the test.
|
108
113
|
# So the config keys (e.g. build, project, name) you set should match a real
|
@@ -131,6 +136,13 @@ browserstack:
|
|
131
136
|
# Required if you want to enable video recording during your test.
|
132
137
|
# Browserstack default is true
|
133
138
|
browserstack.video: true
|
139
|
+
# Required if you need to test a locally hosted (e.g. http://localhost:300)
|
140
|
+
# or private internal web site. Browserstack has a feature called local
|
141
|
+
# testing that Quke also supports, but to use
|
142
|
+
# - Browserstack must be your selected driver
|
143
|
+
# - You must have set local_key above
|
144
|
+
# - You must this value to true
|
145
|
+
browserstack.local: false
|
134
146
|
# Another setting not listed, setting the following will prevent any values
|
135
147
|
# you pass in, for example when filling in a form, from appearing in the
|
136
148
|
# logs. General use case is to prevent passwords being exposed, but beware
|
data/.rubocop.yml
CHANGED
@@ -21,21 +21,31 @@ AllCops:
|
|
21
21
|
# investigating what the fix may be.
|
22
22
|
DisplayStyleGuide: true
|
23
23
|
|
24
|
-
# Disable this rubocop style because we want to make the arguments passed into
|
25
|
-
# Freakin available to anywhere when the code is executed
|
26
|
-
Style/GlobalVars:
|
27
|
-
Enabled: false
|
28
|
-
|
29
24
|
# It is our opinion that code is easier to read if a white space is
|
30
25
|
# permitted between the initial declaration and the first statement. Ditto the
|
31
26
|
# last statement and the closing tag.
|
32
|
-
|
27
|
+
Layout/EmptyLinesAroundModuleBody:
|
33
28
|
Enabled: false
|
34
|
-
|
29
|
+
Layout/EmptyLinesAroundClassBody:
|
35
30
|
Enabled: false
|
36
|
-
|
31
|
+
Layout/EmptyLinesAroundBlockBody:
|
37
32
|
Enabled: false
|
38
33
|
|
34
|
+
# Rubocop appears to flag `describe` blocks which are longer than 25 lines.
|
35
|
+
# However it is our opinion that this is necessary in specs, for example when
|
36
|
+
# describing a class, the body of the describe may well exceed 25 lines.
|
37
|
+
# Therefore we have excluded this rule in the specs only.
|
38
|
+
Metrics/BlockLength:
|
39
|
+
Exclude:
|
40
|
+
- spec/quke/*.rb
|
41
|
+
|
42
|
+
# We wish we were good enough to remain within the rubocop limit of 10 lines
|
43
|
+
# however we often just seem to tip over by a few lines. Hence we have chosen
|
44
|
+
# to bump it to 15.
|
45
|
+
Metrics/MethodLength:
|
46
|
+
Max: 15
|
47
|
+
Exclude:
|
48
|
+
|
39
49
|
# It is our opinion that in the specs 80 characters is too restrictive. Do to
|
40
50
|
# the nature of some statements that it can be both difficult, and make more
|
41
51
|
# simple statements complex if we are forced to split them over multiple lines.
|
@@ -45,10 +55,7 @@ Metrics/LineLength:
|
|
45
55
|
Exclude:
|
46
56
|
- spec/quke/*.rb
|
47
57
|
|
48
|
-
#
|
49
|
-
#
|
50
|
-
|
51
|
-
|
52
|
-
Metrics/BlockLength:
|
53
|
-
Exclude:
|
54
|
-
- spec/quke/*.rb
|
58
|
+
# Disable this rubocop style because we want to make the arguments passed into
|
59
|
+
# Freakin available to anywhere when the code is executed
|
60
|
+
Style/GlobalVars:
|
61
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.4.0](https://github.com/DEFRA/quke/tree/v0.4.0) (2017-12-04)
|
4
|
+
[Full Changelog](https://github.com/DEFRA/quke/compare/v0.3.2...v0.4.0)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- More flexibility setting browserstack capabilities [\#67](https://github.com/DEFRA/quke/pull/67) ([Cruikshanks](https://github.com/Cruikshanks))
|
9
|
+
- \[ci skip\] Update CHANGELOG.md [\#66](https://github.com/DEFRA/quke/pull/66) ([Cruikshanks](https://github.com/Cruikshanks))
|
10
|
+
|
3
11
|
## [v0.3.2](https://github.com/DEFRA/quke/tree/v0.3.2) (2017-06-12)
|
4
12
|
[Full Changelog](https://github.com/DEFRA/quke/compare/v0.3.1...v0.3.2)
|
5
13
|
|
data/lib/features/support/env.rb
CHANGED
@@ -4,13 +4,14 @@ require 'site_prism'
|
|
4
4
|
require 'quke/configuration'
|
5
5
|
require 'quke/driver_configuration'
|
6
6
|
require 'quke/driver_registration'
|
7
|
+
require 'browserstack/local'
|
7
8
|
|
8
9
|
unless Quke::Quke.config.app_host.empty?
|
9
10
|
Capybara.app_host = Quke::Quke.config.app_host
|
10
11
|
end
|
11
12
|
|
12
13
|
driver_config = Quke::DriverConfiguration.new(Quke::Quke.config)
|
13
|
-
driver_reg = Quke::DriverRegistration.new(driver_config)
|
14
|
+
driver_reg = Quke::DriverRegistration.new(driver_config, Quke::Quke.config)
|
14
15
|
driver = driver_reg.register(Quke::Quke.config.driver)
|
15
16
|
|
16
17
|
Capybara.default_driver = driver
|
@@ -40,3 +41,31 @@ Capybara.save_path = 'tmp/'
|
|
40
41
|
SitePrism.configure do |config|
|
41
42
|
config.use_implicit_waits = true
|
42
43
|
end
|
44
|
+
|
45
|
+
# There aren't specific hooks we can attach to that only get called once before
|
46
|
+
# and after all tests have run in Cucumber. Therefore the next best thing is to
|
47
|
+
# hook into the AfterConfiguration and at_exit blocks.
|
48
|
+
#
|
49
|
+
# As its name suggests, this gets called after Cucumber has been configured i.e.
|
50
|
+
# all the steps above are complete. Fortunately this is before the tests start
|
51
|
+
# running so its the best place for us to start up the browserstack local
|
52
|
+
# testing binary (if it's required)
|
53
|
+
AfterConfiguration do
|
54
|
+
if Quke::Quke.config.browserstack.test_locally?
|
55
|
+
bs_local = BrowserStack::Local.new
|
56
|
+
|
57
|
+
# starts the Local instance with the required arguments via its management
|
58
|
+
# API
|
59
|
+
bs_local.start(Quke::Quke.config.browserstack.local_testing_args)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# This is the very last thing Cucumber calls that we can hook onto. Typically
|
64
|
+
# used for final cleanup, we make use of it to kill our browserstack local
|
65
|
+
# testing binary
|
66
|
+
at_exit do
|
67
|
+
if Quke::Quke.config.browserstack.test_locally?
|
68
|
+
# stop the local instance
|
69
|
+
bs_local.stop
|
70
|
+
end
|
71
|
+
end
|
data/lib/quke.rb
CHANGED
@@ -0,0 +1,138 @@
|
|
1
|
+
module Quke #:nodoc:
|
2
|
+
|
3
|
+
# Determines the configuration for browserstack, when selected as the driver
|
4
|
+
class BrowserstackConfiguration
|
5
|
+
# To run your tests with browserstack you must provide a username and
|
6
|
+
# auth_key as a minimum.
|
7
|
+
#
|
8
|
+
# If the user doesn't put these credentials in the config file (because they
|
9
|
+
# don't want to commit them to source control), Quke will also check for the
|
10
|
+
# existance of the environment variables BROWSERSTACK_USERNAME and
|
11
|
+
# BROWSERSTACK_AUTH_KEY and use them instead
|
12
|
+
attr_reader :username, :auth_key
|
13
|
+
|
14
|
+
# To use local testing users must provide a key. They will find this in
|
15
|
+
# Browserstack once logged in under settings. Its typically the same value
|
16
|
+
# as the auth_key above
|
17
|
+
attr_reader :local_key
|
18
|
+
|
19
|
+
# Capabilities are what configure the test in browserstack, for example
|
20
|
+
# what OS and browser to use.
|
21
|
+
#
|
22
|
+
# Further reference on browserstack capabilities
|
23
|
+
# https://www.browserstack.com/automate/capabilities
|
24
|
+
# https://www.browserstack.com/automate/ruby#configure-capabilities
|
25
|
+
attr_reader :capabilities
|
26
|
+
|
27
|
+
# Returns a hash of configurations values that will be passed to the
|
28
|
+
# +browserstack+ local binary when its started.
|
29
|
+
#
|
30
|
+
# The project uses the gem +browserstack-local+ to manage starting and
|
31
|
+
# stopping the binary Browserstack provide for local testing. When started
|
32
|
+
# you can configure how it behaviours by passing in a set of arguments as a
|
33
|
+
# hash. This method generates the hash based on a mix of default values and
|
34
|
+
# ones taken from the +.config.yml+.
|
35
|
+
#
|
36
|
+
# See https://github.com/browserstack/browserstack-local-ruby#arguments
|
37
|
+
# https://www.browserstack.com/local-testing
|
38
|
+
attr_reader :local_testing_args
|
39
|
+
|
40
|
+
# Initialize's the instance based in the +Quke::Configuration+ instance
|
41
|
+
# passed in.
|
42
|
+
#
|
43
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
44
|
+
def initialize(configuration)
|
45
|
+
@using_browserstack = configuration.data['driver'] == 'browserstack'
|
46
|
+
data = validate_input_data(configuration.data)
|
47
|
+
@username = ENV['BROWSERSTACK_USERNAME'] || data['username'] || ''
|
48
|
+
@auth_key = ENV['BROWSERSTACK_AUTH_KEY'] || data['auth_key'] || ''
|
49
|
+
@local_key = data['local_key'] || ''
|
50
|
+
@capabilities = data['capabilities'] || {}
|
51
|
+
determine_local_testing_args(configuration)
|
52
|
+
end
|
53
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
54
|
+
|
55
|
+
# Return true if the +browserstack.local: true+ value has been set in the
|
56
|
+
# +.config.yml+ file and the driver is set to 'browserstack', else false.
|
57
|
+
#
|
58
|
+
# It is used when determing whether to start and stop the binary
|
59
|
+
# Browserstack provides to support local testing.
|
60
|
+
def test_locally?
|
61
|
+
@capabilities['browserstack.local'] == true && using_browserstack?
|
62
|
+
end
|
63
|
+
|
64
|
+
# Returns true if the driver was set +browserstack+, else false.
|
65
|
+
#
|
66
|
+
# This class needs to know whether browserstack was selected as the driver
|
67
|
+
# to use in order to correctly determine is the browserstack local testing
|
68
|
+
# binary needs to be stopped and started for the tests.
|
69
|
+
#
|
70
|
+
# However it also serves as a clean and simple way ton determine if
|
71
|
+
# browserstack is the selected dribver.
|
72
|
+
def using_browserstack?
|
73
|
+
@using_browserstack
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns a string representing the url used when running tests via
|
77
|
+
# Browserstack[https://www.browserstack.com/] or nil.
|
78
|
+
#
|
79
|
+
# It will contain the username and auth_key set in the +.config.yml+, else
|
80
|
+
# if +username+ is blank it will return nil.
|
81
|
+
#
|
82
|
+
# An example return value
|
83
|
+
#
|
84
|
+
# "http://jdoe:123456789ABCDE@hub.browserstack.com/wd/hub"
|
85
|
+
#
|
86
|
+
# It is used when registering the driver with Capybara. So instead of this
|
87
|
+
#
|
88
|
+
# Capybara::Selenium::Driver.new(
|
89
|
+
# app,
|
90
|
+
# browser: :remote,
|
91
|
+
# url: 'http://jdoe:123456789ABCDE@hub.browserstack.com/wd/hub',
|
92
|
+
# desired_capabilities: my_capabilites
|
93
|
+
# )
|
94
|
+
#
|
95
|
+
# You can call +browserstack_url+ to get the url to use
|
96
|
+
#
|
97
|
+
# Capybara::Selenium::Driver.new(
|
98
|
+
# app,
|
99
|
+
# browser: :remote,
|
100
|
+
# url: my_config.browserstack_config.url,
|
101
|
+
# desired_capabilities: my_capabilites
|
102
|
+
# )
|
103
|
+
#
|
104
|
+
def url
|
105
|
+
return "http://#{@username}:#{@auth_key}@hub.browserstack.com/wd/hub" unless @username == ''
|
106
|
+
end
|
107
|
+
|
108
|
+
private
|
109
|
+
|
110
|
+
def validate_input_data(data)
|
111
|
+
return {} if data.nil?
|
112
|
+
return {} unless data['browserstack']
|
113
|
+
data['browserstack']
|
114
|
+
end
|
115
|
+
|
116
|
+
def determine_local_testing_args(configuration)
|
117
|
+
@local_testing_args = {
|
118
|
+
# Key is the only required arg. Everything else is optional
|
119
|
+
'key' => @local_key,
|
120
|
+
# Always kill other running Browserstack Local instances
|
121
|
+
'force' => 'true',
|
122
|
+
# We only want to enable local testing for automate
|
123
|
+
'onlyAutomate' => 'true',
|
124
|
+
# Enable verbose logging. It's of no consequence to the tests, but it
|
125
|
+
# could help in the event of errors
|
126
|
+
'v' => 'true',
|
127
|
+
# Rather than
|
128
|
+
'logfile' => File.join(Dir.pwd, '/tmp/bowerstack_local_log.txt')
|
129
|
+
}
|
130
|
+
return unless configuration.use_proxy?
|
131
|
+
|
132
|
+
@local_testing_args['proxyHost'] = configuration.proxy['host']
|
133
|
+
@local_testing_args['proxyPort'] = configuration.proxy['port'].to_s
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
data/lib/quke/configuration.rb
CHANGED
@@ -9,9 +9,13 @@ module Quke #:nodoc:
|
|
9
9
|
# Quke::Configuration.
|
10
10
|
attr_reader :file_location
|
11
11
|
|
12
|
-
# Access the loaded config data object directly
|
12
|
+
# Access the loaded config data object directly.
|
13
13
|
attr_reader :data
|
14
14
|
|
15
|
+
# Instance of +Quke::BrowserstackConfiguration+ which manages reading and
|
16
|
+
# returning the config for setting up Quke to use browserstack.
|
17
|
+
attr_reader :browserstack
|
18
|
+
|
15
19
|
class << self
|
16
20
|
# Class level setter for the location of the config file.
|
17
21
|
#
|
@@ -38,6 +42,7 @@ module Quke #:nodoc:
|
|
38
42
|
# calling a private method +load_data()+.
|
39
43
|
def initialize
|
40
44
|
@data = load_data
|
45
|
+
@browserstack = ::Quke::BrowserstackConfiguration.new(self)
|
41
46
|
end
|
42
47
|
|
43
48
|
# Returns the value set for +features_folder+.
|
@@ -129,18 +134,6 @@ module Quke #:nodoc:
|
|
129
134
|
@data['javascript_errors']
|
130
135
|
end
|
131
136
|
|
132
|
-
# Return the hash of all +browserstack+ options.
|
133
|
-
#
|
134
|
-
# If you select the browserstack driver, there are a number of options you
|
135
|
-
# can pass through to setup your browserstack tests, username and auth_key
|
136
|
-
# being the critical ones.
|
137
|
-
#
|
138
|
-
# Please see https://www.browserstack.com/automate/capabilities for more
|
139
|
-
# details.
|
140
|
-
def browserstack
|
141
|
-
@data['browserstack']
|
142
|
-
end
|
143
|
-
|
144
137
|
# Return the hash of +proxy+ server settings
|
145
138
|
#
|
146
139
|
# If your environment requires you to go via a proxy server you can
|
@@ -163,24 +156,16 @@ module Quke #:nodoc:
|
|
163
156
|
@data['custom']
|
164
157
|
end
|
165
158
|
|
166
|
-
# Override to_s to output the contents of Config as a readable string rather
|
167
|
-
# than the standard object output you get.
|
168
|
-
def to_s
|
169
|
-
@data.to_s
|
170
|
-
end
|
171
|
-
|
172
159
|
private
|
173
160
|
|
174
161
|
def load_data
|
175
162
|
data = default_data!(load_yml_data)
|
176
|
-
data['browserstack'] = browserstack_data(data['browserstack'])
|
177
163
|
data['proxy'] = proxy_data(data['proxy'])
|
178
164
|
data
|
179
165
|
end
|
180
166
|
|
181
167
|
# rubocop:disable Metrics/AbcSize
|
182
168
|
# rubocop:disable Metrics/CyclomaticComplexity
|
183
|
-
# rubocop:disable Metrics/MethodLength
|
184
169
|
# rubocop:disable Metrics/PerceivedComplexity
|
185
170
|
def default_data!(data)
|
186
171
|
data.merge(
|
@@ -205,20 +190,8 @@ module Quke #:nodoc:
|
|
205
190
|
end
|
206
191
|
# rubocop:enable Metrics/AbcSize
|
207
192
|
# rubocop:enable Metrics/CyclomaticComplexity
|
208
|
-
# rubocop:enable Metrics/MethodLength
|
209
193
|
# rubocop:enable Metrics/PerceivedComplexity
|
210
194
|
|
211
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
212
|
-
def browserstack_data(data)
|
213
|
-
data = {} if data.nil?
|
214
|
-
data.merge(
|
215
|
-
'username' => (ENV['BROWSERSTACK_USERNAME'] || data['username'] || ''),
|
216
|
-
'auth_key' => (ENV['BROWSERSTACK_AUTH_KEY'] || data['auth_key'] || ''),
|
217
|
-
'capabilities' => data['capabilities'] || {}
|
218
|
-
)
|
219
|
-
end
|
220
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
221
|
-
|
222
195
|
def proxy_data(data)
|
223
196
|
data = {} if data.nil?
|
224
197
|
data.merge(
|
@@ -202,40 +202,6 @@ module Quke #:nodoc:
|
|
202
202
|
end
|
203
203
|
# rubocop:enable Metrics/AbcSize
|
204
204
|
|
205
|
-
# Returns a string representing the url used when running tests via
|
206
|
-
# Browserstack[https://www.browserstack.com/] or nil.
|
207
|
-
#
|
208
|
-
# It will contain the username and auth_key set in the +.config.yml+, else
|
209
|
-
# if +username+ is blank it will return nil.
|
210
|
-
#
|
211
|
-
# An example return value
|
212
|
-
#
|
213
|
-
# "http://jdoe:123456789ABCDE@hub.browserstack.com/wd/hub"
|
214
|
-
#
|
215
|
-
# It is used when registering the driver with Capybara. So instead of this
|
216
|
-
#
|
217
|
-
# Capybara::Selenium::Driver.new(
|
218
|
-
# app,
|
219
|
-
# browser: :remote,
|
220
|
-
# url: 'http://jdoe:123456789ABCDE@hub.browserstack.com/wd/hub',
|
221
|
-
# desired_capabilities: my_capabilites
|
222
|
-
# )
|
223
|
-
#
|
224
|
-
# You can call +browserstack_url+ to get the url to use
|
225
|
-
#
|
226
|
-
# Capybara::Selenium::Driver.new(
|
227
|
-
# app,
|
228
|
-
# browser: :remote,
|
229
|
-
# url: my_driver_config.browserstack_url,
|
230
|
-
# desired_capabilities: my_capabilites
|
231
|
-
# )
|
232
|
-
#
|
233
|
-
def browserstack_url
|
234
|
-
username = config.browserstack['username']
|
235
|
-
key = config.browserstack['auth_key']
|
236
|
-
return "http://#{username}:#{key}@hub.browserstack.com/wd/hub" unless username == ''
|
237
|
-
end
|
238
|
-
|
239
205
|
# Returns an instance of Selenium::WebDriver::Remote::Capabilities to be
|
240
206
|
# used when registering an instance of Capybara::Selenium::Driver,
|
241
207
|
# configured to run using the Browserstack[https://www.browserstack.com/]
|
@@ -274,9 +240,7 @@ module Quke #:nodoc:
|
|
274
240
|
# https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/capabilities.rb
|
275
241
|
capabilities = Selenium::WebDriver::Remote::Capabilities.new
|
276
242
|
|
277
|
-
|
278
|
-
|
279
|
-
browserstack_capabilities.each do |key, value|
|
243
|
+
config.browserstack.capabilities.each do |key, value|
|
280
244
|
capabilities[key] = value
|
281
245
|
end
|
282
246
|
|
@@ -10,13 +10,19 @@ module Quke #:nodoc:
|
|
10
10
|
|
11
11
|
# Access the instance of Quke::DriverConfiguration passed to this instance
|
12
12
|
# of Quke::DriverRegistration when it was initialized.
|
13
|
+
attr_reader :driver_config
|
14
|
+
|
15
|
+
# Access the instance of Quke::Configuration passed to this instance of
|
16
|
+
# Quke::DriverOptions when it was initialized.
|
13
17
|
attr_reader :config
|
14
18
|
|
15
19
|
# Instantiate an instance of Quke::DriverRegistration.
|
16
20
|
#
|
17
21
|
# It expects an instance of Quke::DriverConfiguration which will detail the
|
18
|
-
# driver to be used and any related options
|
19
|
-
|
22
|
+
# driver to be used and any related options, and Quke::Configuration
|
23
|
+
# specifically for access to the browserstack config.
|
24
|
+
def initialize(driver_config, config)
|
25
|
+
@driver_config = driver_config
|
20
26
|
@config = config
|
21
27
|
end
|
22
28
|
|
@@ -56,7 +62,7 @@ module Quke #:nodoc:
|
|
56
62
|
# called, all we're doing here is telling it what block (code) to
|
57
63
|
# execute at that time.
|
58
64
|
# :simplecov_ignore:
|
59
|
-
Capybara::Poltergeist::Driver.new(app,
|
65
|
+
Capybara::Poltergeist::Driver.new(app, @driver_config.poltergeist)
|
60
66
|
# :simplecov_ignore:
|
61
67
|
end
|
62
68
|
:phantomjs
|
@@ -74,7 +80,7 @@ module Quke #:nodoc:
|
|
74
80
|
# http://preferential.mozdev.org/preferences.html
|
75
81
|
Capybara.register_driver :firefox do |app|
|
76
82
|
# :simplecov_ignore:
|
77
|
-
Capybara::Selenium::Driver.new(app, profile:
|
83
|
+
Capybara::Selenium::Driver.new(app, profile: @driver_config.firefox)
|
78
84
|
# :simplecov_ignore:
|
79
85
|
end
|
80
86
|
:firefox
|
@@ -94,7 +100,7 @@ module Quke #:nodoc:
|
|
94
100
|
Capybara::Selenium::Driver.new(
|
95
101
|
app,
|
96
102
|
browser: :chrome,
|
97
|
-
switches:
|
103
|
+
switches: @driver_config.chrome
|
98
104
|
)
|
99
105
|
# :simplecov_ignore:
|
100
106
|
end
|
@@ -111,8 +117,8 @@ module Quke #:nodoc:
|
|
111
117
|
Capybara::Selenium::Driver.new(
|
112
118
|
app,
|
113
119
|
browser: :remote,
|
114
|
-
url: config.
|
115
|
-
desired_capabilities:
|
120
|
+
url: @config.browserstack.url,
|
121
|
+
desired_capabilities: @driver_config.browserstack
|
116
122
|
)
|
117
123
|
# :simplecov_ignore:
|
118
124
|
end
|
data/lib/quke/version.rb
CHANGED
data/quke.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'quke/version'
|
@@ -90,12 +89,17 @@ Gem::Specification.new do |spec|
|
|
90
89
|
# will instead open in the default browser instead.
|
91
90
|
spec.add_dependency 'launchy', '~> 2.4'
|
92
91
|
|
92
|
+
# Ruby bindings for BrowserStack Local. This gem handles downloading and
|
93
|
+
# installing the right version of the binary for the OS Quke is running on,
|
94
|
+
# and provides an API for managing it.
|
95
|
+
spec.add_dependency 'browserstack-local'
|
96
|
+
|
93
97
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
98
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.6'
|
99
|
+
spec.add_development_dependency 'github_changelog_generator', '~> 1.13'
|
94
100
|
spec.add_development_dependency 'rake', '~> 10.5'
|
95
101
|
spec.add_development_dependency 'rdoc', '~> 4.2'
|
96
102
|
spec.add_development_dependency 'rspec', '~> 3.5'
|
97
|
-
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.6'
|
98
103
|
spec.add_development_dependency 'simplecov', '~> 0.12'
|
99
|
-
spec.add_development_dependency 'github_changelog_generator', '~> 1.13'
|
100
104
|
end
|
101
105
|
# rubocop:enable Metrics/BlockLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Cruikshanks
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '2.4'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: browserstack-local
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: bundler
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,89 +151,89 @@ dependencies:
|
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '1.12'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
154
|
+
name: codeclimate-test-reporter
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
159
|
+
version: '0.6'
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
166
|
+
version: '0.6'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
168
|
+
name: github_changelog_generator
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - "~>"
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
173
|
+
version: '1.13'
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - "~>"
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
180
|
+
version: '1.13'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
182
|
+
name: rake
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - "~>"
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
187
|
+
version: '10.5'
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
194
|
+
version: '10.5'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
196
|
+
name: rdoc
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
199
|
- - "~>"
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
201
|
+
version: '4.2'
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
208
|
+
version: '4.2'
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
210
|
+
name: rspec
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
213
|
- - "~>"
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
215
|
+
version: '3.5'
|
202
216
|
type: :development
|
203
217
|
prerelease: false
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
222
|
+
version: '3.5'
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
224
|
+
name: simplecov
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
212
226
|
requirements:
|
213
227
|
- - "~>"
|
214
228
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
229
|
+
version: '0.12'
|
216
230
|
type: :development
|
217
231
|
prerelease: false
|
218
232
|
version_requirements: !ruby/object:Gem::Requirement
|
219
233
|
requirements:
|
220
234
|
- - "~>"
|
221
235
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
236
|
+
version: '0.12'
|
223
237
|
description: Quke tries to simplify the process of writing and running acceptance
|
224
238
|
tests by setting up Cucumber for you. It handles the config to allow you to run
|
225
239
|
your tests in Firefox and Chrome, or the headless browser PhantomJS. It also has
|
@@ -251,6 +265,7 @@ files:
|
|
251
265
|
- lib/features/support/before_hook.rb
|
252
266
|
- lib/features/support/env.rb
|
253
267
|
- lib/quke.rb
|
268
|
+
- lib/quke/browserstack_configuration.rb
|
254
269
|
- lib/quke/configuration.rb
|
255
270
|
- lib/quke/cuke_runner.rb
|
256
271
|
- lib/quke/driver_configuration.rb
|