howitzer 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d72a5c40224b791c09af55a7f96a85783dd9bbec
4
- data.tar.gz: 5c06f66b976b7fe0d389ebd516aa99b7ec60b7a5
3
+ metadata.gz: bb8410811f708378094fa35c54437e100e62efc6
4
+ data.tar.gz: 9b2fa233a0ccc0ce63c8a4f410a053228dd6bace
5
5
  SHA512:
6
- metadata.gz: e6540a619b0d5d157703116803ed3e3a032ce4570367c1e2dff77fcf97daf516c81fa2220c27cd2ec4a3e788768b2001cf7409d28508b6d5085e26b246652722
7
- data.tar.gz: 46d599bfd49cb004da4b7ddb3fe79d8b765df77ae9e4ac4a4c42eb7c02aae385b1b712c22d565cb002e2742b1bc4be33b0418c4d29850ea7a620d16c070f65f0
6
+ metadata.gz: 2ec55c0135ef0929e65808aa5a1d61aa62b96b40f29ab0ce13fb57b6c0dd14ff5730358d3a7812e66c999f758f3c9b4b6aeeb3c5b62b1547a6fbbe0e096c2e45
7
+ data.tar.gz: 7f02cc2ba7ffe493e812b84fa2167c120af2bd7f2238e88c334e70dd5fced7d5b9f8f1c0f0057dd47f3d944e0ae0e3f4b54cb2bc6dd5e9aceefadd20d9a9d126
@@ -17,6 +17,9 @@ Style/EmptyElse:
17
17
  Lint/AmbiguousRegexpLiteral:
18
18
  Enabled: false
19
19
 
20
+ Lint/AmbiguousBlockAssociation:
21
+ Enabled: false
22
+
20
23
  Style/CaseEquality:
21
24
  Enabled: false
22
25
 
@@ -2,6 +2,6 @@ language: ruby
2
2
  before_install:
3
3
  - gem install bundler
4
4
  rvm:
5
- - 2.2.6
6
- - 2.3.3
7
- - 2.4.0
5
+ - 2.2.7
6
+ - 2.3.4
7
+ - 2.4.1
@@ -1,9 +1,19 @@
1
- ## [In git](https://github.com/strongqa/howitzer/compare/v2.0.2...master)
1
+ ## [In git](https://github.com/strongqa/howitzer/compare/v2.0.3...master)
2
2
 
3
3
  ### New Features
4
4
 
5
5
  ### Bugfixes
6
6
 
7
+ ## [v2.0.3](https://github.com/strongqa/howitzer/compare/v2.0.2...v2.0.3)
8
+
9
+ ### New Features
10
+ - Integrate Google Chrome Headless
11
+ - Stop supported **mailgun_idle_timeout** deprecated setting
12
+ - Added maintenance instructions for releasing
13
+
14
+ ### Bugfixes
15
+ - [#222](https://github.com/strongqa/howitzer/issues/222) fix issue with incorrect iframe scope identifying
16
+
7
17
  ## [v2.0.2](https://github.com/strongqa/howitzer/compare/v2.0.1...v2.0.2)
8
18
 
9
19
  ### New Features
@@ -0,0 +1,32 @@
1
+ # Howitzer Maintenance
2
+
3
+ This guide provides detailed instructions how to release a new Howitzer version
4
+
5
+ To release a new Howitzer version:
6
+
7
+ * Make sure all pull requests have been merged to master branch
8
+ * Make sure last build is passed in [TravisCI](https://travis-ci.org/strongqa/howitzer)
9
+ * Make sure the code is covered 100% in [Coveralls](https://coveralls.io/github/strongqa/howitzer?branch=master)
10
+ * Make sure all gem dependencies are up-to-date with [Gemnasium](https://gemnasium.com/strongqa/howitzer)
11
+ * Make sure the code is documented 100% with following command:
12
+ ```
13
+ rake yard
14
+ ```
15
+ * [Upgrade](https://github.com/strongqa/howitzer/wiki/Migration-to-new-version) Howitzer examples [Cucumber](https://github.com/strongqa/howitzer_example_cucumber), [Rspec](https://github.com/strongqa/howitzer_example_rspec) and [Turnip](https://github.com/strongqa/howitzer_example_turnip) to last version of code from master and make sure all builds are green
16
+ * Bump [version](lib/howitzer/version.rb). Please note howitzer uses [semantic versioning](http://semver.org/)
17
+ * Verify and actualize [ChangeLog](CHANGELOG.md)
18
+ * Commit all changes and push to origin master
19
+ * Specify credentials for Rubygems.org (once only) with following commands:
20
+ ```bash
21
+ curl https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
22
+ chmod 0600 ~/.gem/credentials
23
+ ```
24
+ * Release Gem with following command:
25
+ ```bash
26
+ rake release
27
+ ```
28
+ * Verify successful release on [Rubygems](https://rubygems.org/gems/howitzer)
29
+ * Force API documentation indexing for the new version on [Rubygems](https://rubygems.org/gems/howitzer)
30
+ * Update new link to documentation on [web site](https://github.com/romikoops/howitzer-framework.io/tree/gh-pages) Note: The web site will be updated automatically after pushing code to Github
31
+ * Update [Howitzer Guides](https://github.com/strongqa/docs.howitzer-framework.io/blob/gh-pages/README.md) regarding new changes
32
+ * Notify Community (Gitter, Twitter, Google Group) about the new release
data/README.md CHANGED
@@ -44,11 +44,11 @@ You can also find the Rdoc documentation on [Rubygems](https://rubygems.org/gems
44
44
  * [Ruby](https://www.ruby-lang.org/en/downloads/) 2.2.2+
45
45
  * [DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions) (For **Windows** only)
46
46
  * [PhantomJS](http://phantomjs.org/download.html) (For **phantomjs** and **poltergeist** drivers only)
47
- * [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) (For **chrome** selenium browser)
47
+ * [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) (For **chrome** selenium browser, 2.29+ for headless mode)
48
48
  * [GeckoDriver](https://github.com/mozilla/geckodriver/releases) (For **firefox** selenium browser)
49
49
  * [SafariDriver](https://webkit.org/blog/6900/webdriver-support-in-safari-10/) (For **safari** selenium browser)
50
50
  * [QT](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit) (For **webkit** driver only)
51
-
51
+ * [Chrome](https://www.google.com/chrome/browser/desktop/index.html) v.59+ (For **headless chrome** support)
52
52
  ## Setup
53
53
  To install, type
54
54
 
@@ -141,7 +141,7 @@ community](https://github.com/strongqa/howitzer/graphs/contributors).
141
141
  License
142
142
  -------
143
143
 
144
- howitzer is Copyright © 2012-2016 Roman Parashchenko and StrongQA Ltd. It is free
144
+ howitzer is Copyright © 2012-2017 Roman Parashchenko and StrongQA Ltd. It is free
145
145
  software, and may be redistributed under the terms specified in the
146
146
  [LICENSE](LICENSE) file.
147
147
 
data/Rakefile CHANGED
@@ -19,4 +19,4 @@ YARD::Rake::YardocTask.new { |_t| }
19
19
 
20
20
  RuboCop::RakeTask.new
21
21
 
22
- task default: %i(rubocop spec cucumber)
22
+ task default: %i[rubocop spec cucumber]
@@ -13,13 +13,13 @@ module HowitzerCli
13
13
  arg_name '<PROJECT NAME>'
14
14
  command :new do |c|
15
15
  c.desc 'Integrate Cucumber'
16
- c.switch %i(c cucumber), negatable: false
16
+ c.switch %i[c cucumber], negatable: false
17
17
 
18
18
  c.desc 'Integrate Rspec'
19
- c.switch %i(r rspec), negatable: false
19
+ c.switch %i[r rspec], negatable: false
20
20
 
21
21
  c.desc 'Integrate Turnip'
22
- c.switch %i(t turnip), negatable: false
22
+ c.switch %i[t turnip], negatable: false
23
23
 
24
24
  c.action do |_global_options, options, args|
25
25
  if !args.empty?
@@ -1,4 +1,4 @@
1
- HOWITZER_KNOWN_DRIVERS = %i(
1
+ HOWITZER_KNOWN_DRIVERS = %i[
2
2
  selenium
3
3
  selenium_grid
4
4
  webkit
@@ -7,7 +7,8 @@ HOWITZER_KNOWN_DRIVERS = %i(
7
7
  sauce
8
8
  testingbot
9
9
  browserstack
10
- ).freeze
10
+ headless_chrome
11
+ ].freeze
11
12
 
12
13
  unless HOWITZER_KNOWN_DRIVERS.include?(Howitzer.driver.to_s.to_sym)
13
14
  raise Howitzer::UnknownDriverError, "Unknown '#{Howitzer.driver}' driver." \
@@ -52,6 +53,16 @@ Capybara.register_driver :selenium do |app|
52
53
  Capybara::Selenium::Driver.new app, params
53
54
  end
54
55
 
56
+ # :headless_chrome driver
57
+
58
+ Capybara.register_driver :headless_chrome do |app|
59
+ startup_flags = ['--headless']
60
+ startup_flags << '-start-maximized' if Howitzer.maximized_window
61
+ startup_flags.concat(Howitzer.headless_chrome_flags.split(/\s*,\s*/)) if Howitzer.headless_chrome_flags
62
+ params = { browser: :chrome, switches: startup_flags }
63
+ Capybara::Selenium::Driver.new app, params
64
+ end
65
+
55
66
  # :webkit driver
56
67
 
57
68
  if Howitzer.driver.to_sym == :webkit
@@ -151,6 +162,9 @@ Capybara.save_path = Howitzer.log_dir
151
162
  Capybara::Screenshot.register_driver(:phantomjs) do |driver, path|
152
163
  driver.browser.save_screenshot path
153
164
  end
165
+ Capybara::Screenshot.register_driver(:headless_chrome) do |driver, path|
166
+ driver.browser.save_screenshot path
167
+ end
154
168
  Capybara::Screenshot.append_timestamp = false
155
169
  Capybara::Screenshot.register_filename_prefix_formatter(:default) do
156
170
  "capybara-screenshot-#{Gen.serial}"
@@ -21,13 +21,17 @@
21
21
  maximized_window: true # Specify maximized browser window size
22
22
 
23
23
  # Specify one of the following drivers: selenium, selenium_grid, webkit, poltergeist, phantomjs, sauce,
24
- # testingbot, browserstack
24
+ # testingbot, browserstack, headless_chrome
25
25
  driver: phantomjs
26
26
 
27
27
  # -Selenium-
28
28
  # specify one of next browsers: iexplore (ie), firefox (ff), chrome, safari
29
29
  selenium_browser: ff
30
30
 
31
+ # -Headless Chrome-
32
+ # List of available flags (http://peter.sh/experiments/chromium-command-line-switches/)
33
+ headless_chrome_flags: "--window-size=1920x1080, --disable-gpu"
34
+
31
35
  # -Selenium Grid-
32
36
  selenium_hub_url: "http://example.com:4444/wd/hub"
33
37
 
@@ -1,5 +1,4 @@
1
1
  require 'cucumber'
2
- require 'capybara-screenshot/cucumber'
3
2
  require_relative '../../config/boot'
4
3
  require_relative '../../config/capybara'
5
4
 
@@ -3,6 +3,6 @@ class TestEmail < Howitzer::Email
3
3
  subject 'Test email'
4
4
 
5
5
  def addressed_to?(new_user)
6
- /Hi #{new_user}/ === plain_text_body
6
+ plain_text_body =~ /Hi #{new_user}/ ? true : false
7
7
  end
8
8
  end
@@ -19,6 +19,9 @@ Style/EmptyElse:
19
19
  Lint/AmbiguousRegexpLiteral:
20
20
  Enabled: false
21
21
 
22
+ Lint/AmbiguousBlockAssociation:
23
+ Enabled: false
24
+
22
25
  Style/CaseEquality:
23
26
  Enabled: false
24
27
 
@@ -29,4 +32,4 @@ Style/FrozenStringLiteralComment:
29
32
  Enabled: false
30
33
 
31
34
  Metrics/ModuleLength:
32
- Max: 150
35
+ Max: 150
@@ -10,7 +10,7 @@ module Howitzer
10
10
  # Testingbot or Browserstack cloud service
11
11
 
12
12
  def cloud_driver?
13
- %i(sauce testingbot browserstack).include?(Howitzer.driver.to_sym)
13
+ %i[sauce testingbot browserstack].include?(Howitzer.driver.to_sym)
14
14
  end
15
15
 
16
16
  # @return [Boolean] whether or not current browser is
@@ -1,4 +1,4 @@
1
1
  # This module holds howitzer version
2
2
  module Howitzer
3
- VERSION = '2.0.2'.freeze #:nodoc:
3
+ VERSION = '2.0.3'.freeze #:nodoc:
4
4
  end
@@ -1,4 +1,6 @@
1
1
  require 'capybara'
2
+ require 'active_support'
3
+ require 'active_support/core_ext'
2
4
 
3
5
  # Remove this monkey patch after fixing the bugs in selenium-webdriver / capybara
4
6
  #:nocov:
@@ -20,7 +22,7 @@ class Capybara::Selenium::Driver # rubocop:disable Style/ClassAndModuleChildren
20
22
  private
21
23
 
22
24
  def within_frame?
23
- !(@frame_handles.empty? || @frame_handles[browser.window_handle].empty?)
25
+ !(@frame_handles.blank? || @frame_handles[browser.window_handle].blank?)
24
26
  end
25
27
  end
26
28
  #:nocov:
@@ -31,7 +33,7 @@ module Howitzer
31
33
  module CapybaraMethodsProxy
32
34
  PROXIED_CAPYBARA_METHODS = Capybara::Session::SESSION_METHODS + #:nodoc:
33
35
  Capybara::Session::MODAL_METHODS +
34
- %i(driver text)
36
+ %i[driver text]
35
37
 
36
38
  # Capybara form dsl methods are not compatible with page object pattern and Howitzer gem.
37
39
  # Instead of including Capybara::DSL module, we proxy most interesting Capybara methods and
@@ -44,7 +46,7 @@ module Howitzer
44
46
  # @param flag [Boolean] Determines accept or decline alert box
45
47
 
46
48
  def click_alert_box(flag)
47
- if %w(selenium sauce).include? Howitzer.driver
49
+ if %w[selenium sauce].include? Howitzer.driver
48
50
  alert = driver.browser.switch_to.alert
49
51
  flag ? alert.accept : alert.dismiss
50
52
  else
@@ -153,7 +153,7 @@ module Howitzer
153
153
 
154
154
  def initialize
155
155
  check_validations_are_defined!
156
- current_window.maximize if Howitzer.maximized_window
156
+ current_window.maximize if Howitzer.maximized_window && Howitzer.driver != 'headless_chrome'
157
157
  end
158
158
 
159
159
  # Reloads current page in a browser
@@ -7,4 +7,3 @@ capybara_wait_time: 5
7
7
  cloud_http_idle_timeout: 10
8
8
  hide_datetime_from_log: true
9
9
  maximized_window: false
10
- mailgun_idle_timeout: 0.5
@@ -15,7 +15,7 @@ RSpec.describe 'Generators' do
15
15
  let(:expected_result) do
16
16
  [
17
17
  { name: '/.gitignore', is_directory: false, size: 196 },
18
- { name: '/.rubocop.yml', is_directory: false, size: 584 },
18
+ { name: '/.rubocop.yml', is_directory: false, size: 634 },
19
19
  { name: '/Gemfile', is_directory: false, size: 625 },
20
20
  { name: '/Rakefile', is_directory: false, size: template_file_size('root', 'Rakefile') }
21
21
  ]
@@ -70,7 +70,7 @@ RSpec.describe Howitzer::Cache do
70
70
  it { expect(described_class.data).to eq(cloud: { status: false }, foo: {}, bar: {}, baz: {}) }
71
71
  end
72
72
  context 'when custom argument' do
73
- let(:exception_list) { %i(foo bar) }
73
+ let(:exception_list) { %i[foo bar] }
74
74
  before { described_class.clear_all_ns(exception_list) }
75
75
  it do
76
76
  expect(described_class.data).to eq(
@@ -35,6 +35,6 @@ RSpec.describe 'Howitzer' do
35
35
  "WARNING! 'mailgun_idle_timeout' setting is deprecated. Please replace with 'mail_wait_time' setting."
36
36
  )
37
37
  end
38
- it { is_expected.to eq(0.5) }
38
+ it { is_expected.to be_nil }
39
39
  end
40
40
  end
@@ -296,6 +296,16 @@ RSpec.describe Howitzer::Web::Page do
296
296
  subject
297
297
  end
298
298
  end
299
+ context 'when maximized_window is true and driver is headless_chrome' do
300
+ before do
301
+ allow(Howitzer).to receive(:maximized_window) { true }
302
+ allow(Howitzer).to receive(:driver) { 'headless_chrome' }
303
+ end
304
+ it do
305
+ expect_any_instance_of(described_class).not_to receive('current_window.maximize')
306
+ subject
307
+ end
308
+ end
299
309
  context 'when maximized_window is false' do
300
310
  before { allow(Howitzer).to receive(:maximized_window) { false } }
301
311
  it do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howitzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Parashchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-27 00:00:00.000000000 Z
11
+ date: 2017-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -232,6 +232,7 @@ files:
232
232
  - CONTRIBUTING.md
233
233
  - Gemfile
234
234
  - LICENSE
235
+ - MAINTENANCE.md
235
236
  - README.md
236
237
  - Rakefile
237
238
  - bin/howitzer
@@ -294,6 +295,7 @@ files:
294
295
  - lib/howitzer/log.rb
295
296
  - lib/howitzer/mail_adapters.rb
296
297
  - lib/howitzer/mail_adapters/abstract.rb
298
+ - lib/howitzer/mail_adapters/debugmail.rb
297
299
  - lib/howitzer/mail_adapters/mailgun.rb
298
300
  - lib/howitzer/mailgun_api.rb
299
301
  - lib/howitzer/mailgun_api/client.rb
@@ -375,7 +377,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
377
  version: '0'
376
378
  requirements: []
377
379
  rubyforge_project:
378
- rubygems_version: 2.6.10
380
+ rubygems_version: 2.6.8
379
381
  signing_key:
380
382
  specification_version: 4
381
383
  summary: Ruby based framework for acceptance testing