testcentricity_web 3.2.19 → 3.2.24

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: 49bd540fc3640911174f5136c1121cafac4b9570caac7c2952933a8cae93416e
4
- data.tar.gz: a55bec7ca5d41d7d450e1be084ed5001964faf628c9932d3eba589905bd38a29
3
+ metadata.gz: b21c47393a41751840d0332d9e2cda05a195da105ed77a420a08f8e5355d1b0a
4
+ data.tar.gz: f1ab14a2692cb98a1034d854640720b7f0286aca92a6ac7bb75759fc0d357fb2
5
5
  SHA512:
6
- metadata.gz: e2eec6f5ef186f695380ab0825e303e14f16192d20e0db1fb167efce006c4fed80611c211b672be98008718eb9be531f2b04399302497afc499baede6cebdbc4
7
- data.tar.gz: 845b302672ac27209aa91ddf869fed432fc9fa4ccab63c5608fd6437eef25d67e194453fbddd24c9410978456bdebb4e3af0740308cbe9ebb29aecf9c69485a4
6
+ metadata.gz: 5853adc39458b0deff3af6ee1e72146ce459a554f76beeea276131b666d4344b4d5630b95c76644db8e57d3576bff18502c6a0561480203d3fc33299b640a2f7
7
+ data.tar.gz: 8614c1ff61a143bc2e83a499958143513dcd1b8abd33aa39539ef445f85ee6517e5453133719465d51541cff68f247df55b5259d047080d904e68eb3b1f629a4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,32 @@
1
1
  # CHANGELOG
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+
5
+ ## [3.2.23] - 11-FEB-2021
6
+
7
+ ### Changed
8
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to allow `:translate_upcase`,
9
+ `:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions to fall back to `:en` default
10
+ locale if translated strings are missing from the current locale specified in `I18n.locale`.
11
+
12
+ ## [3.2.22] - 09-FEB-2021
13
+
14
+ ### Fixed
15
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to correctly handle `:translate_upcase`,
16
+ `:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions for Arrays of `String`.
17
+
18
+ ## [3.2.21] - 04-FEB-2021
19
+
20
+ ### Changed
21
+ * `UIElement.hover_at` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
22
+ visible.
23
+
24
+ ## [3.2.20] - 21-JAN-2021
25
+
26
+ ### Changed
27
+ * `UIElement.hover` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
28
+ visible.
29
+
4
30
  ## [3.2.19] - 05-JAN-2021
5
31
 
6
32
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.2.19)
4
+ testcentricity_web (3.2.24)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -21,58 +21,60 @@ GEM
21
21
  specs:
22
22
  addressable (2.7.0)
23
23
  public_suffix (>= 2.0.2, < 5.0)
24
- appium_lib (10.6.0)
25
- appium_lib_core (~> 3.3)
24
+ appium_lib (11.2.0)
25
+ appium_lib_core (~> 4.1)
26
26
  nokogiri (~> 1.8, >= 1.8.1)
27
27
  tomlrb (~> 1.1)
28
- appium_lib_core (3.10.0)
29
- faye-websocket (~> 0.10.0)
28
+ appium_lib_core (4.4.1)
29
+ faye-websocket (~> 0.11.0)
30
30
  selenium-webdriver (~> 3.14, >= 3.14.1)
31
31
  axiom-types (0.1.1)
32
32
  descendants_tracker (~> 0.0.4)
33
33
  ice_nine (~> 0.11.0)
34
34
  thread_safe (~> 0.3, >= 0.3.1)
35
35
  browserstack-local (1.3.0)
36
- capybara (3.32.2)
36
+ capybara (3.35.3)
37
37
  addressable
38
38
  mini_mime (>= 0.1.3)
39
39
  nokogiri (~> 1.8)
40
40
  rack (>= 1.6.0)
41
41
  rack-test (>= 0.6.3)
42
- regexp_parser (~> 1.5)
42
+ regexp_parser (>= 1.5, < 3.0)
43
43
  xpath (~> 3.2)
44
44
  childprocess (0.9.0)
45
45
  ffi (~> 1.0, >= 1.0.11)
46
46
  chronic (0.10.2)
47
47
  coercible (1.0.0)
48
48
  descendants_tracker (~> 0.0.1)
49
- concurrent-ruby (1.1.6)
49
+ concurrent-ruby (1.1.8)
50
50
  descendants_tracker (0.0.4)
51
51
  thread_safe (~> 0.3, >= 0.3.1)
52
52
  equalizer (0.0.11)
53
53
  eventmachine (1.2.7)
54
- faker (2.12.0)
54
+ faker (2.16.0)
55
55
  i18n (>= 1.6, < 2)
56
- faye-websocket (0.10.9)
56
+ faye-websocket (0.11.0)
57
57
  eventmachine (>= 0.12.0)
