testcentricity_web 4.0.3 → 4.1.0

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
  SHA256:
3
- metadata.gz: d93f63b0f93fc833deb465d8588ef93e30db5b171929da48ef8e4449450b8c7a
4
- data.tar.gz: 1a73bbf1521c29b0b80ca2163461795cb24e24f65107c671b5aa581b17c55d20
3
+ metadata.gz: 8fdb6f0dda3633c2c5419bf6477bb60131814db02ece30fba81ca20dc0738a26
4
+ data.tar.gz: 7503ad522b8bcaa9e1befd791ca3d7ef6ca13728963e0a8a1d4ef11b93973c02
5
5
  SHA512:
6
- metadata.gz: a250df9034b5246bc99bc9f395d8b461405a5900302814069afd1a50528bc773ba3842e53ab1b2f85fd216522f0b758a533077bfa0ec360edc25570dc6bdd02c
7
- data.tar.gz: 856f31ba5173274eaec57ac27806a3308e939245c43fc21d5a05e62a959aece056db237b2cb5fbc67275ee6ce1edfe44eb146a0c6d3c2da40339336aa101ceba
6
+ metadata.gz: bd7f80d554ff6f37988a9531d3be6a6ca5f9db61c77ba6acb3c49634cb8b0a87bf9952ccd1eb5dbbebfa56ce511193dcbdd462fc90d4b9ac27352d570f0a0cf7
7
+ data.tar.gz: a7c7249a9042a327208d275be92a42465322984afdba99df2ea3dd9e9755a9a6cb311486bf618d2c3fa5306ce38d42e6d79d4d81c0a71d677879c39749910baa
data/CHANGELOG.md CHANGED
@@ -1,6 +1,24 @@
1
1
  # CHANGELOG
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [4.1.0] - 28-FEB-2022
5
+
6
+ ### Added
7
+ * TestCentricity now supports and integrates with Selenium-Webdriver version 4.1.
8
+ * Added support for locally hosted Microsoft Edge desktop web browsers, including in `headless` mode.
9
+ * Added `CheckBox.define_custom_elements` and `Radio.define_custom_elements` methods to support abstracted UI implementations
10
+ where the `input type="checkbox"` or `input type="radio"` object is hidden or obscured by a proxy object, typically a `label`.
11
+ * Added support for `shutdownOtherSimulators` and `forceSimulatorSoftwareKeyboardPresence` capabilities for iOS simulators
12
+ when testing with Mobile Safari browser on iOS Simulators.
13
+
14
+ ### Changed
15
+ * `checkbox` and `radio` methods no longer accept an optional `proxy`. Calling the `checkbox` or `radio` methods with a `proxy`
16
+ parameter will result in a `wrong number of arguments (given 3, expected 2) (ArgumentError)` exception. Use the `define_custom_elements`
17
+ method to specify the locator for an associated `proxy` and/or `label` element. The `define_custom_elements` method can be
18
+ called from an `initialize` method for the `PageObject` or `PageSection` where the `checkbox` or `radio` is instantiated.
19
+ * Ruby version 2.7 or greater required.
20
+
21
+
4
22
  ## [4.0.3] - 30-DEC-2021
5
23
 
6
24
  ### Changed
@@ -9,6 +27,7 @@ All notable changes to this project will be documented in this file.
9
27
  ### Fixed
10
28
  * No longer throws a `NoMethodError: undefined method 'World' for main:Object` error when using RSpec.
11
29
 
30
+
12
31
  ## [4.0.0] - 18-APR-2021
13
32
 
14
33
  ### Changed
@@ -39,17 +58,20 @@ All notable changes to this project will be documented in this file.
39
58
  * `UIElement.invoke_siebel_popup`
40
59
  * `UIElement.get_siebel_object_type`
41
60
 
61
+
42
62
  ## [3.3.0] - 14-MAR-2021
43
63
 
44
64
  ### Fixed
45
65
  * `WebDriverConnect.initialize_web_driver` method now correctly sets local Chrome browser Download directory when running
46
66
  with headless Chrome.
47
67
 
68
+
48
69
  ## [3.2.25] - 11-MAR-2021
49
70
 
50
71
  ### Added
51
72
  * Added `String.titlecase` method.
52
73
 
74
+
53
75
  ## [3.2.23] - 11-FEB-2021
54
76
 
55
77
  ### Changed
@@ -57,35 +79,41 @@ with headless Chrome.
57
79
  `:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions to fall back to `:en` default
58
80
  locale if translated strings are missing from the current locale specified in `I18n.locale`.
59
81
 
82
+
60
83
  ## [3.2.22] - 09-FEB-2021
61
84
 
62
85
  ### Fixed
63
86
  * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to correctly handle `:translate_upcase`,
64
87
  `:translate_downcase`, `:translate_capitalize`, and `:translate_titlecase` conversions for Arrays of `String`.
65
88
 
89
+
66
90
  ## [3.2.21] - 04-FEB-2021
67
91
 
68
92
  ### Changed
69
93
  * `UIElement.hover_at` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
70
94
  visible.
71
95
 
96
+
72
97
  ## [3.2.20] - 21-JAN-2021
73
98
 
74
99
  ### Changed
75
100
  * `UIElement.hover` method now accepts an optional `visible` parameter to allow hovering over UI elements that are not
76
101
  visible.
77
102
 
103
+
78
104
  ## [3.2.19] - 05-JAN-2021
79
105
 
80
106
  ### Fixed
81
107
  * `SelectList.choose_option` and `SelectList.get_options` methods now wait up to 5 seconds for list drop menu to appear.
82
108
 
109
+
83
110
  ## [3.2.18] - 12-AUG-2020
84
111
 
85
112
  ### Fixed
86
113
  * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to correctly handle `:row`, `:column`,
87
114
  `:cell`, `:item`, and `:attribute` properties.
88
115
 
116
+
89
117
  ## [3.2.17] - 19-JUNE-2020
90
118
 
91
119
  ### Changed
@@ -93,28 +121,33 @@ visible.
93
121
  * Updated `Table.get_row_count`, `Table.get_column_count`, and `Table.get_table_cell_locator` methods to support tables
94
122
  with row headers in row #1.
95
123
 
124
+
96
125
  ## [3.2.16] - 13-MAY-2020
97
126
 
98
127
  ### Changed
99
128
  * `WebDriverConnect.initialize_web_driver` method now sets local Chrome and Firefox browser Download directory to separate
100
129
  folders for each parallel test thread when using `parallel_tests` gem to run tests in concurrent threads.
101
130
 
131
+
102
132
  ## [3.2.15] - 06-APR-2020
103
133
 
104
134
  ### Fixed
105
135
  * `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods accept `String` or `Boolean` values
106
136
  for checkboxes and radio buttons.
107
137
 
138
+
108
139
  ## [3.2.14] - 06-APR-2020
109
140
 
110
141
  ### Added
111
142
  * Added `UIElement.scroll_to` method.
112
143
 
144
+
113
145
  ## [3.2.13] - 24-MAR-2020
114
146
 
115
147
  ### Added
116
148
  * Added `PageObject.send_keys` method.
117
149
 
150
+
118
151
  ## [3.2.12] - 11-MAR-2020
119
152
 
120
153
  ### Added
@@ -122,26 +155,31 @@ for checkboxes and radio buttons.
122
155
  * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the
123
156
  `focused` property.
124
157
 
158
+
125
159
  ## [3.2.11] - 10-MAR-2020
126
160
 
127
161
  ### Added
128
162
  * Added `PageSection.verify_focus_order` method.
129
163
 
164
+
130
165
  ## [3.2.10] - 09-MAR-2020
131
166
 
132
167
  ### Added
133
168
  * Added `PageObject.verify_focus_order` method.
134
169
 
170
+
135
171
  ## [3.2.9] - 12-FEB-2020
136
172
 
137
173
  ### Fixed
138
174
  * Fixed `UIElement.wait_until_value_is`, `List.wait_until_item_count_is`, and `Table.wait_until_row_count_is`' methods.
139
175
 
176
+
140
177
  ## [3.2.8] - 08-FEB-2020
141
178
 
142
179
  ### Fixed
143
180
  * Fixed `UIElement.visible?` method that was broken in release 3.2.7.
144
181
 
182
+
145
183
  ## [3.2.7] - 05-FEB-2020
146
184
 
147
185
  ### Added
@@ -151,11 +189,13 @@ for checkboxes and radio buttons.
151
189
  * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the
152
190
  `crossorigin`, `preload`, and `poster` properties.
153
191
 
192
+
154
193
  ## [3.2.6] - 31-JAN-2020
155
194
 
156
195
  ### Changed
157
196
  * `Audio.volume` and `Video.volume` methods now return a `Float`.
158
197
 
198
+
159
199
  ## [3.2.5] - 25-JAN-2020
160
200
 
161
201
  ### Added
@@ -166,11 +206,13 @@ for checkboxes and radio buttons.
166
206
  ### Fixed
167
207
  * Fixed `UIElement.aria_multiselectable?` method.
168
208
 
209
+
169
210
  ## [3.2.4] - 16-JAN-2020
170
211
 
171
212
  ### Added
172
213
  * Added `Range` type `UIElement` to support interaction with and verification of HTML5 Input Range Slider Objects.
173
214
 
215
+
174
216
  ## [3.2.3] - 29-DEC-2019
175
217
 
176
218
  ### Added
@@ -203,6 +245,7 @@ properties:
203
245
  * `aria_multiselectable`
204
246
  * `aria_controls`
205
247
 
248
+
206
249
  ## [3.2.2] - 16-OCT-2019
207
250
 
208
251
  ### Added
@@ -212,6 +255,7 @@ properties:
212
255
  * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `indeterminate` property.
213
256
  * Updated device profiles for iPad Pro 12.9" 3rd Generation (iOS 13.1) with Mobile Safari browser.
214
257
 
258
+
215
259
  ## [3.2.1] - 03-OCT-2019
216
260
 
217
261
  ### Changed
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2021, Tony Mrozinski
1
+ Copyright (c) 2014-2022, 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
@@ -4,14 +4,14 @@
4
4
 
5
5
 
6
6
  The TestCentricity™ Web core generic framework for desktop and mobile web browser-based app testing implements a Page Object and Data
7
- Object Model DSL for use with Cucumber, Capybara (version 3.x), and Selenium-Webdriver (version 3.x).
7
+ Object Model DSL for use with Cucumber, Capybara (version 3.x), and Selenium-Webdriver (version 4.1).
8
8
 
9
9
  **An example project that demonstrates the implementation of a page object model framework using Cucumber and TestCentricity™ can be found [here](https://github.com/TestCentricity/tc_web_sample).**
10
10
 
11
11
  The TestCentricity™ Web gem supports running automated tests against the following web test targets:
12
- * locally hosted desktop browsers (Firefox, Chrome, Safari, or IE)
12
+ * locally hosted desktop browsers (Firefox, Chrome, Edge, Safari, or IE)
13
13
  * locally hosted emulated iOS Mobile Safari, Android, Windows Phone, or Blackberry mobile browsers (running within a local instance of Chrome)
14
- * locally hosted "headless" Chrome or Firefox browsers
14
+ * locally hosted "headless" Chrome, Firefox, or Edge browsers
15
15
  * desktop and emulated mobile web browsers hosted on Selenium Grid and Dockerized Selenium Grid environments
16
16
  * mobile Safari browsers on iOS device simulators or physical iOS devices (using Appium and XCode on OS X)
17
17
  * mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on OS X)
@@ -727,11 +727,11 @@ To use these **PageManager** methods, include the step definitions and code belo
727
727
 
728
728
  ## Connecting to a Web Browser
729
729
 
730
- The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures the appropriate Selenium-Webdriver capabilities required to establish a
731
- connection with a target web browser, and sets the base host URL of the web site you are running your tests against.
730
+ The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures the appropriate Selenium-Webdriver capabilities required to
731
+ establish a connection with a target web browser, and sets the base host URL of the web site you are running your tests against.
732
732
 
733
- The `TestCentricity::WebDriverConnect.initialize_web_driver` method accepts a single optional parameter - the base host URL. Cucumber **Environment
734
- Variables** are used to specify the target local or remote web browser, and the various webdriver capability parameters required to configure
733
+ The `TestCentricity::WebDriverConnect.initialize_web_driver` method accepts a single optional parameter - the base host URL. Cucumber
734
+ **Environment Variables** are used to specify the target local or remote web browser, and the various webdriver capability parameters required to configure
735
735
  the connection.
736
736
 
737
737
 
@@ -746,6 +746,8 @@ values from the table below:
746
746
  `chrome_headless` | OS X or Windows (headless - no visible UI)
747
747
  `firefox` | OS X or Windows (Firefox version 55 or greater only)
748
748
  `firefox_headless` | OS X or Windows (headless - no visible UI)
749
+ `edge` | OS X or Windows
750
+ `edge_headless` | OS X or Windows (headless - no visible UI)
749
751
  `safari` | OS X only
750
752
  `ie` | Windows only (IE version 10.x or greater only)
751
753
 
@@ -947,6 +949,8 @@ Once your test environment is properly configured, the following **Environment V
947
949
  `LANGUAGE` | [Optional] Language to set for the simulator. e.g. `fr`
948
950
  `ORIENTATION` | [Optional] Set to `portrait` or `landscape` (only for iOS simulators)
949
951
  `NEW_COMMAND_TIMEOUT` | [Optional] Time (in Seconds) that Appium will wait for a new command from the client
952
+ `SHOW_SIM_KEYBOARD` | [Optional] Show the simulator keyboard during text entry. Set to `true` or `false`
953
+ `SHUTDOWN_OTHER_SIMS`| [Optional] Close any other running simulators. Set to `true` or `false`
950
954
 
951
955
 
952
956
  ### Mobile Chrome or Android browsers on Android Studio Virtual Device emulators
@@ -989,7 +993,7 @@ Sauce Labs, TestingBot, Gridlastic, or LambdaTest services. If your tests are ru
989
993
  #### Remote desktop browsers on the BrowserStack service
990
994
 
991
995
  For remotely hosted desktop web browsers on the BrowserStack service, the following **Environment Variables** must be set as described in
992
- the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities)
996
+ the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities?tag=selenium-4)
993
997
  for information regarding the specific capabilities.
994
998
 
995
999
  **Environment Variable** | **Description**
@@ -1003,15 +1007,13 @@ for information regarding the specific capabilities.
1003
1007
  `BS_VERSION` | [Optional] Refer to `browser_version` capability in chart. If not specified, latest stable version of browser will be used.
1004
1008
  `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`). If `true`, the BrowserStack Local instance will be automatically started.
1005
1009
  `RESOLUTION` | [Optional] Refer to supported screen `resolution` capability in chart
1006
- `BROWSER_SIZE` | [Optional] Specify width, height of browser window
1007
1010
  `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
1008
1011
  `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
1009
1012
  `IP_GEOLOCATION` | [Optional] Specify IP Geolocation. Refer to [IP Geolocation](https://www.browserstack.com/ip-geolocation) to select a country code.
1010
- `SELENIUM_VERSION` | [Optional] Specify Selenium WebDriver version to use
1011
- `CONSOLE_LOGS` | [Optional] Used to capture browser console logs. Refer to `browserstack.console` capability in chart
1012
- `WD_VERSION` | [Optional] Specify browser-specific WebDriver version to use. Refer to `browserstack.geckodriver`, `browserstack.ie.driver`, and `browserstack.safari.driver` capabilities in chart
1013
1013
  `ALLOW_POPUPS` | [Optional] Allow popups (`true` or `false`) - for Safari, IE, and Edge browsers only
1014
1014
  `ALLOW_COOKIES` | [Optional] Allow all cookies (`true` or `false`) - for Safari browsers only
1015
+ `SCREENSHOTS` | [Optional] Generate screenshots for debugging (`true` or `false`)
1016
+ `NETWORK_LOGS` | [Optional] Capture network logs (`true` or `false`)
1015
1017
 
1016
1018
  If the BrowserStack Local instance is running (`TUNNELING` Environment Variable is `true`), call the`TestCentricity::WebDriverConnect.close_tunnel` method
1017
1019
  upon completion of your test suite to stop the Local instance. Place the code shown below in your `env.rb` or `hooks.rb` file.
@@ -1025,7 +1027,7 @@ upon completion of your test suite to stop the Local instance. Place the code sh
1025
1027
  #### Remote mobile browsers on the BrowserStack service
1026
1028
 
1027
1029
  For remotely hosted mobile web browsers on the BrowserStack service, the following **Environment Variables** must be set as described in
1028
- the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities)
1030
+ the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities?tag=selenium-4)
1029
1031
  for information regarding the specific capabilities.
1030
1032
 
1031
1033
  **Environment Variable** | **Description**
@@ -1034,8 +1036,7 @@ for information regarding the specific capabilities.
1034
1036
  `BS_USERNAME` | Must be set to your BrowserStack account user name
1035
1037
  `BS_AUTHKEY` | Must be set to your BrowserStack account access key
1036
1038
  `BS_OS` | Must be set to `ios` or `android`
1037
- `BS_BROWSER` | Must be set to `iPhone`, `iPad`, or `android`
1038
- `BS_PLATFORM` | Must be set to `MAC` (for iOS) or `ANDROID`
1039
+ `BS_BROWSER` | Must be set to `Safari` (for iOS) or `Chrome` (for Android)
1039
1040
  `BS_DEVICE` | Refer to `device` capability in chart
1040
1041
  `BS_REAL_MOBILE` | Set to `true` if running against a real device
1041
1042
  `DEVICE_TYPE` | Must be set to `phone` or `tablet`
@@ -1044,7 +1045,9 @@ for information regarding the specific capabilities.
1044
1045
  `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
1045
1046
  `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
1046
1047
  `IP_GEOLOCATION` | [Optional] Specify IP Geolocation. Refer to [IP Geolocation](https://www.browserstack.com/ip-geolocation) to select a country code.
1047
- `CONSOLE_LOGS` | [Optional] Used to capture browser console logs. Refer to `browserstack.console` capability in chart
1048
+ `SCREENSHOTS` | [Optional] Generate screenshots for debugging (`true` or `false`)
1049
+ `NETWORK_LOGS` | [Optional] Capture network logs (`true` or `false`)
1050
+ `APPIUM_LOGS` | [Optional] Generate Appium logs (`true` or `false`)
1048
1051
 
1049
1052
 
1050
1053
 
@@ -1706,7 +1709,7 @@ landscape orientation running on the BrowserStack service:
1706
1709
 
1707
1710
  ## Copyright and License
1708
1711
 
1709
- TestCentricity™ Framework is Copyright (c) 2014-2021, Tony Mrozinski.
1712
+ TestCentricity™ Framework is Copyright (c) 2014-2022, Tony Mrozinski.
1710
1713
  All rights reserved.
1711
1714
 
1712
1715
  Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@ module TestCentricity
26
26
  puts 'Appium Server is starting'
27
27
  end
28
28
  # start new Appium Server
29
- @process = ChildProcess.build(*parameters)
29
+ @process = ChildProcess.build
30
30
  process.start
31
31
  # wait until confirmation that Appium Server is running
32
32
  wait = Selenium::WebDriver::Wait.new(timeout: 30)
@@ -5,6 +5,8 @@ module TestCentricity
5
5
  attr_accessor :environ_specific_data
6
6
 
7
7
  def self.find_environ(environ_name, source_type = :excel)
8
+ raise 'No environment specified' if environ_name.nil?
9
+
8
10
  data = case source_type
9
11
  when :excel
10
12
  ExcelData.read_row_data(XL_PRIMARY_DATA_FILE, 'Environments', environ_name)
@@ -13,11 +15,27 @@ module TestCentricity
13
15
  @generic_data ||= YAML.load_file(YML_PRIMARY_DATA_FILE)
14
16
  # read environment specific test data
15
17
  data_file = "#{PRIMARY_DATA_PATH}#{environ_name}_data.yml"
16
- @environ_specific_data ||= YAML.load_file(data_file)
18
+ @environ_specific_data = if File.exist?(data_file)
19
+ YAML.load_file(data_file)
20
+ else
21
+ {}
22
+ end
17
23
 
18
24
  read('Environments', environ_name)
19
25
  when :json
20
- read_json_node_data('environments.json', environ_name)
26
+ # read generic test data from data.json file
27
+ raw_data = File.read(JSON_PRIMARY_DATA_FILE)
28
+ @generic_data = JSON.parse(raw_data)
29
+ # read environment specific test data
30
+ data_file = "#{PRIMARY_DATA_PATH}#{environ_name}_data.json"
31
+ @environ_specific_data = if File.exist?(data_file)
32
+ raw_data = File.read(data_file)
33
+ JSON.parse(raw_data)
34
+ else
35
+ {}
36
+ end
37
+
38
+ read('Environments', environ_name)
21
39
  end
22
40
  @current = Environ.new(data)
23
41
  Environ.current = @current
@@ -47,6 +65,9 @@ module TestCentricity
47
65
  @session_id = Time.now.strftime('%d%H%M%S%L')
48
66
  @session_time_stamp = Time.now.strftime('%Y%m%d%H%M%S')
49
67
  @test_environment = ENV['TEST_ENVIRONMENT']
68
+ @a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
69
+ @locale = ENV['LOCALE'] || 'en'
70
+ @language = ENV['LANGUAGE'] || 'English'
50
71
  @screen_shots = []
51
72
 
52
73
  attr_accessor :test_environment
@@ -111,9 +132,6 @@ module TestCentricity
111
132
  @dns = data['DNS']
112
133
  @db_username = data['DB_USERNAME']
113
134
  @db_password = data['DB_PASSWORD']
114
- @a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
115
- @locale = ENV['LOCALE'] || 'en'
116
- @language = ENV['LANGUAGE'] || 'English'
117
135
 
118
136
  super
119
137
  end
@@ -365,13 +383,13 @@ module TestCentricity
365
383
  def self.report_header
366
384
  report_header = "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"\
367
385
  " <b>Browser:</b>\t #{Environ.browser.capitalize}\n"
368
- report_header = "#{report_header} <b>Device:</b>\t\t #{Environ.device_name}\n" if Environ.device_name
386
+ report_header = "#{report_header} <b>Device:</b>\t #{Environ.device_name}\n" if Environ.device_name
369
387
  report_header = "#{report_header} <b>Device OS:</b>\t #{Environ.device_os} #{Environ.device_os_version}\n" if Environ.device_os
370
388
  report_header = "#{report_header} <b>Device type:</b>\t #{Environ.device_type}\n" if Environ.device_type
371
- report_header = "#{report_header} <b>Driver:</b>\t\t #{Environ.driver}\n" if Environ.driver
389
+ report_header = "#{report_header} <b>Driver:</b>\t #{Environ.driver}\n" if Environ.driver
372
390
  report_header = "#{report_header} <b>Grid:</b>\t\t #{Environ.grid}\n" if Environ.grid
373
- report_header = "#{report_header} <b>OS:</b>\t\t\t #{Environ.os}\n" if Environ.os
374
- report_header = "#{report_header} <b>Locale:</b>\t\t #{Environ.locale}\n" if Environ.locale
391
+ report_header = "#{report_header} <b>OS:</b>\t\t #{Environ.os}\n" if Environ.os
392
+ report_header = "#{report_header} <b>Locale:</b>\t #{Environ.locale}\n" if Environ.locale
375
393
  report_header = "#{report_header} <b>Language:</b>\t #{Environ.language}\n" if Environ.language
376
394
  report_header = "#{report_header} <b>Country:</b>\t #{ENV['COUNTRY']}\n" if ENV['COUNTRY']
377
395
  report_header = "#{report_header} <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
@@ -116,8 +116,8 @@ module TestCentricity
116
116
  end
117
117
 
118
118
  def self.enqueue_screenshot
119
- timestamp = Time.now.strftime('%Y%m%d%H%M%S')
120
- filename = "Screenshot-#{timestamp}"
119
+ timestamp = Time.now.strftime('%Y%m%d%H%M%S%L')
120
+ filename = "Screenshot-#{timestamp}.png"
121
121
  path = File.join Dir.pwd, 'reports/screenshots/', filename
122
122
  # highlight the active UI element prior to taking a screenshot
123
123
  unless @active_ui_element.nil? || @mru_ui_element == @active_ui_element
@@ -126,14 +126,14 @@ module TestCentricity
126
126
  end
127
127
  # take screenshot
128
128
  if Environ.driver == :appium
129
- AppiumConnect.take_screenshot("#{path}.png")
129
+ AppiumConnect.take_screenshot(path)
130
130
  else
131
- Capybara.save_screenshot "#{path}.png"
131
+ Capybara.save_screenshot path
132
132
  end
133
133
  # unhighlight the active UI element
134
134
  @mru_ui_element.unhighlight unless @mru_ui_element.blank?
135
135
  # add screenshot to queue
136
- puts "Screenshot saved at #{path}.png"
136
+ puts "Screenshot saved at #{path}"
137
137
  screen_shot = {path: path, filename: filename}
138
138
  Environ.save_screen_shot(screen_shot)
139
139
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '4.0.3'
2
+ VERSION = '4.1.0'
3
3
  end
@@ -100,13 +100,12 @@ module TestCentricity
100
100
  #
101
101
  # @param element_name [Symbol] name of checkbox object (as a symbol)
102
102
  # @param locator [String] CSS selector or XPath expression that uniquely identifies object
103
- # @param proxy [Symbol] Optional name (as a symbol) of proxy object to receive click actions
104
103
  # @example
105
104
  # checkbox :remember_checkbox, "//input[@id='RememberUser']"
106
- # checkbox :accept_terms_checkbox, 'input#accept_terms_conditions', :accept_terms_label
105
+ # checkbox :accept_terms_checkbox, 'input#accept_terms_conditions'
107
106
  #
108
- def self.checkbox(element_name, locator, proxy = nil)
109
- class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::CheckBox.new("#{element_name}", self, "#{locator}", :page, #{proxy});end))
107
+ def self.checkbox(element_name, locator)
108
+ define_page_element(element_name, TestCentricity::CheckBox, locator)
110
109
  end
111
110
 
112
111
  # Declare and instantiate a collection of checkboxes for this page object.
@@ -126,13 +125,12 @@ module TestCentricity
126
125
  #
127
126
  # @param element_name [Symbol] name of radio object (as a symbol)
128
127
  # @param locator [String] CSS selector or XPath expression that uniquely identifies object
129
- # @param proxy [Symbol] Optional name (as a symbol) of proxy object to receive click actions
130
128
  # @example
131
129
  # radio :accept_terms_radio, "//input[@id='Accept_Terms']"
132
- # radio :decline_terms_radio, '#decline_terms_conditions', :decline_terms_label
130
+ # radio :decline_terms_radio, '#decline_terms_conditions'
133
131
  #
134
- def self.radio(element_name, locator, proxy = nil)
135
- class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Radio.new("#{element_name}", self, "#{locator}", :page, #{proxy});end))
132
+ def self.radio(element_name, locator)
133
+ define_page_element(element_name, TestCentricity::Radio, locator)
136
134
  end
137
135
 
138
136
  # Declare and instantiate a collection of radio buttons for this page object.
@@ -220,13 +220,12 @@ module TestCentricity
220
220
  #
221
221
  # @param element_name [Symbol] name of checkbox object (as a symbol)
222
222
  # @param locator [String] CSS selector or XPath expression that uniquely identifies object
223
- # @param proxy [Symbol] Optional name (as a symbol) of proxy object to receive click actions
224
223
  # @example
225
224
  # checkbox :remember_checkbox, "//input[@id='RememberUser']"
226
- # checkbox :accept_terms_checkbox, 'input#accept_terms_conditions', :accept_terms_label
225
+ # checkbox :accept_terms_checkbox, 'input#accept_terms_conditions'
227
226
  #
228
- def self.checkbox(element_name, locator, proxy = nil)
229
- class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::CheckBox.new("#{element_name}", self, "#{locator}", :section, #{proxy});end))
227
+ def self.checkbox(element_name, locator)
228
+ define_element(element_name, TestCentricity::CheckBox, locator)
230
229
  end
231
230
 
232
231
  # Declare and instantiate a collection of checkboxes for this page section.
@@ -246,13 +245,12 @@ module TestCentricity
246
245
  #
247
246
  # @param element_name [Symbol] name of radio object (as a symbol)
248
247
  # @param locator [String] CSS selector or XPath expression that uniquely identifies object
249
- # @param proxy [Symbol] Optional name (as a symbol) of proxy object to receive click actions
250
248
  # @example
251
249
  # radio :accept_terms_radio, "//input[@id='Accept_Terms']"
252
- # radio :decline_terms_radio, 'input#decline_terms_conditions', :decline_terms_label
250
+ # radio :decline_terms_radio, 'input#decline_terms_conditions'
253
251
  #
254
252
  def self.radio(element_name, locator, proxy = nil)
255
- class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Radio.new("#{element_name}", self, "#{locator}", :section, #{proxy});end))
253
+ define_element(element_name, TestCentricity::Radio, locator)
256
254
  end
257
255
 
258
256
  # Declare and instantiate a collection of radio buttons for this page section.