quke 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 1bb1e5484a903fbc8b00b9d67b3eabc25a2abf6e
4
- data.tar.gz: 6d19bda0cc6cd6837a10518e62afb43378f7d6f5
3
+ metadata.gz: dd7aa28081edfc9cce4400842782f1c8e853a1b7
4
+ data.tar.gz: d99e4eacf100a69a276323a80617c15d8534fdb7
5
5
  SHA512:
6
- metadata.gz: 3a00d9f8f551ff3457facfd76de6c95e0c99e114ecd54ea5ff5d405d1b52b7022709ca522a65de7a9a8653277058af329d231039465377ed80f8f26090465674
7
- data.tar.gz: 428e1141fa40375500a329a665afc474fb43ad261060b53f02b6a039d23e3401b88a27e0e6f75988fb6ec65165b136aa3d206092a7b9f2e9751babaaf6be785f
6
+ metadata.gz: cea424d7ee59455d0496808b0b7c6e442984f37db9c834b8c06e75d24c11b6d1414a007fa83a1f988c7e3f1c5c395a880d102912c14b64140ca209f395819ece
7
+ data.tar.gz: 3d41f20f1c49d414f44f0bd573b8540bcfae9bdecfd4dc1e974cad8d6751f75569e075a52799df4045e13072deb1cf249a12d1c3ab19cb8de0b23b7b3c3a26d6
@@ -39,6 +39,15 @@ max_wait_time: 5
39
39
  # you have is not supported by the site.
40
40
  user_agent: "Mozilla/5.0 (MSIE 10.0; Windows NT 6.1; Trident/5.0)"
41
41
 
42
+ # Currently only supported when using the phantomjs driver (ignored by the
43
+ # others). In phantomjs if a site has a javascript error we can configure it
44
+ # to throw an error which will cause the test to fail. Quke by default sets this
45
+ # to true, however you can override it by setting this flag to false.
46
+ # For example you may be dealing with a legacy site and JavaScript errors
47
+ # are out of your scope. You still want to test other aspects of the site
48
+ # but not let these errors prevent you from using phantomjs.
49
+ javascript_errors: false
50
+
42
51
  # Anything you place under the 'custom' node in the `.config.yml` file will be
43
52
  # available within your steps and page objects by calling
44
53
  # `Quke::Quke.config.custom`. So using the example below we could access its
@@ -1,5 +1,22 @@
1
1
  # Change Log
2
2
 
3
+ ## [Unreleased](https://github.com/DEFRA/quke/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/DEFRA/quke/compare/v0.3.1...HEAD)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Update version number \(forgot during last change!\) [\#62](https://github.com/DEFRA/quke/pull/62) ([Cruikshanks](https://github.com/Cruikshanks))
10
+
11
+ ## [v0.3.1](https://github.com/DEFRA/quke/tree/v0.3.1) (2017-06-12)
12
+ [Full Changelog](https://github.com/DEFRA/quke/compare/v0.3.0...v0.3.1)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - Refactor some proxy logic to make code simpler [\#61](https://github.com/DEFRA/quke/pull/61) ([Cruikshanks](https://github.com/Cruikshanks))
17
+ - Add ability to set user-agent to use [\#60](https://github.com/DEFRA/quke/pull/60) ([Cruikshanks](https://github.com/Cruikshanks))
18
+ - \[ci skip\] Updating CHANGELOG.md [\#56](https://github.com/DEFRA/quke/pull/56) ([Cruikshanks](https://github.com/Cruikshanks))
19
+
3
20
  ## [v0.3.0](https://github.com/DEFRA/quke/tree/v0.3.0) (2017-03-07)
4
21
  [Full Changelog](https://github.com/DEFRA/quke/compare/v0.2.8...v0.3.0)
5
22
 
@@ -116,6 +116,19 @@ module Quke #:nodoc:
116
116
  @data['user_agent']
117
117
  end
118
118
 
119
+ # Return the value set for +javascript_errors+.
120
+ #
121
+ # Currently only supported when using the phantomjs driver (ignored by the
122
+ # others). In phantomjs if a site has a javascript error we can configure it
123
+ # to throw an error which will cause the test to fail. Quke by default sets
124
+ # this to true, however you can override it by setting this flag to false.
125
+ # For example you may be dealing with a legacy site and JavaScript errors
126
+ # are out of your scope. You still want to test other aspects of the site
127
+ # but not let these errors prevent you from using phantomjs.
128
+ def javascript_errors
129
+ @data['javascript_errors']
130
+ end
131
+
119
132
  # Return the hash of +browserstack+ options.
120
133
  #
121
134
  # If you select the browserstack driver, there are a number of options you
@@ -170,14 +183,21 @@ module Quke #:nodoc:
170
183
  # rubocop:disable Metrics/PerceivedComplexity
171
184
  def default_data!(data)
172
185
  data.merge(
173
- 'features_folder' => (data['features'] || 'features').downcase.strip,
174
- 'app_host' => (data['app_host'] || '').downcase.strip,
175
- 'driver' => (data['driver'] || 'phantomjs').downcase.strip,
176
- 'pause' => (data['pause'] || '0').to_s.downcase.strip.to_i,
177
- 'stop_on_error' => (data['stop_on_error'] || 'false').to_s.downcase.strip,
178
- 'max_wait_time' => (data['max_wait_time'] || Capybara.default_max_wait_time).to_s.downcase.strip.to_i,
179
- 'user_agent' => (data['user_agent'] || '').strip,
180
- 'custom' => (data['custom'] || nil)
186
+ 'features_folder' => (data['features'] || 'features').downcase.strip,
187
+ 'app_host' => (data['app_host'] || '').downcase.strip,
188
+ 'driver' => (data['driver'] || 'phantomjs').downcase.strip,
189
+ 'pause' => (data['pause'] || '0').to_s.downcase.strip.to_i,
190
+ 'stop_on_error' => (data['stop_on_error'] || 'false').to_s.downcase.strip,
191
+ 'max_wait_time' => (data['max_wait_time'] || Capybara.default_max_wait_time).to_s.downcase.strip.to_i,
192
+ 'user_agent' => (data['user_agent'] || '').strip,
193
+ # Because we want to default to 'true', but allow users to override it
194
+ # with 'false' it causes us to mess with the logic. Essentially if the
195
+ # user does enter false (either as a string or as a boolean) the result
196
+ # will be 'true', so we flip it back to 'false' with !.
197
+ # Else the condition fails and we get 'false', which when flipped gives
198
+ # us 'true', which is what we want the default value to be
199
+ 'javascript_errors' => !(data['javascript_errors'].to_s.downcase.strip == 'false'),
200
+ 'custom' => (data['custom'] || nil)
181
201
  )
182
202
  end
183
203
  # rubocop:enable Metrics/AbcSize
@@ -52,7 +52,7 @@ module Quke #:nodoc:
52
52
  # https://github.com/teampoltergeist/poltergeist#customization
53
53
  {
54
54
  # Javascript errors will get re-raised in our tests causing them to fail
55
- js_errors: true,
55
+ js_errors: config.javascript_errors,
56
56
  # How long in seconds we'll wait for response when communicating with
57
57
  # Phantomjs
58
58
  timeout: 30,
@@ -1,3 +1,3 @@
1
1
  module Quke #:nodoc:
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Cruikshanks