58
58
  websocket-driver (>= 0.5.1)
59
- ffi (1.13.1)
60
- i18n (1.8.3)
59
+ ffi (1.14.2)
60
+ i18n (1.8.9)
61
61
  concurrent-ruby (~> 1.0)
62
62
  ice_nine (0.11.2)
63
63
  mini_mime (1.0.2)
64
- mini_portile2 (2.4.0)
65
- nokogiri (1.10.9)
66
- mini_portile2 (~> 2.4.0)
67
- os (1.1.0)
68
- power_assert (1.2.0)
69
- public_suffix (4.0.5)
64
+ mini_portile2 (2.5.0)
65
+ nokogiri (1.11.1)
66
+ mini_portile2 (~> 2.5.0)
67
+ racc (~> 1.4)
68
+ os (1.1.1)
69
+ power_assert (2.0.0)
70
+ public_suffix (4.0.6)
71
+ racc (1.5.2)
70
72
  rack (2.2.3)
71
73
  rack-test (1.1.0)
72
74
  rack (>= 1.0, < 3)
73
75
  rake (13.0.1)
74
76
  redcarpet (3.5.0)
75
- regexp_parser (1.7.1)
77
+ regexp_parser (2.1.0)
76
78
  ruby-ole (1.2.12.2)
77
79
  rubyzip (2.3.0)
78
80
  selenium-webdriver (3.142.7)
@@ -80,7 +82,7 @@ GEM
80
82
  rubyzip (>= 1.2.2)
81
83
  spreadsheet (1.1.7)
82
84
  ruby-ole (>= 1.0)
83
- test-unit (3.3.6)
85
+ test-unit (3.4.0)
84
86
  power_assert
85
87
  thread_safe (0.3.6)
86
88
  tomlrb (1.3.0)
@@ -89,11 +91,11 @@ GEM
89
91
  coercible (~> 1.0)
90
92
  descendants_tracker (~> 0.0, >= 0.0.3)
91
93
  equalizer (~> 0.0, >= 0.0.9)
92
- webdrivers (4.4.1)
94
+ webdrivers (4.5.0)
93
95
  nokogiri (~> 1.6)
94
96
  rubyzip (>= 1.3.0)
95
97
  selenium-webdriver (>= 3.0, < 4.0)
96
- websocket-driver (0.7.2)
98
+ websocket-driver (0.7.3)
97
99
  websocket-extensions (>= 0.1.0)
98
100
  websocket-extensions (0.1.5)
99
101
  xpath (3.2.0)
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2020, Tony Mrozinski
1
+ Copyright (c) 2014-2021, Tony Mrozinski
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -1673,7 +1673,7 @@ landscape orientation running on the BrowserStack service:
1673
1673
 
1674
1674
  ## Copyright and License
1675
1675
 
1676
- TestCentricity™ Framework is Copyright (c) 2014-2020, Tony Mrozinski.
1676
+ TestCentricity™ Framework is Copyright (c) 2014-2021, Tony Mrozinski.
1677
1677
  All rights reserved.
1678
1678
 
1679
1679
  Redistribution and use in source and binary forms, with or without
@@ -58,8 +58,12 @@ module TestCentricity
58
58
  attr_accessor :user_id
59
59
  attr_accessor :password
60
60
  attr_accessor :append
61
+ attr_accessor :app_id
62
+ attr_accessor :api_key
61
63
  attr_accessor :option1
62
64
  attr_accessor :option2
65
+ attr_accessor :option3
66
+ attr_accessor :option4
63
67
  attr_accessor :dns
64
68
  attr_accessor :db_username
65
69
  attr_accessor :db_password
@@ -71,8 +75,12 @@ module TestCentricity
71
75
  @user_id = data['USER_ID']
72
76
  @password = data['PASSWORD']
73
77
  @append = data['APPEND']
78
+ @app_id = data['APP_ID']
79
+ @api_key = data['API_KEY']
74
80
  @option1 = data['OPTIONAL_1']
75
81
  @option2 = data['OPTIONAL_2']
82
+ @option3 = data['OPTIONAL_3']
83
+ @option4 = data['OPTIONAL_4']
76
84
  @dns = data['DNS']
77
85
  @db_username = data['DB_USERNAME']
78
86
  @db_password = data['DB_PASSWORD']
@@ -76,20 +76,31 @@ module TestCentricity
76
76
  expected = expected.downcase
77
77
  enqueue_exception("#{error_msg} be like '#{value}' but found '#{actual}'") unless actual_like.include?(expected)
78
78
  when :translate
79
- expected = I18n.t(value)
79
+ expected = translate(value)
80
80
  enqueue_assert_equal(expected, actual, error_msg)
81
81
  when :translate_upcase
82
- expected = I18n.t(value).upcase
82
+ expected = translate(value)
83
+ expected = expected.is_a?(Array) ? expected.map(&:upcase) : expected.upcase
83
84
  enqueue_assert_equal(expected, actual, error_msg)
84
85
  when :translate_downcase
85
- expected = I18n.t(value).downcase
86
+ expected = translate(value)
87
+ expected = expected.is_a?(Array) ? expected.map(&:downcase) : expected.downcase
86
88
  enqueue_assert_equal(expected, actual, error_msg)
87
89
  when :translate_capitalize
88
- expected = I18n.t(value).capitalize
90
+ expected = translate(value)
91
+ expected = expected.is_a?(Array) ? expected.map(&:capitalize) : expected.capitalize
89
92
  enqueue_assert_equal(expected, actual, error_msg)
90
93
  when :translate_titlecase
91
- expected = I18n.t(value)
92
- expected = "#{expected.split.each{ |expected| expected.capitalize! }.join(' ')}"
94
+ expected = translate(value)
95
+ expected = if expected.is_a?(Array)
96
+ result = []
97
+ expected.each do |item|
98
+ result.push("#{item.split.each{ |item| item.capitalize! }.join(' ')}")
99
+ end
100
+ result
101
+ else
102
+ "#{expected.split.each{ |expected| expected.capitalize! }.join(' ')}"
103
+ end
93
104
  enqueue_assert_equal(expected, actual, error_msg)
94
105
  end
95
106
  end
@@ -126,6 +137,29 @@ module TestCentricity
126
137
  screen_shot = {path: path, filename: filename}
127
138
  Environ.save_screen_shot(screen_shot)
128
139
  end
140
+
141
+ def self.translate(*args, **opts)
142
+ opts[:locale] ||= I18n.locale
143
+ opts[:raise] = true
144
+ I18n.translate(*args, **opts)
145
+ rescue I18n::MissingTranslationData => err
146
+ puts err
147
+ opts[:locale] = :en
148
+
149
+ # fallback to en if the translation is missing. If the translation isn't
150
+ # in en, then raise again.
151
+ disable_enforce_available_locales do
152
+ I18n.translate(*args, **opts)
153
+ end
154
+ end
155
+
156
+ def self.disable_enforce_available_locales
157
+ saved_enforce_available_locales = I18n.enforce_available_locales
158
+ I18n.enforce_available_locales = false
159
+ yield
160
+ ensure
161
+ I18n.enforce_available_locales = saved_enforce_available_locales
162
+ end
129
163
  end
130
164
 
131
165
 
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.2.19'
2
+ VERSION = '3.2.24'
3
3
  end
@@ -68,7 +68,7 @@ module TestCentricity
68
68
 
69
69
  unless @options_list.nil?
70
70
  find_component(@options_list, 'drop menu')
71
- raise "Could not find option #{option} to choose" unless first(:css, @list_item, minimum: 0, wait: 2)
71
+ raise "Could not find option #{option} to choose" unless first(:css, @list_item, minimum: 0, wait: 5)
72
72
 
73
73
  if option.is_a?(Array)
74
74
  option.each do |item|
@@ -528,11 +528,17 @@ module TestCentricity
528
528
 
529
529
  # Hover the cursor over an object
530
530
  #
531
+ # @param visible [Boolean, Symbol] Only find elements with the specified visibility:
532
+ # * true - only finds visible elements.
533
+ # * false - finds invisible _and_ visible elements.
534
+ # * :all - same as false; finds visible and invisible elements.
535
+ # * :hidden - only finds invisible elements.
536
+ # * :visible - same as true; only finds visible elements.
531
537
  # @example
532
538
  # basket_link.hover
533
539
  #
534
- def hover
535
- obj, type = find_element
540
+ def hover(visible = true)
541
+ obj, type = find_element(visible)
536
542
  object_not_found_exception(obj, type)
537
543
  obj.hover
538
544
  end
@@ -541,11 +547,17 @@ module TestCentricity
541
547
  #
542
548
  # @param x [Integer] X offset
543
549
  # @param y [Integer] Y offset
550
+ # @param visible [Boolean, Symbol] Only find elements with the specified visibility:
551
+ # * true - only finds visible elements.
552
+ # * false - finds invisible _and_ visible elements.
553
+ # * :all - same as false; finds visible and invisible elements.
554
+ # * :hidden - only finds invisible elements.
555
+ # * :visible - same as true; only finds visible elements.
544
556
  # @example
545
557
  # timeline_bar.hover_at(100, 5)
546
558
  #
547
- def hover_at(x, y)
548
- obj, = find_element
559
+ def hover_at(x, y, visible = true)
560
+ obj, = find_element(visible)
549
561
  raise "UI #{object_ref_message} not found" unless obj
550
562
  obj.hover_at(x, y)
551
563
  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: 3.2.19
4
+ version: 3.2.24
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: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler