testcentricity_web 2.1.4 → 2.1.5

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: 65e991805e4626405ada3d8f1f2e1425ae0ef630
4
- data.tar.gz: 8f2993072a8cabc5be0c3f75a7fe8105fde19ef0
3
+ metadata.gz: 87663c5bf2b489f6b8b624797df52dfb06f43a36
4
+ data.tar.gz: 6c4139cd5248576b327554b4e5ed6f518023e805
5
5
  SHA512:
6
- metadata.gz: eb5e46838887ac2bec5243f48a90210ed1ebaa2df4fbb319b383d2bc6b3789d3ba650af35c155abf498514df1e3ab2869cfba9b4c1219684c4486dea2be46290
7
- data.tar.gz: e4b9e4ab6631200c3746cc78eeee404527389a29437d7cc42602e3db301b09c1b0e30bd250185b420a2a4177b4ed9fce2e63cd79e74e567ba410cd5eeb4414d1
6
+ metadata.gz: 3937f1e4f5bf5dee68bc63b67a91b791a069fa13e8a2cc1780c004993285f2c7b558cac4377c3bc4e76c87d3d86fe94706a52cd548bfcc16cf894cdac1d2a012
7
+ data.tar.gz: a008ca6d6ca2f6489888024c99bbfdb06806301649d198a9b78c2de4abc1ae1f0cb7506ec67f77178278cc775a931bad5a38e23330bb39001b55df198a525c9b
data/README.md CHANGED
@@ -23,9 +23,19 @@ feature incomplete and potentially unstable. More information can be found [here
23
23
 
24
24
 
25
25
  ## What's New
26
+ ###Version 2.1.5
27
+
28
+ * Fixed Chrome and Firefox support for setting browser language via the `LOCALE` Environment Variable. This capability now works for emulated mobile
29
+ browsers hosted in a local instance of Chrome or Firefox.
30
+
31
+ * Added `get_min`, `get_max`, and `get_step` methods to `TextField` class.
32
+
33
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `min`, `max`, and `step` attributes
34
+ for textfields.
35
+
26
36
  ###Version 2.1.4
27
37
 
28
- * Added suppression of the Info Bar on locally hosted instances of the Chrome browser.
38
+ * Added suppression of the Info Bar that displays "Chrome is being controlled by automated test software" on locally hosted instances of the Chrome browser.
29
39
 
30
40
 
31
41
  ###Version 2.1.3
@@ -41,5 +41,44 @@ module TestCentricity
41
41
  object_not_found_exception(obj, nil)
42
42
  obj.native.attribute('placeholder')
43
43
  end
44
+
45
+ # Return min attribute of a number type text field.
46
+ #
47
+ # @return [Integer]
48
+ # @example
49
+ # min_points_value = points_field.get_min
50
+ #
51
+ def get_min
52
+ obj, = find_element
53
+ object_not_found_exception(obj, nil)
54
+ min = obj.native.attribute('min')
55
+ min.to_i unless min.blank?
56
+ end
57
+
58
+ # Return max attribute of a number type text field.
59
+ #
60
+ # @return [Integer]
61
+ # @example
62
+ # max_points_value = points_field.get_max
63
+ #
64
+ def get_max
65
+ obj, = find_element
66
+ object_not_found_exception(obj, nil)
67
+ max = obj.native.attribute('max')
68
+ max.to_i unless max.blank?
69
+ end
70
+
71
+ # Return step attribute of a number type text field.
72
+ #
73
+ # @return [Integer]
74
+ # @example
75
+ # points_step = points_field.get_step
76
+ #
77
+ def get_step
78
+ obj, = find_element
79
+ object_not_found_exception(obj, nil)
80
+ step = obj.native.attribute('step')
81
+ step.to_i unless step.blank?
82
+ end
44
83
  end
45
84
  end
@@ -504,6 +504,12 @@ module TestCentricity
504
504
  actual = ui_object.get_column_count
505
505
  when :placeholder
506
506
  actual = ui_object.get_placeholder
507
+ when :min
508
+ actual = ui_object.get_min
509
+ when :max
510
+ actual = ui_object.get_max
511
+ when :step
512
+ actual = ui_object.get_step
507
513
  when :options, :items, :list_items
508
514
  actual = ui_object.get_list_items
509
515
  when :optioncount, :itemcount
@@ -620,6 +620,12 @@ module TestCentricity
620
620
  actual = ui_object.get_column_count
621
621
  when :placeholder
622
622
  actual = ui_object.get_placeholder
623
+ when :min
624
+ actual = ui_object.get_min
625
+ when :max
626
+ actual = ui_object.get_max
627
+ when :step
628
+ actual = ui_object.get_step
623
629
  when :options, :items, :list_items
624
630
  actual = ui_object.get_list_items
625
631
  when :optioncount, :itemcount
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.1.4'
2
+ VERSION = '2.1.5'
3
3
  end
@@ -70,13 +70,13 @@ module TestCentricity
70
70
  end
71
71
  # set WebDriver path based on browser and operating system
72
72
  case ENV['WEB_BROWSER'].downcase.to_sym
73
- when :chrome
74
- if OS.osx?
75
- path_to_driver = 'mac/chromedriver'
76
- elsif OS.windows?
77
- path_to_driver = 'windows/chromedriver.exe'
78
- end
79
- Selenium::WebDriver::Chrome.driver_path = File.join(project_path, base_path, path_to_driver)
73
+ # when :firefox
74
+ # if OS.osx?
75
+ # path_to_driver = 'mac/geckodriver'
76
+ # elsif OS.windows?
77
+ # path_to_driver = 'windows/geckodriver.exe'
78
+ # end
79
+ # Selenium::WebDriver::Firefox.driver_path = File.join(project_path, base_path, path_to_driver)
80
80
  when :ie
81
81
  path_to_driver = 'windows/IEDriverServer.exe'
82
82
  Selenium::WebDriver::IE.driver_path = File.join(project_path, base_path, path_to_driver)
@@ -151,8 +151,22 @@ module TestCentricity
151
151
  Capybara.default_driver = :selenium
152
152
  Capybara.register_driver :selenium do |app|
153
153
  case browser.downcase.to_sym
154
- when :firefox, :chrome, :ie, :safari, :edge
154
+ when :ie, :safari, :edge
155
155
  Capybara::Selenium::Driver.new(app, :browser => browser.to_sym)
156
+
157
+ when :firefox
158
+ if ENV['LOCALE']
159
+ profile = Selenium::WebDriver::Firefox::Profile.new
160
+ profile['intl.accept_languages'] = ENV['LOCALE']
161
+ Capybara::Selenium::Driver.new(app, :profile => profile)
162
+ else
163
+ Capybara::Selenium::Driver.new(app, :browser => :firefox)
164
+ end
165
+
166
+ when :chrome
167
+ ENV['LOCALE'] ? args = ['--disable-infobars', "--lang=#{ENV['LOCALE']}"] : args = ['--disable-infobars']
168
+ Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args)
169
+
156
170
  else
157
171
  user_agent = Browsers.mobile_device_agent(browser)
158
172
  ENV['HOST_BROWSER'] ? host_browser = ENV['HOST_BROWSER'].downcase.to_sym : host_browser = :firefox
@@ -162,15 +176,12 @@ module TestCentricity
162
176
  profile['general.useragent.override'] = user_agent
163
177
  profile['intl.accept_languages'] = ENV['LOCALE'] if ENV['LOCALE']
164
178
  Capybara::Selenium::Driver.new(app, :profile => profile)
179
+
165
180
  when :chrome
166
- args = ["--user-agent='#{user_agent}'", '--disable-infobars']
167
- if ENV['LOCALE']
168
- profile = Selenium::WebDriver::Chrome::Profile.new
169
- profile['intl.accept_languages'] = ENV['LOCALE']
170
- Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args, :profile => profile)
171
- else
172
- Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args)
173
- end
181
+ ENV['LOCALE'] ?
182
+ args = ["--user-agent='#{user_agent}'", "--lang=#{ENV['LOCALE']}", '--disable-infobars'] :
183
+ args = ["--user-agent='#{user_agent}'", '--disable-infobars']
184
+ Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args)
174
185
  end
175
186
  end
176
187
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2017-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler