automation_helpers 5.0.1 → 5.2.0

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
  SHA256:
3
- metadata.gz: 1c1bb38f10286b2d053d364594e05d3e6eacfad9ef2c72facfcdf6f4aad4e992
4
- data.tar.gz: 316f98bb817bd51ff66a62c5131ae8ad8fccd88a50eb3c2576e6eb5b38e4562e
3
+ metadata.gz: 75259b6680a81c12797e7e149e8ddf63e4c5e0a53e9abce49209eb1872797eff
4
+ data.tar.gz: 733f42580acc3cb78d8a4106f492d07f5f9354247a63eb05261be7ae5df1bf56
5
5
  SHA512:
6
- metadata.gz: 49ef1152fa3ab209a72b23e6caa5c94576cf55f7037d930b4df333c0b5286377962a098c35613eb1e6792c516000f49bf2d50aa3e51ee361b2d88f1922ef3b87
7
- data.tar.gz: 57c121b3976d5d694a6a4027048afa06fefb1930f987ee524244c90222874e4ab2349f5296c5a8a80e50135bdf176de10c960dd46dd7fdb37e08be668a8225b8
6
+ metadata.gz: 1e756396a0eca7e1dfba394c511d8b2885fe4afa1244e51cef033019b4e920e24ebc64e3ad7469be499d887482a0e074ab910eb3f44b423ab6da9d0350ae318a
7
+ data.tar.gz: 6d325dc0137c51061c5ff0ff14e4394a6eec54603d00122fa1a153e7084e911e0908245eae8ee215f93be7558e9ed6563f9008e70d93efd5e9eeb8af27af73e4
data/LICENSE.txt CHANGED
@@ -1,13 +1,25 @@
1
+ BSD 3-Clause License
2
+
1
3
  Copyright (c) 2020 - The SitePrism team & Marcelo Nicolosi Santos
2
4
 
3
5
  All rights reserved.
4
6
 
5
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided
8
+ that the following conditions are met:
6
9
 
7
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10
+ Redistributions of source code must retain the above copyright notice, this list of conditions
11
+ and the following disclaimer.
8
12
 
9
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
13
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
14
+ the following disclaimer in the documentation and/or other materials provided with the distribution.
10
15
 
11
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
16
+ Neither the name of the copyright holder nor the names of its contributors may be used to endorse or
17
+ promote products derived from this software without specific prior written permission.
12
18
 
13
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
22
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
23
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -57,4 +57,5 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/site-p
57
57
 
58
58
  ## Verbose Documentation
59
59
 
60
- This will come in time. Meanwhile if you check the gem code most methods are documented. Also check the specs
60
+ This will come in time. Meanwhile if you check the gem code most methods are
61
+ documented. Also check the specs for more detailed information
@@ -14,8 +14,7 @@ module AutomationHelpers
14
14
  # This requires a series of pre-set values to be passed in
15
15
  #
16
16
  class Browserstack
17
- attr_reader :browser, :browserstack_options, :device_options
18
- private :browser, :browserstack_options, :device_options
17
+ attr_reader :browser, :browserstack_options, :device_options, :options
19
18
 
20
19
  # #### Initial setup options
21
20
  #
@@ -31,11 +30,15 @@ module AutomationHelpers
31
30
  # i.e. Windows_10_92 means run on Windows Operating System, OS Version 10, Browser Version 92
32
31
  # - :username (String) -> The username for Browserstack
33
32
  # - :api_key (String) -> The api key for Browserstack
34
- #
35
- def initialize(browser, browserstack_options, device_options = {})
33
+ # - **device_options** (optional) - A Hash of all device specific options that can customise your device
34
+ # - :device_name (String) -> The name of your device
35
+ # - :os_version (String) -> The operating system for your device
36
+ # - **options** (optional) -> You can instantiate an Options payload that can be used when registering your driver
37
+ def initialize(browser, browserstack_options, device_options = {}, options = Options.for(browser))
36
38
  @browser = browser
37
39
  @browserstack_options = browserstack_options
38
40
  @device_options = device_options
41
+ @options = options
39
42
  end
40
43
 
41
44
  # @return [Nil]
@@ -86,7 +89,7 @@ module AutomationHelpers
86
89
  {
87
90
  'bstack:options' => {
88
91
  'local' => 'false',
89
- 'seleniumVersion' => '4.0.0-alpha-6',
92
+ 'seleniumVersion' => '4.15.0',
90
93
  'consoleLogs' => 'verbose',
91
94
  'networkLogs' => 'true',
92
95
  'resolution' => '1920x1080'
@@ -104,10 +107,6 @@ module AutomationHelpers
104
107
  { 'browserVersion' => browser_version }
105
108
  end
106
109
 
107
- def options
108
- Options.for(browser)
109
- end
110
-
111
110
  def browserstack_hub_url
112
111
  "https://#{browserstack_options[:username]}:#{browserstack_options[:api_key]}@hub-cloud.browserstack.com/wd/hub"
113
112
  end
@@ -63,7 +63,7 @@ module AutomationHelpers
63
63
  'ie' => {
64
64
  # This is a minor hack until the IEDriver catches up and releases a V4 compliant copy
65
65
  # It is confirmed to be compliant with V4 selenium jars e.t.c.
66
- 'driver' => '3.141.59',
66
+ 'driver' => '4.14.0.0',
67
67
  'arch' => 'x32'
68
68
  }
69
69
  }
@@ -82,7 +82,8 @@ module AutomationHelpers
82
82
 
83
83
  def android_appium_version(android_version)
84
84
  case android_version.to_f
85
- when 12..; then '1.22.0'
85
+ when 14..; then '2.0.0'
86
+ when 12..; then '1.22.3'
86
87
  when 10..; then '1.21.0'
87
88
  when 9..; then '1.20.2'
88
89
  else raise ArgumentError, "Your Android Version is too low. Please don't use lower than Android Pie (9)."
@@ -91,7 +92,9 @@ module AutomationHelpers
91
92
 
92
93
  def ios_appium_version(ios_version)
93
94
  case ios_version.to_f
94
- when 14..; then '1.22.0'
95
+ when 16..; then '2.0.0'
96
+ when 15..; then '1.22.3'
97
+ when 14..; then '1.22.2'
95
98
  when 13..; then '1.21.0'
96
99
  when 12..; then '1.20.2'
97
100
  else raise ArgumentError, "Your iOS Version is too low. Please don't use lower than iOS 12."
@@ -11,15 +11,15 @@ module AutomationHelpers
11
11
  # The Local Driver that will spin up and run on your machine (Without connecting to any grid)
12
12
  #
13
13
  class Local
14
- attr_reader :browser
15
- private :browser
14
+ attr_reader :browser, :options
16
15
 
17
16
  # #### Initial setup options
18
17
  #
19
18
  # - **browser** (required) - When instantiating, the first argument must be the symbol that represents what browser to use
20
- #
21
- def initialize(browser)
19
+ # - **options** (optional) -> You can instantiate an Options payload that can be used when registering your driver
20
+ def initialize(browser, options = Options.for(browser))
22
21
  @browser = browser
22
+ @options = options
23
23
  end
24
24
 
25
25
  # @return [Nil]
@@ -48,10 +48,6 @@ module AutomationHelpers
48
48
  ::Selenium::WebDriver::Service.safari(args: ['--diagnose'])
49
49
  end
50
50
 
51
- def options
52
- Options.for(browser)
53
- end
54
-
55
51
  def safari?
56
52
  browser == :safari
57
53
  end
@@ -48,11 +48,7 @@ module AutomationHelpers
48
48
 
49
49
  # Constantly fire mouseOver events on click actions (Should help mitigate flaky clicks)
50
50
  def internet_explorer_options
51
- ::Selenium::WebDriver::IE::Options.new(persistent_hover: true).tap do |opts|
52
- # This can be removed once we migrate past Se4 proper (As the space version name is present there)
53
- AutomationHelpers.logger.info('Removing `browser_name` key from options payload.')
54
- opts.options.delete(:browser_name)
55
- end
51
+ ::Selenium::WebDriver::IE::Options.new(persistent_hover: true)
56
52
  end
57
53
 
58
54
  def headless?
@@ -11,16 +11,18 @@ module AutomationHelpers
11
11
  # This expects the grid to be live **and** accepting node requests
12
12
  #
13
13
  class Remote
14
- attr_reader :browser
15
- private :browser
14
+ attr_reader :browser, :options
16
15
 
17
16
  # #### Initial setup options
18
17
  #
19
18
  # - **browser** (required) - When instantiating, the first argument must be the symbol that represents what browser to use
19
+ # - **options** (optional) -> You can instantiate an Options payload that can be used when registering your driver
20
+ #
20
21
  # - **ENV["HUB_URL"]** (required) - The environment variable HUB_URL must be set to the actively running dockerized grid
21
22
  # (By default this should be +http://hub:4444/wd/hub+)
22
- def initialize(browser)
23
+ def initialize(browser, options = Options.for(browser))
23
24
  @browser = browser
25
+ @options = options
24
26
  end
25
27
 
26
28
  # @return [Nil]
@@ -45,12 +47,8 @@ module AutomationHelpers
45
47
  Capabilities.for(browser)
46
48
  end
47
49
 
48
- def options
49
- Options.for(browser)
50
- end
51
-
52
50
  def hub_url
53
- ENV.fetch('HUB_URL')
51
+ ENV.fetch('HUB_URL') { raise ArgumentError, 'Please set HUB_URL env key for your grid' }
54
52
  end
55
53
 
56
54
  def supported_browser?
@@ -26,7 +26,7 @@ module AutomationHelpers
26
26
  #
27
27
  module SafariTextPatch
28
28
  def text(type = nil, normalize_ws: ::Capybara.default_normalize_ws)
29
- super(type, normalize_ws: normalize_ws)
29
+ super
30
30
  end
31
31
  end
32
32
  end
@@ -11,6 +11,17 @@ module AutomationHelpers
11
11
 
12
12
  def description
13
13
  <<~DESCRIPTION
14
+ UPDATE: 3/12/2024
15
+ This patch should in theory be redundant now the root cause has been identified as a processing
16
+ debugger fault in RubyMine. Since Ruby 3.2 this should no longer be an issue providing you are
17
+ using an "up-to-date" RubyMine. I personally haven't encountered this issue for a couple of years
18
+
19
+ As such this patch is now considered a deprecated patch with a 1 year TTL, at which point we'll then
20
+ consider it for removal from the gem proper
21
+
22
+ ~~~~~~~~~~~~~~~~~~~~~
23
+
24
+ ORIGINAL ISSUE:
14
25
  When using the Selenium Logger that is set to pipe to a file, the Net::HTTP adapter (default),
15
26
  can return unencoded binary (confusingly called ASCII-8BIT in Ruby).
16
27
  Consequently we set the logger to binmode so it doesn't try to encode the data - this would always
@@ -20,6 +31,14 @@ module AutomationHelpers
20
31
  DESCRIPTION
21
32
  end
22
33
 
34
+ def deprecation_notice_date
35
+ Time.new(2025, 12, 3)
36
+ end
37
+
38
+ def prevent_usage_date
39
+ Time.new(2026, 12, 3)
40
+ end
41
+
23
42
  def perform
24
43
  ::Selenium::WebDriver.logger.io.binmode
25
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AutomationHelpers
4
- VERSION = '5.0.1'
4
+ VERSION = '5.2.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automation_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Hill
8
8
  - Marcelo Nicolosi Santos
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-01-29 00:00:00.000000000 Z
12
+ date: 2024-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">"
19
19
  - !ruby/object:Gem::Version
20
- version: '3.30'
20
+ version: '3.35'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '4'
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">"
29
29
  - !ruby/object:Gem::Version
30
- version: '3.30'
30
+ version: '3.35'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '4'
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '2.7'
60
+ version: '2.8'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '2.7'
67
+ version: '2.8'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: rspec
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -85,56 +85,56 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 1.60.2
88
+ version: 1.68.0
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 1.60.2
95
+ version: 1.68.0
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: rubocop-performance
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 1.19.0
102
+ version: 1.22.1
103
103
  type: :development
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 1.19.0
109
+ version: 1.22.1
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: rubocop-rspec
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 2.25.0
116
+ version: 3.0.0
117
117
  type: :development
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: 2.25.0
123
+ version: 3.0.0
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: selenium-webdriver
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '4.0'
130
+ version: '4.12'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '4.0'
137
+ version: '4.12'
138
138
  description: Automation Patches / Extensions that allow you to extend your Ruby-based
139
139
  testing frameworks
140
140
  email:
@@ -176,7 +176,7 @@ metadata:
176
176
  homepage_uri: https://www.github.com/site-prism/automation_helpers
177
177
  source_code_uri: https://www.github.com/site-prism/automation_helpers
178
178
  changelog_uri: https://www.github.com/site-prism/automation_helpers/blob/main/CHANGELOG.md
179
- post_install_message:
179
+ post_install_message:
180
180
  rdoc_options: []
181
181
  require_paths:
182
182
  - lib
@@ -189,10 +189,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  requirements:
190
190
  - - ">="
191
191
  - !ruby/object:Gem::Version
192
- version: '0'
192
+ version: 3.2.3
193
193
  requirements: []
194
- rubygems_version: 3.2.33
195
- signing_key:
194
+ rubygems_version: 3.5.22
195
+ signing_key:
196
196
  specification_version: 4
197
197
  summary: Automation Helpers - Avoid writing the most common things in Ruby Automation
198
198
  test_files: []