testcentricity 2.4.2 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +29 -0
- data/.rspec +2 -1
- data/.rubocop.yml +38 -0
- data/.ruby-version +1 -1
- data/.simplecov +9 -0
- data/.yardopts +3 -0
- data/CHANGELOG.md +275 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/{LICENSE.txt → LICENSE.md} +3 -4
- data/README.md +938 -1380
- data/Rakefile +63 -1
- data/config/cucumber.yml +145 -0
- data/config/locales/en-US.yml +56 -0
- data/config/test_data/LOCAL_data.yml +11 -0
- data/config/test_data/data.yml +10 -0
- data/features/deep_links.feature +26 -0
- data/features/login.feature +30 -0
- data/features/navigation.feature +31 -0
- data/features/step_definitions/generic_steps.rb +72 -0
- data/features/support/android/screens/about_screen.rb +11 -0
- data/features/support/android/screens/base_app_screen.rb +29 -0
- data/features/support/android/screens/checkout_address_screen.rb +17 -0
- data/features/support/android/screens/checkout_payment_screen.rb +22 -0
- data/features/support/android/screens/login_screen.rb +18 -0
- data/features/support/android/screens/products_screen.rb +13 -0
- data/features/support/android/screens/saucebot_screen.rb +16 -0
- data/features/support/android/screens/webview_screen.rb +13 -0
- data/features/support/android/sections/nav_widgets/nav_menu.rb +39 -0
- data/features/support/env.rb +61 -0
- data/features/support/hooks.rb +135 -0
- data/features/support/ios/screens/about_screen.rb +11 -0
- data/features/support/ios/screens/base_app_screen.rb +19 -0
- data/features/support/ios/screens/checkout_address_screen.rb +17 -0
- data/features/support/ios/screens/checkout_payment_screen.rb +22 -0
- data/features/support/ios/screens/login_screen.rb +18 -0
- data/features/support/ios/screens/products_screen.rb +13 -0
- data/features/support/ios/screens/saucebot_screen.rb +16 -0
- data/features/support/ios/screens/webview_screen.rb +13 -0
- data/features/support/ios/sections/list_items/product_cell_item.rb +13 -0
- data/features/support/ios/sections/modals/base_modal.rb +23 -0
- data/features/support/ios/sections/modals/logout_modal.rb +6 -0
- data/features/support/ios/sections/modals/reset_app_state_modal.rb +6 -0
- data/features/support/ios/sections/nav_widgets/nav_bar.rb +31 -0
- data/features/support/ios/sections/nav_widgets/nav_menu.rb +41 -0
- data/features/support/shared_components/screens/base_app_screen.rb +31 -0
- data/features/support/shared_components/screens/checkout_address_screen.rb +17 -0
- data/features/support/shared_components/screens/checkout_payment_screen.rb +22 -0
- data/features/support/shared_components/screens/login_screen.rb +39 -0
- data/features/support/shared_components/screens/saucebot_screen.rb +17 -0
- data/features/support/shared_components/screens/webview_screen.rb +12 -0
- data/features/support/shared_components/sections/nav_menu.rb +58 -0
- data/features/support/world_data.rb +12 -0
- data/features/support/world_pages.rb +26 -0
- data/lib/testcentricity/app_core/appium_connect_helper.rb +343 -111
- data/lib/testcentricity/app_core/screen_object.rb +252 -0
- data/lib/testcentricity/app_core/screen_objects_helper.rb +29 -201
- data/lib/testcentricity/app_core/{screen_sections_helper.rb → screen_section.rb} +40 -105
- data/lib/testcentricity/app_elements/app_element_helper.rb +17 -8
- data/lib/testcentricity/app_elements/checkbox.rb +3 -3
- data/lib/testcentricity/data_objects/environment.rb +133 -39
- data/lib/testcentricity/version.rb +1 -1
- data/lib/testcentricity.rb +4 -129
- data/reports/.keep +1 -0
- data/spec/fixtures/page_object.rb +22 -0
- data/spec/fixtures/page_section_object.rb +21 -0
- data/spec/fixtures/screen_object.rb +16 -0
- data/spec/fixtures/screen_section_object.rb +16 -0
- data/spec/spec_helper.rb +28 -9
- data/spec/testcentricity/elements/button_spec.rb +18 -0
- data/spec/testcentricity/elements/checkbox_spec.rb +28 -0
- data/spec/testcentricity/elements/image_spec.rb +13 -0
- data/spec/testcentricity/elements/label_spec.rb +18 -0
- data/spec/testcentricity/elements/list_spec.rb +13 -0
- data/spec/testcentricity/elements/ui_element_spec.rb +72 -0
- data/spec/testcentricity/mobile/appium_connect_spec.rb +117 -0
- data/spec/testcentricity/mobile/screen_object_spec.rb +63 -0
- data/spec/testcentricity/mobile/screen_section_object_spec.rb +56 -0
- data/spec/testcentricity/version_spec.rb +7 -0
- data/spec/testcentricity/web/browser_spec.rb +41 -0
- data/spec/testcentricity/web/local_webdriver_spec.rb +86 -0
- data/spec/testcentricity/web/mobile_webdriver_spec.rb +123 -0
- data/spec/testcentricity/web/page_object_spec.rb +85 -0
- data/spec/testcentricity/web/page_section_object_spec.rb +72 -0
- data/testcentricity.gemspec +28 -27
- metadata +196 -127
- data/.ruby-gemset +0 -1
- data/Gemfile.lock +0 -93
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/devices/devices.yml +0 -352
- data/lib/testcentricity/app_core/appium_server.rb +0 -69
- data/lib/testcentricity/browser_helper.rb +0 -174
- data/lib/testcentricity/data_objects/data_objects_helper.rb +0 -78
- data/lib/testcentricity/data_objects/excel_helper.rb +0 -242
- data/lib/testcentricity/exception_queue_helper.rb +0 -111
- data/lib/testcentricity/utility_helpers.rb +0 -28
- data/lib/testcentricity/web_core/drag_drop_helper.rb +0 -15
- data/lib/testcentricity/web_core/page_objects_helper.rb +0 -677
- data/lib/testcentricity/web_core/page_sections_helper.rb +0 -895
- data/lib/testcentricity/web_core/webdriver_helper.rb +0 -588
- data/lib/testcentricity/web_elements/button.rb +0 -8
- data/lib/testcentricity/web_elements/cell_button.rb +0 -8
- data/lib/testcentricity/web_elements/cell_checkbox.rb +0 -38
- data/lib/testcentricity/web_elements/cell_element.rb +0 -69
- data/lib/testcentricity/web_elements/cell_image.rb +0 -8
- data/lib/testcentricity/web_elements/cell_radio.rb +0 -31
- data/lib/testcentricity/web_elements/checkbox.rb +0 -100
- data/lib/testcentricity/web_elements/file_field.rb +0 -45
- data/lib/testcentricity/web_elements/image.rb +0 -34
- data/lib/testcentricity/web_elements/label.rb +0 -8
- data/lib/testcentricity/web_elements/link.rb +0 -8
- data/lib/testcentricity/web_elements/list.rb +0 -100
- data/lib/testcentricity/web_elements/list_button.rb +0 -8
- data/lib/testcentricity/web_elements/list_checkbox.rb +0 -38
- data/lib/testcentricity/web_elements/list_element.rb +0 -61
- data/lib/testcentricity/web_elements/list_radio.rb +0 -31
- data/lib/testcentricity/web_elements/radio.rb +0 -74
- data/lib/testcentricity/web_elements/select_list.rb +0 -208
- data/lib/testcentricity/web_elements/siebel_open_ui_helper.rb +0 -15
- data/lib/testcentricity/web_elements/table.rb +0 -612
- data/lib/testcentricity/web_elements/textfield.rb +0 -114
- data/lib/testcentricity/web_elements/ui_elements_helper.rb +0 -532
- data/lib/testcentricity/world_extensions.rb +0 -26
- data/my_templates/default/method_details/setup.rb +0 -3
- data/spec/testcentricity_spec.rb +0 -9
data/README.md
CHANGED
@@ -1,232 +1,66 @@
|
|
1
|
-
# TestCentricity™
|
1
|
+
# TestCentricity™
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/testcentricity.svg)](https://badge.fury.io/rb/testcentricity) [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
*
|
15
|
-
*
|
16
|
-
|
17
|
-
[
|
4
|
+
![Gem Downloads](https://img.shields.io/gem/dt/testcentricity) ![Maintained](https://img.shields.io/maintenance/yes/2022)
|
5
|
+
|
6
|
+
|
7
|
+
The TestCentricity™ core framework for native mobile iOS and Android apps and desktop/mobile web testing implements a Screen
|
8
|
+
and Page Object Model DSL for use with Cucumber (version 7.x or greater), Appium, Capybara, and Selenium-Webdriver (version 4.x). It also facilitates
|
9
|
+
the configuration of the appropriate Appium capabilities and driver required to establish a connection with locally hosted or
|
10
|
+
cloud hosted (using BrowserStack, Sauce Labs, or TestingBot services) iOS and Android real devices or simulators. For more
|
11
|
+
information on desktop/mobile web testing with this gem, refer to docs for the [TestCentricity™ Web gem](https://www.rubydoc.info/gems/testcentricity_web)
|
12
|
+
|
13
|
+
The TestCentricity™ gem supports automated testing of native iOS and Android apps running on the following mobile test targets:
|
14
|
+
* locally hosted iOS device simulators or physical iOS devices (using Appium and XCode on macOS)
|
15
|
+
* locally hosted Android devices or Android Studio virtual device emulators (using Appium and Android Studio on macOS)
|
16
|
+
* cloud hosted physical devices and simulators from the following service:
|
17
|
+
* [Browserstack](https://www.browserstack.com/list-of-browsers-and-platforms/app_automate)
|
18
|
+
* [Sauce Labs](https://saucelabs.com/platform/mobile-testing)
|
19
|
+
* [TestingBot](https://testingbot.com/mobile/realdevicetesting)
|
20
|
+
|
21
|
+
The TestCentricity™ gem also incorporates all of the features and capabilities of the TestCentricity™ Web framework gem, which
|
22
|
+
supports running automated tests against the following web test targets:
|
23
|
+
* locally hosted desktop browsers (Chrome, Edge, Firefox, Safari, or IE)
|
24
|
+
* locally hosted "headless" Chrome, Firefox, or Edge browsers
|
25
|
+
* remote desktop and emulated mobile web browsers hosted on Selenium Grid 4 and Dockerized Selenium Grid 4 environments
|
26
|
+
* mobile Safari browsers on iOS device simulators or physical iOS devices (using Appium and XCode on macOS)
|
27
|
+
* mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on macOS)
|
28
|
+
* cloud hosted desktop (Firefox, Chrome, Safari, IE, or Edge) or mobile (iOS Mobile Safari or Android) web browsers using the following service:
|
29
|
+
* [Browserstack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate)
|
30
|
+
* [Sauce Labs](https://saucelabs.com/open-source#automated-testing-platform)
|
31
|
+
* [TestingBot](https://testingbot.com/features)
|
32
|
+
* [LambdaTest](https://www.lambdatest.com/selenium-automation)
|
18
33
|
* web portals utilizing JavaScript front end application frameworks like Ember, React, Angular, and GWT
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
**Note:** Test execution against local instances of Firefox version 48 or greater is currently not supported by the TestCentricity™ Web gem. Testing with
|
23
|
-
locally hosted instances of Firefox 48 or greater requires Marionette (aka geckodriver) and selenium-webdriver version 3.x, both of which are currently
|
24
|
-
feature incomplete and potentially unstable. More information can be found [here](https://github.com/teamcapybara/capybara/issues/1710).
|
25
|
-
|
26
|
-
TestCentricity™ will be updated to support testing with Selenium-WebDriver version 3.x as soon as a stable version is available that **fully** supports locally
|
27
|
-
hosted instances of Chrome, Firefox, Safari, and IE web browsers.
|
34
|
+
* web pages containing HTML5 Video and Audio objects
|
28
35
|
|
29
36
|
|
30
37
|
## What's New
|
31
|
-
###Version 2.4.1
|
32
|
-
|
33
|
-
* Added device profiles for iPad (iOS 10) with MS Edge browser.
|
34
|
-
|
35
|
-
###Version 2.4.0
|
36
|
-
|
37
|
-
* Updated `TestCentricity::WebDriverConnect.initialize_web_driver` method to read the `APP_FULL_RESET`, `APP_NO_RESET`, and `NEW_COMMAND_TIMEOUT` Environment
|
38
|
-
Variables and set the corresponding `fullReset`, `noReset`, and `newCommandTimeout` Appium capabilities for iOS and Android physical devices and simulators.
|
39
|
-
Also reads the `WDA_LOCAL_PORT` Environment Variable and sets the `wdaLocalPort` Appium capability for iOS physical devices only.
|
40
|
-
|
41
|
-
###Version 2.3.18
|
42
|
-
|
43
|
-
* Updated `SelectList.define_list_elements` method to accept value for `:list_trigger` element.
|
44
|
-
* Updated `SelectList.choose_option` to respect `:list_item` value and to click on `:list_trigger` element, if one is specified.
|
45
|
-
* Updated `PageSection` and `PageObject` UI element object declaration methods to no longer use `class_eval` pattern.
|
46
|
-
* Updated device profiles for iPhone 7 (iOS 10) with Chrome browser and iPad (iOS 10) with Chrome browser.
|
47
|
-
|
48
|
-
###Version 2.3.17
|
49
|
-
|
50
|
-
* Added `List.wait_until_item_count_is` and `List.wait_until_item_count_changes` methods.
|
51
|
-
* `UIElement.wait_until_value_is` and `List.wait_until_item_count_is` methods now accept comparison hash.
|
52
|
-
|
53
|
-
###Version 2.3.16
|
54
|
-
|
55
|
-
* Added `PageSection.double_click`, `PageObject.right_click`, and `PageObject.send_keys` methods.
|
56
|
-
|
57
|
-
###Version 2.3.15
|
58
|
-
|
59
|
-
* Added `PageObject.wait_until_exists` and `PageObject.wait_until_gone` methods.
|
60
|
-
|
61
|
-
###Version 2.3.14
|
62
|
-
|
63
|
-
* Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser.
|
64
|
-
|
65
|
-
###Version 2.3.13
|
66
|
-
|
67
|
-
* Added `AppiumServer.start`, `AppiumServer.running?`, and `AppiumServer.stop` methods for starting and stopping the Appium Server prior to executing tests on
|
68
|
-
iOS physical devices or simulators, or Android virtual device emulators.
|
69
|
-
|
70
|
-
###Version 2.3.12
|
71
|
-
|
72
|
-
* Added `Environ.is_simulator?` and `Environ.is_web?` methods.
|
73
|
-
|
74
|
-
###Version 2.3.11
|
75
|
-
|
76
|
-
* Added support for running tests in Mobile Safari browser on physical iOS devices.
|
77
|
-
* Updated device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
|
78
|
-
|
79
|
-
###Version 2.3.10
|
80
|
-
|
81
|
-
* Added support for running tests in mobile Chrome or Android browsers on Android Studio virtual device emulators.
|
82
|
-
* Added `displayed?`, `get_all_items_count`, and `get_all_list_items` methods to `PageSection` class.
|
83
|
-
* Added `get_all_items_count`, and `get_all_list_items` methods to `List` class.
|
84
|
-
|
85
|
-
###Version 2.3.9
|
86
|
-
|
87
|
-
* Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to accept optional `wait_time` parameter.
|
88
|
-
* Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser, iPhone 7 (iOS 10) with Chrome browser, and iPhone 7 (iOS 10) with Firefox browser.
|
89
|
-
* Updated device profiles for iPad (iOS 10) with Chrome browser and iPad (iOS 10) with Firefox browser.
|
90
|
-
|
91
|
-
###Version 2.3.7
|
92
|
-
|
93
|
-
* Added `width`, `height`, `x`, `y`, and `displayed?` methods to `UIElement` class.
|
94
|
-
|
95
|
-
###Version 2.3.6
|
96
|
-
|
97
|
-
* Added `TextField.clear` method for deleting the contents of text fields. This method should trigger the `onchange` event for the associated text field.
|
98
|
-
|
99
|
-
###Version 2.3.5
|
100
|
-
|
101
|
-
* Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to be compatible with Redactor editor fields.
|
102
|
-
* Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser, iPhone 7 (iOS 10) with Chrome browser, and iPhone 7 (iOS 10) with Firefox browser.
|
103
|
-
|
104
|
-
###Version 2.3.3
|
105
|
-
|
106
|
-
* Added device profile for iPhone 7 (iOS 10) with MS Edge browser.
|
107
|
-
|
108
|
-
###Version 2.3.1
|
109
|
-
|
110
|
-
* When testing using remotely hosted browsers on the BrowserStack service, the BrowserStack Local instance is automatically started if the `TUNNELING`
|
111
|
-
Environment Variable is set to `true`. `Environ.tunneling` will be set to true if the BrowserStack Local instance is succesfully started.
|
112
|
-
* Added `TestCentricity::WebDriverConnect.close_tunnel` method to close BrowserStack Local instance when Local testing is enabled. Refer to the
|
113
|
-
**Remotely hosted desktop and mobile web browsers** section for information on usage.
|
114
|
-
|
115
|
-
###Version 2.2.0
|
116
|
-
|
117
|
-
* CSS selectors or XPath expressions may be used as locators for all types of **UI Elements**, including tables.
|
118
|
-
|
119
|
-
###Version 2.1.10
|
120
|
-
|
121
|
-
* Added device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
|
122
|
-
|
123
|
-
###Version 2.1.8
|
124
|
-
|
125
|
-
* Added `PageSection.verify_list_items` method for **Indexed PageSection Objects**.
|
126
|
-
|
127
|
-
###Version 2.1.7
|
128
|
-
|
129
|
-
* Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to use backspace characters to delete contents of a textfield
|
130
|
-
instead of using `clear`, which was preventing `onchange` JavaScript events from being triggered in some browsers.
|
131
|
-
|
132
|
-
###Version 2.1.5
|
133
|
-
|
134
|
-
* Added `get_min`, `get_max`, and `get_step` methods to `TextField` class.
|
135
|
-
|
136
|
-
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `min`, `max`, and `step` attributes
|
137
|
-
for textfields.
|
138
|
-
|
139
|
-
###Version 2.1.4
|
140
|
-
|
141
|
-
* Added suppression of the Info Bar that displays "Chrome is being controlled by automated test software" on locally hosted instances of the Chrome browser.
|
142
|
-
|
143
|
-
|
144
|
-
###Version 2.1.3
|
145
|
-
|
146
|
-
* Added support for "tiling" or cascading multiple browser windows when the `BROWSER_TILE` and `PARALLEL` Environment Variables are set to true. For each
|
147
|
-
concurrent parallel thread being executed, the position of each browser will be offset by 100 pixels right and 100 pixels down. For parallel test execution,
|
148
|
-
use the [parallel_tests gem](https://rubygems.org/gems/parallel_tests) to decrease overall test execution time.
|
149
|
-
|
150
|
-
###Version 2.1.2
|
151
|
-
|
152
|
-
* Added device profiles for Microsoft Lumia 950, Blackberry Leap, Blackberry Passport, and Kindle Fire HD 10
|
153
|
-
* Added ability to set browser language support via the `LOCALE` Environment Variable for local instances of Chrome browsers
|
154
|
-
|
155
|
-
###Version 2.1.0
|
156
|
-
|
157
|
-
* Added device profiles for iPhone 8, iPhone 8 Plus, iPhone X devices running iOS 11
|
158
|
-
* Added device profile for iPad Pro 10.5" with iOS 11
|
159
|
-
* Updated iPhone 7 and iPhone 7 Plus profiles to iOS 10
|
160
|
-
* Updated Google Pixel and Google Pixel XL profiles to Android 8
|
161
|
-
* Added device profiles for iPhone 7 (iOS 10) with Mobile Chrome browser and iPad (iOS 10) with Mobile Chrome browser
|
162
|
-
|
163
|
-
|
164
|
-
## What's Fixed
|
165
|
-
###Version 2.3.19
|
166
|
-
|
167
|
-
* Fixed device profile for `android_phone` - Generic Android Phone
|
168
|
-
|
169
|
-
###Version 2.3.18
|
170
|
-
|
171
|
-
* Fixed `SelectList.choose_option` to also accept `:text`, `:value`, and `:index` option hashes across all types of select list objects.
|
172
|
-
|
173
|
-
|
174
|
-
###Version 2.3.15
|
175
|
-
|
176
|
-
* Fixed bug in `UIElement.get_object_type` method that could result in a `NoMethodError obj not defined` error.
|
177
|
-
* Fixed bug in `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods that failed to enqueue errors when UI elements could not be found.
|
178
|
-
|
179
|
-
###Version 2.3.8
|
180
|
-
|
181
|
-
* Fixed locator resolution for **Indexed PageSection Objects**.
|
182
|
-
|
183
|
-
###Version 2.3.6.1
|
184
|
-
|
185
|
-
* `TextField.clear` method now works with most `number` type fields.
|
186
|
-
|
187
|
-
###Version 2.3.4
|
188
|
-
|
189
|
-
* Fixed bug in `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods that prevented deletion of data in number type textfields
|
190
|
-
and textarea controls.
|
191
38
|
|
192
|
-
|
39
|
+
A complete history of bug fixes and new features can be found in the {file:CHANGELOG.md CHANGELOG} file.
|
193
40
|
|
194
|
-
|
41
|
+
The RubyDocs for this gem can be found [here](https://www.rubydoc.info/gems/testcentricity/).
|
195
42
|
|
196
|
-
###Version 2.2.1
|
197
43
|
|
198
|
-
|
44
|
+
## Which gem should I use?
|
199
45
|
|
200
|
-
|
46
|
+
| Tested platforms | TestCentricity | TestCentricity Web |
|
47
|
+
|--------------------------------------------------|----------------|--------------------|
|
48
|
+
| Native mobile apps only | Yes | No |
|
49
|
+
| Hybrid apps with WebViews only | Yes | No |
|
50
|
+
| Native mobile apps and desktop/mobile web | Yes | No |
|
51
|
+
| Hybrid apps with WebViews and desktop/mobile web | Yes | No |
|
52
|
+
| Desktop/mobile web only | No | Yes |
|
201
53
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
###Version 2.1.6
|
206
|
-
|
207
|
-
* Fixed bug in `TestCentricity::WebDriverConnect.set_webdriver_path` method that was failing to set the path to the appropriate chromedriver file for OS X
|
208
|
-
and Windows.
|
209
|
-
|
210
|
-
###Version 2.1.5
|
211
|
-
|
212
|
-
* Fixed Chrome and Firefox support for setting browser language via the `LOCALE` Environment Variable. This capability now works for emulated mobile
|
213
|
-
browsers hosted in a local instance of Chrome or Firefox.
|
214
|
-
|
215
|
-
###Version 2.1.0
|
216
|
-
|
217
|
-
* The `TestCentricity::WebDriverConnect.initialize_web_driver` method now sets the `Environ` object to the correct device connection states for local and
|
218
|
-
cloud hosted browsers.
|
219
|
-
* The `TestCentricity::WebDriverConnect.initialize_web_driver` method no longer calls `initialize_browser_size` when running tests against cloud hosted
|
220
|
-
mobile web browser, which was resulting in Appium throwing exceptions for unsupported method calls.
|
221
|
-
* The `TestCentricity::WebDriverConnect.set_webdriver_path` method now correctly sets the path for Chrome webDrivers when the `HOST_BROWSER` Environment
|
222
|
-
Variable is set to `chrome`. Tests against locally hosted emulated mobile web browser running on a local instance of Chrome will now work correctly.
|
54
|
+
The TestCentricity gem is designed to support testing of native and hybrid mobile apps and/or web interfaces via desktop and
|
55
|
+
mobile web browsers. The TestCentricity Web gem only supports testing of web interfaces via desktop and mobile web browsers.
|
223
56
|
|
224
57
|
|
225
58
|
## Installation
|
226
59
|
|
227
|
-
|
60
|
+
TestCentricity version 3.0 and above requires Ruby 2.7.5 or later. To install the TestCentricity gem, add this line to your automation
|
61
|
+
project's Gemfile:
|
228
62
|
|
229
|
-
gem '
|
63
|
+
gem 'testcentricity'
|
230
64
|
|
231
65
|
And then execute:
|
232
66
|
|
@@ -234,443 +68,452 @@ And then execute:
|
|
234
68
|
|
235
69
|
Or install it yourself as:
|
236
70
|
|
237
|
-
$ gem install
|
71
|
+
$ gem install testcentricity
|
238
72
|
|
239
73
|
|
240
74
|
## Setup
|
241
|
-
###Using Cucumber
|
75
|
+
### Using Cucumber
|
242
76
|
|
243
|
-
If you are using Cucumber, you need to require the following in your
|
77
|
+
If you are using Cucumber, you need to require the following in your `env.rb` file:
|
244
78
|
|
245
|
-
require 'capybara'
|
246
79
|
require 'capybara/cucumber'
|
247
|
-
require '
|
80
|
+
require 'testcentricity'
|
248
81
|
|
249
82
|
|
250
|
-
###Using RSpec
|
83
|
+
### Using RSpec
|
251
84
|
|
252
|
-
If you are using RSpec instead, you need to require the following in your
|
85
|
+
If you are using RSpec instead, you need to require the following in your `spec_helper.rb` file:
|
253
86
|
|
254
|
-
require 'capybara'
|
255
87
|
require 'capybara/rspec'
|
256
|
-
require '
|
257
|
-
|
258
|
-
|
259
|
-
### Using Poltergeist
|
88
|
+
require 'testcentricity'
|
260
89
|
|
261
|
-
If you will be running your tests on a "headless" web browser using Poltergeist and PhantomJS, you must add this line to your automation
|
262
|
-
project's Gemfile:
|
263
|
-
|
264
|
-
gem 'poltergeist'
|
265
|
-
|
266
|
-
|
267
|
-
### Using Appium
|
268
|
-
|
269
|
-
If you will be running your tests on mobile Safari browsers on simulated iOS devices using Appium and XCode Simulators, you need to require
|
270
|
-
the following in your *env.rb* file:
|
271
90
|
|
272
|
-
|
273
|
-
|
274
|
-
You also need to add this line to your automation project's Gemfile:
|
275
|
-
|
276
|
-
gem 'appium_capybara'
|
277
|
-
|
278
|
-
And then execute:
|
91
|
+
## ScreenObjects
|
279
92
|
|
280
|
-
|
93
|
+
The **Screen Object Model** is a test automation pattern that aims to create an abstraction of your native mobile app's User
|
94
|
+
Interface that can be used in tests. The **Screen** Object Model in native mobile test automation is equivalent to the **Page**
|
95
|
+
Object Model in web interface test automation.
|
281
96
|
|
97
|
+
A **Screen Object** is an object that represents a single screen in your AUT (Application Under Test). **Screen Objects**
|
98
|
+
encapsulate the implementation details of a mobile app screen and expose an API that supports interaction with, and validation
|
99
|
+
of the UI elements on the screen.
|
282
100
|
|
101
|
+
**Screen Objects** makes it easier to maintain automated tests because changes to screen UI elements are updated in only one
|
102
|
+
location - in the `ScreenObject` class definition. By adopting a **Screen Object Model**, Cucumber feature files and step
|
103
|
+
definitions are no longer required to hold specific information about a screen's UI objects, thus minimizing maintenance
|
104
|
+
requirements. If any element on, or property of a screen changes (text field attributes, button captions, element states,
|
105
|
+
etc.), maintenance is performed in the `ScreenObject` class definition only, typically with no need to update the affected
|
106
|
+
feature file, scenarios, or step definitions.
|
283
107
|
|
284
|
-
## Page Objects
|
285
108
|
|
286
|
-
|
287
|
-
in tests. A **Page Object** is an object that represents a single page in your AUT (Application Under Test). **Page Objects** encapsulate the
|
288
|
-
implementation details of a web page and expose an API that supports interaction with, and validation of the UI elements on the page.
|
109
|
+
### Defining a ScreenObject
|
289
110
|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
text field attributes, button captions, etc.), maintenance is performed in the **Page Object** class definition only, typically with no need
|
294
|
-
to update the affected feature file, scenarios, or step definitions.
|
111
|
+
Your `ScreenObject` class definitions should be contained within individual `.rb` files in the `features/support/<platform>/screens`
|
112
|
+
folder of your test automation project, where `<platform>` is typically `ios` or `android`. For each screen in your app, you will
|
113
|
+
typically have to define two `ScreenObjects` - one for iOS and the other for Android.
|
295
114
|
|
115
|
+
my_automation_project
|
116
|
+
├── config
|
117
|
+
├── features
|
118
|
+
│ ├── step_definitions
|
119
|
+
│ ├── support
|
120
|
+
│ │ ├── android
|
121
|
+
| | | └── screens
|
122
|
+
│ │ ├── ios
|
123
|
+
| | | └── screens
|
124
|
+
│ │ ├── env.rb
|
125
|
+
│ │ └── hooks.rb
|
126
|
+
├── Gemfile
|
127
|
+
└── README.md
|
296
128
|
|
297
|
-
### Defining a Page Object
|
298
129
|
|
299
|
-
|
300
|
-
test automation project. You define new **Page Objects** as shown below:
|
130
|
+
You define a new `ScreenObject` as shown below:
|
301
131
|
|
302
|
-
class
|
132
|
+
class LoginScreen < TestCentricity::ScreenObject
|
303
133
|
end
|
304
134
|
|
305
135
|
|
306
|
-
class
|
136
|
+
class ProductsScreen < TestCentricity::ScreenObject
|
307
137
|
end
|
308
138
|
|
309
139
|
|
310
|
-
class
|
140
|
+
class CheckoutAddressScreen < TestCentricity::ScreenObject
|
311
141
|
end
|
312
142
|
|
313
143
|
|
314
|
-
### Adding Traits to your
|
144
|
+
### Adding Traits to your ScreenObject
|
315
145
|
|
316
|
-
|
317
|
-
indicates that the
|
146
|
+
Native app screens typically have names associated with them. Screens also typically have a unique object or attribute that, when
|
147
|
+
present, indicates that the screen's contents have fully loaded.
|
318
148
|
|
319
|
-
The `page_name` trait is registered with the
|
320
|
-
parameter and returns an instance of the associated
|
321
|
-
trait for each
|
149
|
+
The `page_name` trait is registered with the `PageManager` object, which includes a `find_page` method that takes a page name as
|
150
|
+
a parameter and returns an instance of the associated `ScreenObject`. If you intend to use the `PageManager`, you must define a
|
151
|
+
`page_name` trait for each `ScreenObject` to be registered.
|
322
152
|
|
323
|
-
The `page_name` trait is usually a `String` value that represents the name of the
|
324
|
-
`page_name` traits are case and white-space sensitive. For
|
325
|
-
an `Array` of `String` values representing those
|
153
|
+
The `page_name` trait is usually a `String` value that represents the name of the screen that will be matched by the
|
154
|
+
`PageManager.findpage` method. `page_name` traits are case and white-space sensitive. For screens that may be referenced with
|
155
|
+
multiple names, the `page_name` trait may also be an `Array` of `String` values representing those screen names.
|
326
156
|
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
via a URL.
|
157
|
+
The `page_locator` trait specifies a locator for unique object that exists once the screen's contents have been fully rendered. The
|
158
|
+
`page_locator` trait is a locator strategy that uniquely identifies the object. The `ScreenObject.verify_page_exists` method
|
159
|
+
waits for the `page_locator` trait to exist, and raises an exception if the wait time exceeds the `default_max_wait_time`.
|
331
160
|
|
332
|
-
A `
|
333
|
-
|
334
|
-
for the `page_locator` trait to exist.
|
161
|
+
A `page_url` trait should be defined if a screen can be directly loaded using a deep link. Specifying a `page_url` trait is optional,
|
162
|
+
as not all screens can be directly accessed via a deep link.
|
335
163
|
|
336
|
-
You define your
|
164
|
+
You define your screen's **Traits** as shown below:
|
337
165
|
|
338
|
-
class
|
339
|
-
trait(:page_name)
|
340
|
-
trait(:
|
341
|
-
trait(:
|
166
|
+
class LoginScreen < TestCentricity::ScreenObject
|
167
|
+
trait(:page_name) { 'Login' }
|
168
|
+
trait(:page_locator) { { accessibility_id: 'login screen' } }
|
169
|
+
trait(:page_url) { 'login' }
|
342
170
|
end
|
343
171
|
|
344
172
|
|
345
|
-
class
|
346
|
-
|
347
|
-
trait(:
|
348
|
-
trait(:page_url)
|
349
|
-
trait(:page_locator) { 'body.dashboard' }
|
173
|
+
class ProductsScreen < TestCentricity::ScreenObject
|
174
|
+
trait(:page_name) { 'Products' }
|
175
|
+
trait(:page_locator) { { accessibility_id: 'products screen' } }
|
176
|
+
trait(:page_url) { 'store-overview' }
|
350
177
|
end
|
351
178
|
|
352
179
|
|
353
|
-
class
|
354
|
-
trait(:page_name)
|
355
|
-
trait(:
|
356
|
-
trait(:
|
180
|
+
class CheckoutAddressScreen < TestCentricity::ScreenObject
|
181
|
+
trait(:page_name) { 'Checkout - Address' }
|
182
|
+
trait(:page_locator) { { accessibility_id: 'checkout address screen' } }
|
183
|
+
trait(:page_url) { 'checkout-address' }
|
357
184
|
end
|
358
185
|
|
359
186
|
|
360
|
-
### Adding UI Elements to your
|
187
|
+
### Adding UI Elements to your ScreenObject
|
361
188
|
|
362
|
-
|
363
|
-
|
189
|
+
Native app screens are made up of UI elements like text fields, check boxes, switches, lists, buttons, etc. **UI Elements** are
|
190
|
+
added to your `ScreenObject` class definition as shown below:
|
364
191
|
|
365
|
-
class
|
366
|
-
trait(:page_name)
|
367
|
-
trait(:
|
368
|
-
trait(:
|
369
|
-
|
370
|
-
# Login
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
192
|
+
class LoginScreen < TestCentricity::ScreenObject
|
193
|
+
trait(:page_name) { 'Login' }
|
194
|
+
trait(:page_locator) { { accessibility_id: 'login screen' } }
|
195
|
+
trait(:page_url) { 'login' }
|
196
|
+
|
197
|
+
# Login screen UI elements
|
198
|
+
labels username_label: { accessibility_id: 'Username'},
|
199
|
+
password_label: { xpath: '(//XCUIElementTypeStaticText[@name="Password"])[1]'},
|
200
|
+
username_error: { accessibility_id: 'Username-error-message' },
|
201
|
+
password_error: { accessibility_id: 'Password-error-message' },
|
202
|
+
generic_error: { accessibility_id: 'generic-error-message' }
|
203
|
+
textfields username_field: { accessibility_id: 'Username input field' },
|
204
|
+
password_field: { accessibility_id: 'Password input field' }
|
205
|
+
button :login_button, { accessibility_id: 'Login button' }
|
376
206
|
end
|
377
|
-
|
378
207
|
|
379
|
-
class RegistrationPage < TestCentricity::PageObject
|
380
|
-
trait(:page_name) { 'Registration' }
|
381
|
-
trait(:page_url) { '/register' }
|
382
|
-
trait(:page_locator) { 'body.registration' }
|
383
|
-
|
384
|
-
# Registration page UI elements
|
385
|
-
textfields first_name_field: 'input#firstName',
|
386
|
-
last_name_field: 'input#lastName',
|
387
|
-
email_field: 'input#email',
|
388
|
-
phone_number_field: 'input#phone',
|
389
|
-
address_field: 'input#streetAddress',
|
390
|
-
city_field: 'input#city',
|
391
|
-
post_code_field: 'input#postalCode',
|
392
|
-
password_field: 'input#password',
|
393
|
-
pword_confirm_field: 'input#passwordConfirmation'
|
394
|
-
selectlists title_select: 'select#title',
|
395
|
-
gender_select: 'select#gender',
|
396
|
-
state_select: 'select#stateProvince'
|
397
|
-
checkbox :email_opt_in_check, 'input#marketingEmailsOptIn'
|
398
|
-
button :sign_up_button, 'button#registrationSignUp'
|
399
|
-
end
|
400
208
|
|
209
|
+
class CheckoutAddressScreen < TestCentricity::ScreenObject
|
210
|
+
trait(:page_name) { 'Checkout - Address' }
|
211
|
+
trait(:page_locator) { { accessibility_id: 'checkout address screen' } }
|
212
|
+
trait(:page_url) { 'checkout-address' }
|
213
|
+
|
214
|
+
# Checkout Address screen UI elements
|
215
|
+
textfields fullname_field: { accessibility_id: 'Full Name* input field' },
|
216
|
+
address1_field: { accessibility_id: 'Address Line 1* input field' },
|
217
|
+
address2_field: { accessibility_id: 'Address Line 2 input field' },
|
218
|
+
city_field: { accessibility_id: 'City* input field' },
|
219
|
+
state_region_field: { accessibility_id: 'State/Region input field' },
|
220
|
+
zip_code_field: { accessibility_id: 'Zip Code* input field' },
|
221
|
+
country_field: { accessibility_id: 'Country* input field' }
|
222
|
+
button :to_payment_button, { accessibility_id: 'To Payment button' }
|
223
|
+
end
|
401
224
|
|
402
|
-
### Adding Methods to your Page Object
|
403
225
|
|
404
|
-
|
405
|
-
and interacting with a page object's UI elements. You can add high level methods to your **Page Object** class definition for interacting with
|
406
|
-
the UI to hide implementation details, as shown below:
|
226
|
+
### Adding Methods to your ScreenObject
|
407
227
|
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
trait(:page_locator) { 'body.login-body' }
|
412
|
-
|
413
|
-
# Login page UI elements
|
414
|
-
textfield :user_id_field, 'input#userName'
|
415
|
-
textfield :password_field, 'input#password'
|
416
|
-
button :login_button, 'button#login'
|
417
|
-
checkbox :remember_checkbox, 'input#rememberUser'
|
418
|
-
label :error_message_label, 'div#statusBar.login-error'
|
419
|
-
link :forgot_password_link, 'a.forgotPassword'
|
420
|
-
|
421
|
-
# log in to web app
|
422
|
-
def login(user_id, password)
|
423
|
-
user_id_field.set(user_id)
|
424
|
-
password_field.set(password)
|
425
|
-
login_button.click
|
426
|
-
end
|
228
|
+
It is good practice for your Cucumber step definitions to call high level methods in your your `ScreenObject` instead of
|
229
|
+
directly accessing and interacting with a screen object's UI elements. You can add high level methods to your `ScreenObject`
|
230
|
+
class definition for interacting with the UI to hide implementation details, as shown below:
|
427
231
|
|
428
|
-
|
429
|
-
|
430
|
-
|
232
|
+
class LoginScreen < TestCentricity::ScreenObject
|
233
|
+
trait(:page_name) { 'Login' }
|
234
|
+
trait(:page_locator) { { accessibility_id: 'login screen' } }
|
235
|
+
trait(:page_url) { 'login' }
|
236
|
+
|
237
|
+
# Login screen UI elements
|
238
|
+
labels username_label: { accessibility_id: 'Username'},
|
239
|
+
password_label: { xpath: '(//XCUIElementTypeStaticText[@name="Password"])[1]'},
|
240
|
+
username_error: { accessibility_id: 'Username-error-message' },
|
241
|
+
password_error: { accessibility_id: 'Password-error-message' },
|
242
|
+
generic_error: { accessibility_id: 'generic-error-message' }
|
243
|
+
textfields username_field: { accessibility_id: 'Username input field' },
|
244
|
+
password_field: { accessibility_id: 'Password input field' }
|
245
|
+
button :login_button, { accessibility_id: 'Login button' }
|
431
246
|
|
432
|
-
# verify Login page default UI state
|
433
247
|
def verify_page_ui
|
248
|
+
super
|
434
249
|
ui = {
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
250
|
+
header_label => { visible: true, caption: 'Login' },
|
251
|
+
username_label => { visible: true, caption: 'Username' },
|
252
|
+
username_field => { visible: true, enabled: true },
|
253
|
+
password_label => { visible: true, caption: 'Password' },
|
254
|
+
password_field => { visible: true, enabled: true },
|
255
|
+
login_button => { visible: true, enabled: true, caption: 'Login' }
|
256
|
+
}
|
442
257
|
verify_ui_states(ui)
|
443
|
-
super
|
444
258
|
end
|
445
|
-
end
|
446
|
-
|
447
|
-
|
448
|
-
class RegistrationPage < TestCentricity::PageObject
|
449
|
-
trait(:page_name) { 'Registration' }
|
450
|
-
trait(:page_url) { '/register' }
|
451
|
-
trait(:page_locator) { 'body.registration' }
|
452
|
-
|
453
|
-
# Registration page UI elements
|
454
|
-
textfields first_name_field: 'input#firstName',
|
455
|
-
last_name_field: 'input#lastName',
|
456
|
-
email_field: 'input#email',
|
457
|
-
phone_number_field: 'input#phone',
|
458
|
-
address_field: 'input#streetAddress',
|
459
|
-
city_field: 'input#city',
|
460
|
-
post_code_field: 'input#postalCode',
|
461
|
-
password_field: 'input#password',
|
462
|
-
pword_confirm_field: 'input#passwordConfirmation'
|
463
|
-
selectlists title_select: 'select#title',
|
464
|
-
gender_select: 'select#gender',
|
465
|
-
state_select: 'select#stateProvince'
|
466
|
-
checkbox :email_opt_in_check, 'input#marketingEmailsOptIn'
|
467
|
-
button :sign_up_button, 'button#registrationSignUp'
|
468
259
|
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
gender_select => profile.gender,
|
475
|
-
phone_number_field => profile.phone,
|
476
|
-
email_field => profile.email,
|
477
|
-
address_field => profile.address,
|
478
|
-
city_field => profile.city,
|
479
|
-
state_select => profile.state,
|
480
|
-
post_code_field => profile.postal_code,
|
481
|
-
password_field => profile.password,
|
482
|
-
pword_confirm_field => profile.confirm_password
|
483
|
-
}
|
260
|
+
def login(username, password)
|
261
|
+
fields = {
|
262
|
+
username_field => username,
|
263
|
+
password_field => password
|
264
|
+
}
|
484
265
|
populate_data_fields(fields)
|
485
|
-
|
266
|
+
login_button.tap
|
267
|
+
end
|
268
|
+
|
269
|
+
def verify_entry_error(reason)
|
270
|
+
ui = case reason.gsub(/\s+/, '_').downcase.to_sym
|
271
|
+
when :invalid_password, :invalid_user
|
272
|
+
{ generic_error => { visible: true, caption: 'Provided credentials do not match any user in this service.' } }
|
273
|
+
when :locked_account
|
274
|
+
{ generic_error => { visible: true, caption: 'Sorry, this user has been locked out.' } }
|
275
|
+
when :no_username
|
276
|
+
{ username_error => { visible: true, caption: 'Username is required' } }
|
277
|
+
when :no_password
|
278
|
+
{ password_error => { visible: true, caption: 'Password is required' } }
|
279
|
+
else
|
280
|
+
raise "#{reason} is not a valid selector"
|
281
|
+
end
|
282
|
+
verify_ui_states(ui)
|
486
283
|
end
|
487
284
|
end
|
488
285
|
|
489
286
|
|
490
287
|
|
491
|
-
Once your
|
288
|
+
Once your `ScreenObject` has been instantiated, you can call your methods as shown below:
|
492
289
|
|
493
|
-
|
494
|
-
|
495
|
-
|
290
|
+
login_screen.login('snicklefritz', 'Pa55w0rd')
|
291
|
+
login_screen.verify_entry_error('invalid user')
|
292
|
+
|
293
|
+
|
294
|
+
## ScreenSections
|
496
295
|
|
296
|
+
A `ScreenSection` is a collection of **UI Elements** that may appear in multiple locations on a screen, or on multiple screens
|
297
|
+
in an app. It is a collection of **UI Elements** that represent a conceptual area of functionality, like a navigation bar, a
|
298
|
+
search capability, or a menu. **UI Elements** and functional behavior are confined to the scope of a `ScreenSection` object.
|
497
299
|
|
498
|
-
|
300
|
+
A `ScreenSection` may contain other `ScreenSection` objects.
|
499
301
|
|
500
|
-
A **PageSection Object** is a collection of **UI Elements** that may appear in multiple locations on a page, or on multiple pages in a web
|
501
|
-
app. It is a collection of **UI Elements** that represent a conceptual area of functionality, like a navigation bar, a search capability,
|
502
|
-
or a menu. **UI Elements** and functional behavior are confined to the scope of a **PageSection Object**.
|
503
302
|
|
504
|
-
|
303
|
+
### Defining a ScreenSection
|
505
304
|
|
305
|
+
Your `ScreenSection` class definitions should be contained within individual `.rb` files in the `features/support/<platform>/sections`
|
306
|
+
folder of your test automation project, where `<platform>` is typically `ios` or `android`. For each screen section in your app,
|
307
|
+
you will typically have to define two `ScreenSections` - one for iOS and the other for Android.
|
506
308
|
|
507
|
-
|
309
|
+
my_automation_project
|
310
|
+
├── config
|
311
|
+
├── features
|
312
|
+
│ ├── step_definitions
|
313
|
+
│ ├── support
|
314
|
+
│ │ ├── android
|
315
|
+
| | | ├── screens
|
316
|
+
| | | └── sections
|
317
|
+
│ │ ├── ios
|
318
|
+
| | | ├── screens
|
319
|
+
| | | └── sections
|
320
|
+
│ │ ├── env.rb
|
321
|
+
│ │ └── hooks.rb
|
322
|
+
├── Gemfile
|
323
|
+
└── README.md
|
508
324
|
|
509
|
-
Your **PageSection** class definitions should be contained within individual `.rb` files in the `features/support/sections` folder of
|
510
|
-
your test automation project. You define new **PageSection Objects** as shown below:
|
511
325
|
|
512
|
-
|
326
|
+
You define a new `ScreenSection` as shown below:
|
327
|
+
|
328
|
+
class NavMenu < TestCentricity::ScreenSection
|
513
329
|
end
|
514
330
|
|
515
331
|
|
516
|
-
### Adding Traits to a
|
332
|
+
### Adding Traits to a ScreenSection
|
517
333
|
|
518
|
-
A
|
334
|
+
A `ScreenSection` typically has a root node object that encapsulates a collection of `UIElements`. The `section_locator` trait
|
519
335
|
specifies the CSS or Xpath expression that uniquely identifies that root node object.
|
520
336
|
|
521
|
-
You define your
|
337
|
+
You define your section's **Traits** as shown below:
|
522
338
|
|
523
|
-
class
|
524
|
-
trait(:
|
525
|
-
trait(:
|
339
|
+
class NavMenu < TestCentricity::ScreenSection
|
340
|
+
trait(:section_name) { 'Nav Menu' }
|
341
|
+
trait(:section_locator) { { xpath: '//XCUIElementTypeScrollView' } }
|
526
342
|
end
|
527
343
|
|
528
344
|
|
529
|
-
### Adding UI Elements to your
|
345
|
+
### Adding UI Elements to your ScreenSection
|
346
|
+
|
347
|
+
A `ScreenSection` is typically made up of UI elements like text fields, check boxes, switches, lists, buttons, etc. **UI Elements**
|
348
|
+
are added to your `ScreenSection` class definition as shown below:
|
349
|
+
|
350
|
+
class NavMenu < TestCentricity::ScreenSection
|
351
|
+
trait(:section_name) { 'Nav Menu' }
|
352
|
+
trait(:section_locator) { { xpath: '//XCUIElementTypeScrollView' } }
|
353
|
+
|
354
|
+
# Nav Menu UI elements
|
355
|
+
buttons close_button: { accessibility_id: 'close menu' },
|
356
|
+
webview_button: { accessibility_id: 'menu item webview' },
|
357
|
+
qr_code_button: { accessibility_id: 'menu item qr code scanner' },
|
358
|
+
geo_location_button: { accessibility_id: 'menu item geo location' },
|
359
|
+
drawing_button: { accessibility_id: 'menu item drawing' },
|
360
|
+
report_a_bug_button: { accessibility_id: 'menu item report a bug' },
|
361
|
+
about_button: { accessibility_id: 'menu item about' },
|
362
|
+
reset_app_button: { accessibility_id: 'menu item reset app' },
|
363
|
+
biometrics_button: { accessibility_id: 'menu item biometrics' },
|
364
|
+
log_in_button: { accessibility_id: 'menu item log in' },
|
365
|
+
log_out_button: { accessibility_id: 'menu item log out' },
|
366
|
+
api_calls_button: { accessibility_id: 'menu item api calls' },
|
367
|
+
sauce_video_button: { accessibility_id: 'menu item sauce bot video' }
|
368
|
+
end
|
369
|
+
|
530
370
|
|
531
|
-
|
532
|
-
**UI Elements** are added to your **PageSection** class definition as shown below:
|
371
|
+
### Adding Methods to your ScreenSection
|
533
372
|
|
534
|
-
|
535
|
-
trait(:section_locator) { 'form#gnav-search' }
|
536
|
-
trait(:section_name) { 'Search widget' }
|
537
|
-
|
538
|
-
# Search Form UI elements
|
539
|
-
textfield :search_field, 'input#search-query'
|
540
|
-
button :search_button, 'button[type=submit]'
|
541
|
-
end
|
373
|
+
You can add methods to your `ScreenSection` class definition, as shown below:
|
542
374
|
|
375
|
+
class NavMenu < TestCentricity::ScreenSection
|
376
|
+
trait(:section_name) { 'Nav Menu' }
|
377
|
+
trait(:section_locator) { { xpath: '//XCUIElementTypeScrollView' } }
|
543
378
|
|
544
|
-
|
379
|
+
# Nav Menu UI elements
|
380
|
+
buttons close_button: { accessibility_id: 'close menu' },
|
381
|
+
webview_button: { accessibility_id: 'menu item webview' },
|
382
|
+
qr_code_button: { accessibility_id: 'menu item qr code scanner' },
|
383
|
+
geo_location_button: { accessibility_id: 'menu item geo location' },
|
384
|
+
drawing_button: { accessibility_id: 'menu item drawing' },
|
385
|
+
report_a_bug_button: { accessibility_id: 'menu item report a bug' },
|
386
|
+
about_button: { accessibility_id: 'menu item about' },
|
387
|
+
reset_app_button: { accessibility_id: 'menu item reset app' },
|
388
|
+
biometrics_button: { accessibility_id: 'menu item biometrics' },
|
389
|
+
log_in_button: { accessibility_id: 'menu item log in' },
|
390
|
+
log_out_button: { accessibility_id: 'menu item log out' },
|
391
|
+
api_calls_button: { accessibility_id: 'menu item api calls' },
|
392
|
+
sauce_video_button: { accessibility_id: 'menu item sauce bot video' }
|
545
393
|
|
546
|
-
|
394
|
+
def verify_ui
|
395
|
+
ui = {
|
396
|
+
self => { visible: true },
|
397
|
+
close_button => { visible: true, enabled: true },
|
398
|
+
webview_button => { visible: true, enabled: true, caption: 'Webview' },
|
399
|
+
qr_code_button => { visible: true, enabled: true, caption: 'QR Code Scanner' },
|
400
|
+
geo_location_button => { visible: true, enabled: true, caption: 'Geo Location' },
|
401
|
+
drawing_button => { visible: true, enabled: true, caption: 'Drawing' },
|
402
|
+
report_a_bug_button => { visible: true, enabled: true, caption: 'Report A Bug' },
|
403
|
+
about_button => { visible: true, enabled: true, caption: 'About' },
|
404
|
+
reset_app_button => { visible: true, enabled: true, caption: 'Reset App State' },
|
405
|
+
biometrics_button => { visible: true, enabled: true, caption: 'FaceID' },
|
406
|
+
log_in_button => { visible: true, enabled: true, caption: 'Log In' },
|
407
|
+
log_out_button => { visible: true, enabled: true, caption: 'Log Out' },
|
408
|
+
api_calls_button => { visible: true, enabled: true, caption: 'Api Calls' },
|
409
|
+
sauce_video_button => { visible: true, enabled: true, caption: 'Sauce Bot Video' }
|
410
|
+
}
|
411
|
+
verify_ui_states(ui)
|
412
|
+
end
|
547
413
|
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
# Search Form UI elements
|
553
|
-
textfield :search_field, 'input#search-query'
|
554
|
-
button :search_button, 'button[type=submit]'
|
414
|
+
def close
|
415
|
+
close_button.click
|
416
|
+
self.wait_until_hidden(3)
|
417
|
+
end
|
555
418
|
|
556
|
-
def
|
557
|
-
|
558
|
-
search_button.click
|
419
|
+
def verify_closed
|
420
|
+
verify_ui_states(close_button => { visible: false })
|
559
421
|
end
|
560
422
|
end
|
561
423
|
|
562
424
|
|
563
|
-
### Adding
|
425
|
+
### Adding ScreenSections to your ScreenObject
|
564
426
|
|
565
|
-
You add a
|
427
|
+
You add a `ScreenSection` to its associated `ScreenObject` as shown below:
|
566
428
|
|
567
|
-
class
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
# Home page Section Objects
|
573
|
-
section :search_form, SearchForm
|
429
|
+
class BaseAppScreen < TestCentricity::ScreenObject
|
430
|
+
# Base App screen UI elements
|
431
|
+
label :header_label, { accessibility_id: 'container header' }
|
432
|
+
sections nav_bar: NavBar,
|
433
|
+
nav_menu: NavMenu
|
574
434
|
end
|
575
435
|
|
576
|
-
Once your
|
436
|
+
Once your `ScreenObject` has been instantiated, you can call its `ScreenSection` methods as shown below:
|
437
|
+
|
438
|
+
base_screen.nav_menu.verify_ui
|
577
439
|
|
578
|
-
home_page.search_form.search_for('ocarina')
|
579
|
-
|
580
|
-
|
581
440
|
|
582
|
-
##
|
441
|
+
## AppUIElements
|
583
442
|
|
584
|
-
|
585
|
-
|
586
|
-
|
443
|
+
Native app `ScreenObjects` and `ScreenSections` are typically made up of **UI Element** like text fields, switches, lists,
|
444
|
+
buttons, etc. **UI Elements** are declared and instantiated within the class definition of the `ScreenObject` or `ScreenSection`
|
445
|
+
in which they are contained. With TestCentricity, all native app screen UI elements are based on the `AppUIElement` class.
|
587
446
|
|
588
447
|
|
589
|
-
### Declaring and Instantiating
|
448
|
+
### Declaring and Instantiating AppUIElements
|
590
449
|
|
591
|
-
Single
|
592
|
-
|
593
|
-
elementType :element Name, locator
|
450
|
+
Single `AppUIElement` declarations have the following format:
|
594
451
|
|
595
|
-
|
596
|
-
* The `locator` is the CSS or XPath attribute that uniquely and unambiguously identifies the UI element.
|
452
|
+
elementType :elementName, { locator_strategy, locator_identifier }
|
597
453
|
|
598
|
-
|
599
|
-
|
454
|
+
* The `elementName` is the unique name that you will use to refer to the UI element and is specified as a `Symbol`.
|
455
|
+
* The `locator_strategy` specifies the [selector strategy](https://appium.io/docs/en/commands/element/find-elements/index.html#selector-strategies)
|
456
|
+
that Appium will use to find the `AppUIElement`. Valid selectors are `accessibility_id:`, `id:`, `name:`, `class:`, `xpath:`,
|
457
|
+
`predicate:` (iOS only), `class_chain:` (iOS only), and `css:` (WebViews in hybrid apps only).
|
458
|
+
* The `locator_identifier` is the value or attribute that uniquely and unambiguously identifies the `AppUIElement`.
|
600
459
|
|
601
|
-
|
460
|
+
Multiple `AppUIElement` declarations for a collection of elements of the same type can be performed by passing a hash table
|
461
|
+
containing the names and locators of each individual element.
|
602
462
|
|
603
|
-
|
463
|
+
### Example AppUIElement Declarations
|
464
|
+
|
465
|
+
Supported `AppUIElement` elementTypes and their declarations have the following format:
|
604
466
|
|
605
467
|
*Single element declarations:*
|
606
468
|
|
607
|
-
class
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
image :image_name, locator
|
619
|
-
filefield :filefield_name, locator
|
620
|
-
|
469
|
+
class SampleScreen < TestCentricity::ScreenObject
|
470
|
+
button :button_name, { locator_strategy, locator_identifier }
|
471
|
+
textfield :field_name, { locator_strategy, locator_identifier }
|
472
|
+
checkbox :checkbox_name, { locator_strategy, locator_identifier }
|
473
|
+
label :label_name, { locator_strategy, locator_identifier }
|
474
|
+
selectlist :select_name, { locator_strategy, locator_identifier }
|
475
|
+
list :list_name, { locator_strategy, locator_identifier }
|
476
|
+
image :image_name, { locator_strategy, locator_identifier }
|
477
|
+
switch :switch_name, { locator_strategy, locator_identifier }
|
478
|
+
element :element_name, { locator_strategy, locator_identifier }
|
479
|
+
alert :alert_name, { locator_strategy, locator_identifier }
|
621
480
|
end
|
622
|
-
|
481
|
+
|
623
482
|
*Multiple element declarations:*
|
624
483
|
|
625
|
-
class
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
label_X_name: locator
|
640
|
-
links link_1_name: locator,
|
641
|
-
link_X_name: locator
|
642
|
-
selectlists selectlist_1_name: locator,
|
643
|
-
selectlist_X_name: locator
|
644
|
-
lists list_1_name: locator,
|
645
|
-
list_X_name: locator
|
646
|
-
tables table_1_name: locator,
|
647
|
-
table_X_name: locator
|
648
|
-
images image_1_name: locator,
|
649
|
-
image_X_name: locator
|
650
|
-
filefields filefield_1_name: locator,
|
651
|
-
filefield_X_name: locator
|
652
|
-
|
484
|
+
class SampleScreen < TestCentricity::ScreenObject
|
485
|
+
buttons button_1_name: { locator_strategy, locator_identifier },
|
486
|
+
button_2_name: { locator_strategy, locator_identifier },
|
487
|
+
button_X_name: { locator_strategy, locator_identifier }
|
488
|
+
textfields field_1_name: { locator_strategy, locator_identifier },
|
489
|
+
field_2_name: { locator_strategy, locator_identifier },
|
490
|
+
field_X_name: { locator_strategy, locator_identifier }
|
491
|
+
checkboxes check_1_name: { locator_strategy, locator_identifier },
|
492
|
+
check_2_name: { locator_strategy, locator_identifier },
|
493
|
+
check_X_name: { locator_strategy, locator_identifier }
|
494
|
+
labels label_1_name: { locator_strategy, locator_identifier },
|
495
|
+
label_X_name: { locator_strategy, locator_identifier }
|
496
|
+
images image_1_name: { locator_strategy, locator_identifier },
|
497
|
+
image_X_name: { locator_strategy, locator_identifier }
|
653
498
|
end
|
654
499
|
|
500
|
+
Refer to the Class List documentation for the `ScreenObject` and `ScreenSection` classes for details on the class methods used
|
501
|
+
for declaring and instantiating `AppUIElements`. Examples of UI element declarations can be found in the ***Adding UI Elements
|
502
|
+
to your ScreenObject*** and ***Adding UI Elements to your ScreenSection*** sections above.
|
655
503
|
|
656
|
-
Refer to the Class List documentation for the **PageObject** and **PageSection** classes for details on the class methods used for declaring
|
657
|
-
and instantiating **UI Elements**. Examples of UI element declarations can be found in the ***Adding UI Elements to your Page Object*** and
|
658
|
-
***Adding UI Elements to your PageSection Object*** sections above.
|
659
504
|
|
505
|
+
### AppUIElement Inherited Methods
|
660
506
|
|
661
|
-
|
662
|
-
|
663
|
-
With TestCentricity, all UI elements are based on the **UIElement** class, and inherit the following methods:
|
507
|
+
With TestCentricity, all native app UI elements are based on the `AppUIElement` class, and inherit the following methods:
|
664
508
|
|
665
509
|
**Action methods:**
|
666
510
|
|
667
511
|
element.click
|
668
|
-
element.
|
669
|
-
element.
|
670
|
-
element.
|
671
|
-
element.
|
672
|
-
element.
|
673
|
-
element.drag_and_drop(target, right_offset, down_offset)
|
512
|
+
element.tap
|
513
|
+
element.double_tap
|
514
|
+
element.hover_at(x, y)
|
515
|
+
element.scroll(direction)
|
516
|
+
element.swipe(direction)
|
674
517
|
|
675
518
|
**Object state methods:**
|
676
519
|
|
@@ -679,15 +522,14 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
|
|
679
522
|
element.hidden?
|
680
523
|
element.enabled?
|
681
524
|
element.disabled?
|
682
|
-
element.
|
683
|
-
element.
|
525
|
+
element.selected?
|
526
|
+
element.tag_name
|
684
527
|
element.width
|
685
528
|
element.height
|
686
|
-
element.
|
687
|
-
element.
|
529
|
+
element.x_loc
|
530
|
+
element.y_loc
|
688
531
|
element.get_attribute(attrib)
|
689
|
-
|
690
|
-
|
532
|
+
|
691
533
|
**Waiting methods:**
|
692
534
|
|
693
535
|
element.wait_until_exists(seconds)
|
@@ -698,79 +540,260 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
|
|
698
540
|
element.wait_until_value_changes(seconds)
|
699
541
|
|
700
542
|
|
701
|
-
|
543
|
+
### Populating your ScreenObject or ScreenSection with data
|
702
544
|
|
703
|
-
|
704
|
-
|
705
|
-
|
545
|
+
A typical automated test may be required to perform the entry of test data by interacting with various `AppUIElements` on your
|
546
|
+
`ScreenObject` or `ScreenSection`. This data entry can be performed using the various object action methods (listed above) for
|
547
|
+
each `AppUIElement` that needs to be interacted with.
|
706
548
|
|
707
|
-
|
549
|
+
The `ScreenObject.populate_data_fields` and `ScreenSection.populate_data_fields` methods support the entry of test data into a
|
550
|
+
collection of `AppUIElements`. The `populate_data_fields` method accepts a hash containing key/hash pairs of `AppUIElements`
|
551
|
+
and their associated data to be entered. Data values must be in the form of a `String` for `textfield` controls. For `checkbox`
|
552
|
+
controls, data must either be a `Boolean` or a `String` that evaluates to a `Boolean` value (Yes, No, 1, 0, true, false).
|
708
553
|
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
554
|
+
The `populate_data_fields` method verifies that data attributes associated with each `AppUIElement` is not `nil` or `empty`
|
555
|
+
before attempting to enter data into the `AppUIElement`.
|
556
|
+
|
557
|
+
The optional `wait_time` parameter is used to specify the time (in seconds) to wait for each `AppUIElement` to become viable
|
558
|
+
for data entry (the `AppUIElement` must be visible and enabled) before entering the associated data value. This option is
|
559
|
+
useful in situations where entering data, or setting the state of a `AppUIElement` might cause other `AppUIElements` to become
|
560
|
+
visible or active. Specifying a wait_time value ensures that the subsequent `AppUIElements` will be ready to be interacted with
|
561
|
+
as states are changed. If the wait time is `nil`, then the wait time will be 5 seconds.
|
562
|
+
|
563
|
+
def enter_data(user_data)
|
564
|
+
fields = {
|
565
|
+
first_name_field => user_data.first_name,
|
566
|
+
last_name_field => user_data.last_name,
|
567
|
+
email_field => user_data.email,
|
568
|
+
phone_number_field => user_data.phone_number
|
569
|
+
}
|
570
|
+
populate_data_fields(fields, wait_time = 2)
|
725
571
|
end
|
726
|
-
|
727
|
-
World(WorldPages)
|
728
572
|
|
729
|
-
The `WorldPages` module above can be defined in your `env.rb` file, or you can define it in a separate `world_pages.rb` file in the
|
730
|
-
`features/support` folder.
|
731
573
|
|
732
|
-
|
733
|
-
cumbersome to manage if your web application has dozens of **Page Objects** that need to be instantiated and managed.
|
574
|
+
### Verifying AppUIElements on your ScreenObject or ScreenSection
|
734
575
|
|
735
|
-
|
576
|
+
A typical automated test executes one or more interactions with the user interface, and then performs a validation to verify
|
577
|
+
whether the expected state of the UI has been achieved. This verification can be performed using the various object state methods
|
578
|
+
(listed above) for each `AppUIElement` that requires verification. Depending on the complexity and number of `AppUIElements` to
|
579
|
+
be verified, the code required to verify the presence of `AppUIElements` and their correct states can become cumbersome.
|
580
|
+
|
581
|
+
The `ScreenObject.verify_ui_states` and `ScreenSection.verify_ui_states` methods support the verification of multiple properties
|
582
|
+
of multiple UI elements on a `ScreenObject` or `ScreenSection`. The `verify_ui_states` method accepts a hash containing key/hash
|
583
|
+
pairs of UI elements and their properties or attributes to be verified.
|
584
|
+
|
585
|
+
ui = {
|
586
|
+
object1 => { property: state },
|
587
|
+
object2 => { property: state, property: state },
|
588
|
+
object3 => { property: state }
|
589
|
+
}
|
590
|
+
verify_ui_states(ui)
|
591
|
+
|
592
|
+
The `verify_ui_states` method queues up any exceptions that occur while verifying each object's properties until all `AppUIElements`
|
593
|
+
and their properties have been checked, and then posts any exceptions encountered upon completion. Posted exceptions include a
|
594
|
+
screenshot of the screen where expected results did not match actual results.
|
595
|
+
|
596
|
+
The `verify_ui_states` method supports the following property/state pairs:
|
597
|
+
|
598
|
+
**All Objects:**
|
599
|
+
|
600
|
+
:exists Boolean
|
601
|
+
:enabled Boolean
|
602
|
+
:disabled Boolean
|
603
|
+
:visible Boolean
|
604
|
+
:hidden Boolean
|
605
|
+
:width Integer
|
606
|
+
:height Integer
|
607
|
+
:x Integer
|
608
|
+
:y Integer
|
609
|
+
:class String
|
610
|
+
:value or :caption String
|
611
|
+
:attribute Hash
|
612
|
+
|
613
|
+
**Text Fields:**
|
614
|
+
|
615
|
+
:placeholder String
|
616
|
+
:readonly Boolean (WebViews only)
|
617
|
+
:maxlength Integer (WebViews only)
|
618
|
+
|
619
|
+
**Checkboxes:**
|
620
|
+
|
621
|
+
:checked Boolean
|
622
|
+
|
623
|
+
#### Comparison States
|
624
|
+
|
625
|
+
The `verify_ui_states` method supports comparison states using property/comparison state pairs:
|
626
|
+
|
627
|
+
object => { property: { comparison_state: value } }
|
628
|
+
|
629
|
+
Comparison States:
|
630
|
+
|
631
|
+
:lt or :less_than Integer or String
|
632
|
+
:lt_eq or :less_than_or_equal Integer or String
|
633
|
+
:gt or :greater_than Integer or String
|
634
|
+
:gt_eq or :greater_than_or_equal Integer or String
|
635
|
+
:starts_with String
|
636
|
+
:ends_with String
|
637
|
+
:contains String
|
638
|
+
:not_contains or :does_not_contain Integer or String
|
639
|
+
:not_equal Integer, String, or Boolean
|
640
|
+
|
641
|
+
|
642
|
+
#### I18n Translation Validation
|
643
|
+
|
644
|
+
The `verify_ui_states` method also supports I18n string translations using property/I18n key name pairs:
|
645
|
+
|
646
|
+
object => { property: { translate_key: 'name of key in I18n compatible .yml file' } }
|
647
|
+
|
648
|
+
**I18n Translation Keys:**
|
649
|
+
|
650
|
+
:translate String
|
651
|
+
:translate_upcase String
|
652
|
+
:translate_downcase String
|
653
|
+
:translate_capitalize String
|
654
|
+
:translate_titlecase String
|
655
|
+
|
656
|
+
The example below depicts the usage of the `verify_ui_states` method to verify that the captions for menu items are correctly
|
657
|
+
translated.
|
658
|
+
|
659
|
+
def verify_menu
|
660
|
+
ui = {
|
661
|
+
account_settings_item => { visible: true, caption: { translate: 'Header.settings.account' } },
|
662
|
+
help_item => { visible: true, caption: { translate: 'Header.settings.help' } },
|
663
|
+
feedback_item => { visible: true, caption: { translate: 'Header.settings.feedback' } },
|
664
|
+
legal_item => { visible: true, caption: { translate: 'Header.settings.legal' } },
|
665
|
+
institution_item => { visible: true, caption: { translate: 'Header.settings.institution' } },
|
666
|
+
configurations_item => { visible: true, caption: { translate: 'Header.settings.configurations' } },
|
667
|
+
contact_us_item => { visible: true, caption: { translate: 'Header.settings.contact' } },
|
668
|
+
downloads_item => { visible: true, caption: { translate: 'Header.settings.downloads' } }
|
669
|
+
}
|
670
|
+
verify_ui_states(ui)
|
671
|
+
end
|
672
|
+
|
673
|
+
Each supported language/locale combination has a corresponding `.yml` file. I18n `.yml` file naming convention uses
|
674
|
+
[ISO-639 language codes and ISO-3166 country codes](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html).
|
675
|
+
For example:
|
676
|
+
|
677
|
+
| Language (Country) | File name |
|
678
|
+
|-----------------------|-----------|
|
679
|
+
| English | en.yml |
|
680
|
+
| English (Canada) | en-CA.yml |
|
681
|
+
| French (Canada) | fr-CA.yml |
|
682
|
+
| French | fr.yml |
|
683
|
+
| Spanish | es.yml |
|
684
|
+
| German | de.yml |
|
685
|
+
| Portuguese (Brazil) | pt-BR.yml |
|
686
|
+
| Portuguese (Portugal) | pt-PT.yml |
|
687
|
+
|
688
|
+
I18n `.yml` files contain key/value pairs representing the name of a translated string (key) and the string value.
|
689
|
+
|
690
|
+
Baseline translation strings are stored in `.yml` files in the `config/locales/` folder.
|
691
|
+
|
692
|
+
my_automation_project
|
693
|
+
├── config
|
694
|
+
│ ├── locales
|
695
|
+
│ │ ├── en.yml
|
696
|
+
│ │ ├── es.yml
|
697
|
+
│ │ ├── fr.yml
|
698
|
+
│ │ ├── fr-CA.yml
|
699
|
+
│ │ └── en-AU.yml
|
700
|
+
│ ├── test_data
|
701
|
+
│ └── cucumber.yml
|
702
|
+
├── features
|
703
|
+
├── Gemfile
|
704
|
+
└── README.md
|
705
|
+
|
706
|
+
|
707
|
+
## Instantiating ScreenObjects and Utilizing the PageManager
|
708
|
+
|
709
|
+
Before you can call the methods in your `ScreenObjects` and `ScreenSections`, you must instantiate the `ScreenObjects` of your
|
710
|
+
native mobile application, as well as create instance variables which can be used when calling `ScreenObject` methods from
|
711
|
+
your step definitions or specs.
|
712
|
+
|
713
|
+
The `PageManager` class provides methods for supporting the instantiation and management of `ScreenObjects` and `PageObjects`.
|
714
|
+
In the code example below, the `page_objects` method contains a hash table of your `ScreenObject` instances and their associated
|
715
|
+
`ScreenObject` classes to be instantiated by `PageManager`:
|
736
716
|
|
737
|
-
The **PageManager** class provides methods for supporting the instantiation and management of **Page Objects**. In the code example below,
|
738
|
-
the `page_objects` method contains a hash table of your **Page Object** instances and their associated **Page Object** class names
|
739
|
-
to be instantiated by **PageManager**:
|
740
|
-
|
741
717
|
module WorldPages
|
742
718
|
def page_objects
|
743
|
-
{
|
744
|
-
:
|
745
|
-
:
|
746
|
-
:
|
747
|
-
:
|
748
|
-
:
|
749
|
-
:
|
750
|
-
:
|
751
|
-
:
|
752
|
-
:
|
753
|
-
:
|
754
|
-
:my_ship_to_addresses_page => MyShipToAddressesPage,
|
755
|
-
:terms_conditions_page => TermsConditionsPage,
|
756
|
-
:privacy_policy_page => PrivacyPolicyPage,
|
757
|
-
:faqs_page => FAQsPage,
|
758
|
-
:contact_us_page => ContactUsPage
|
719
|
+
{
|
720
|
+
login_screen: LoginScreen,
|
721
|
+
registration_screen: RegistrationScreen,
|
722
|
+
search_results_screen: SearchResultsScreen,
|
723
|
+
products_grid_screen: ProductsCollectionScreen,
|
724
|
+
product_detail_screen: ProductDetailScreen,
|
725
|
+
shopping_basket_screen: ShoppingBasketScreen,
|
726
|
+
payment_method_screen: PaymentMethodScreen,
|
727
|
+
confirm_purchase_screen: PurchaseConfirmationScreen,
|
728
|
+
my_account_screen: MyAccountScreen,
|
729
|
+
my_order_history_screen: MyOrderHistoryScreen
|
759
730
|
}
|
760
731
|
end
|
761
732
|
end
|
762
733
|
|
763
734
|
World(WorldPages)
|
764
|
-
|
735
|
+
|
736
|
+
|
765
737
|
The `WorldPages` module above should be defined in the `world_pages.rb` file in the `features/support` folder.
|
766
738
|
|
767
|
-
Include the code below in your `env.rb` file to ensure that your
|
768
|
-
executed:
|
769
|
-
|
739
|
+
Include the code below in your `env.rb` file to ensure that your `ScreenObjects` are instantiated before your Cucumber scenarios
|
740
|
+
are executed:
|
741
|
+
|
770
742
|
include WorldPages
|
771
743
|
WorldPages.instantiate_page_objects
|
772
|
-
|
773
|
-
**NOTE:** If you intend to use the
|
744
|
+
|
745
|
+
**NOTE:** If you intend to use the `PageManager`, you must define a `page_name` trait for each of the `ScreenObjects` to be registered.
|
746
|
+
|
747
|
+
|
748
|
+
### Instantiating ScreenObjects and PageObjects for a combined native iOS/Android app and web app
|
749
|
+
|
750
|
+
If your native mobile apps share feature parity with a responsive desktop/mobile web UI, you can define iOS and Android specific
|
751
|
+
`ScreenObjects` and the corresponding web specific `PageObjects`. If you use the `PLATFORM` Environment Variable to specify the target
|
752
|
+
test platform (`ios`, `android`, or `web`) at test run time, the following implementation of the `page_objects` method will ensure
|
753
|
+
instantiation of the correct `ScreenObjects` or `PageObjects` at run time:
|
754
|
+
|
755
|
+
module WorldPages
|
756
|
+
def page_objects
|
757
|
+
case ENV['PLATFORM'].downcase.to_sym
|
758
|
+
when :ios, :android
|
759
|
+
native_app_screen_objects
|
760
|
+
when :web
|
761
|
+
web_page_objects
|
762
|
+
end
|
763
|
+
end
|
764
|
+
end
|
765
|
+
|
766
|
+
def native_app_screen_objects
|
767
|
+
{
|
768
|
+
login_screen: LoginScreen,
|
769
|
+
registration_screen: RegistrationScreen,
|
770
|
+
search_results_screen: SearchResultsScreen,
|
771
|
+
products_grid_screen: ProductsCollectionScreen,
|
772
|
+
product_detail_screen: ProductDetailScreen,
|
773
|
+
shopping_basket_screen: ShoppingBasketScreen,
|
774
|
+
payment_method_screen: PaymentMethodScreen,
|
775
|
+
confirm_purchase_screen: PurchaseConfirmationScreen,
|
776
|
+
my_account_screen: MyAccountScreen,
|
777
|
+
my_order_history_screen: MyOrderHistoryScreen
|
778
|
+
}
|
779
|
+
end
|
780
|
+
|
781
|
+
def web_page_objects
|
782
|
+
{
|
783
|
+
login_screen: LoginPage,
|
784
|
+
registration_screen: RegistrationPage,
|
785
|
+
search_results_screen: SearchResultsPage,
|
786
|
+
products_grid_screen: ProductsCollectionPage,
|
787
|
+
product_detail_screen: ProductDetailPage,
|
788
|
+
shopping_basket_screen: ShoppingBasketPage,
|
789
|
+
payment_method_screen: PaymentMethodPage,
|
790
|
+
confirm_purchase_screen: PurchaseConfirmationPage,
|
791
|
+
my_account_screen: MyAccountPage,
|
792
|
+
my_order_history_screen: MyOrderHistoryPage
|
793
|
+
}
|
794
|
+
end
|
795
|
+
|
796
|
+
World(WorldPages)
|
774
797
|
|
775
798
|
|
776
799
|
### Leveraging the PageManager in your Cucumber tests
|
@@ -778,914 +801,449 @@ executed:
|
|
778
801
|
Many Cucumber based automated tests suites include scenarios that verify that web pages are correctly loaded, displayed, or can be
|
779
802
|
navigated to by clicking associated links. One such Cucumber navigation scenario is displayed below:
|
780
803
|
|
781
|
-
Scenario Outline: Verify
|
782
|
-
Given I am on the
|
783
|
-
When I
|
784
|
-
Then I expect the <
|
785
|
-
|
804
|
+
Scenario Outline: Verify screen navigation features
|
805
|
+
Given I am on the Products screen
|
806
|
+
When I tap the <screen_name> navigation menu item
|
807
|
+
Then I expect the <screen_name> screen to be correctly displayed
|
808
|
+
|
786
809
|
Examples:
|
787
|
-
|
|
788
|
-
|Registration
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
810
|
+
|screen_name |
|
811
|
+
|Registration |
|
812
|
+
|Shopping Basket |
|
813
|
+
|My Account |
|
814
|
+
|My Order History |
|
815
|
+
|
816
|
+
In the above example, the step definitions associated with the 3 steps can be implemented using the `PageManager.find_page` method
|
817
|
+
to match the specified `screen_name` argument with the corresponding `ScreenObject` as shown below:
|
818
|
+
|
819
|
+
include TestCentricity
|
820
|
+
|
821
|
+
When(/^I (?:load|am on) the (.*) (?:page|screen)$/) do |screen_name|
|
822
|
+
# find and load the specified target page/screen
|
823
|
+
target_page = PageManager.find_page(screen_name)
|
800
824
|
target_page.load_page
|
801
825
|
end
|
802
826
|
|
803
|
-
|
804
|
-
|
827
|
+
|
828
|
+
When(/^I (?:click|tap) the ([^\"]*) navigation menu item$/) do |screen_name|
|
829
|
+
# find and navigate to the specified target page/screen
|
830
|
+
target_page = PageManager.find_page(screen_name)
|
805
831
|
target_page.navigate_to
|
806
832
|
end
|
807
833
|
|
808
|
-
|
809
|
-
|
834
|
+
|
835
|
+
Then(/^I expect the (.*) (?:page|screen) to be correctly displayed$/) do |screen_name|
|
836
|
+
# find and verify that the specified target page/screen is loaded
|
837
|
+
target_page = PageManager.find_page(screen_name)
|
810
838
|
target_page.verify_page_exists
|
839
|
+
# verify that target page/screen is correctly displayed
|
811
840
|
target_page.verify_page_ui
|
812
841
|
end
|
813
|
-
|
814
|
-
# this method takes a page name as a parameter and returns an instance of the associated Page Object
|
815
|
-
def page_dispatcher(page_name)
|
816
|
-
case page_name
|
817
|
-
when 'Registration'
|
818
|
-
page = registration_page
|
819
|
-
when 'My Account'
|
820
|
-
page = my_account_page
|
821
|
-
when 'Terms & Conditions'
|
822
|
-
page = terms_conditions_page
|
823
|
-
when 'Privacy Policy'
|
824
|
-
page = privacy_policy_page
|
825
|
-
when 'Contact Us'
|
826
|
-
page = contact_us_page
|
827
|
-
when 'FAQs'
|
828
|
-
page = faqs_page
|
829
|
-
end
|
830
|
-
raise "No page object defined for page named '#{page_name}'" unless page
|
831
|
-
page
|
832
|
-
end
|
833
842
|
|
834
843
|
|
835
|
-
While this approach may be effective for small web applications with only a few pages (and hence few **Page Objects**), it quickly becomes
|
836
|
-
cumbersome to manage if your web application has dozens of **Page Objects** that need to be managed.
|
837
844
|
|
838
|
-
|
839
|
-
above example. The **PageManager** `current_page` method allows you to set or get an instance of the currently active Page Object.
|
845
|
+
## Connecting to a Mobile Simulator or Device
|
840
846
|
|
841
|
-
|
842
|
-
|
847
|
+
The `AppiumConnect.initialize_appium` method configures the appropriate Appium capabilities required to establish a connection
|
848
|
+
with a locally or cloud hosted target iOS or Android simulator or real device.
|
843
849
|
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
target_page.navigate_to if target_page
|
856
|
-
end
|
857
|
-
|
858
|
-
Then(/^I expect to see the ([^\"]*) page$/) do |page_name|
|
859
|
-
target_page = page_dispatcher(page_name)
|
860
|
-
target_page.verify_page_exists if target_page
|
861
|
-
# let PageManager store an instance of the current page object
|
862
|
-
PageManager.current_page = target_page
|
863
|
-
end
|
864
|
-
|
865
|
-
Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
|
866
|
-
target_page = page_dispatcher(page_name)
|
867
|
-
target_page.verify_page_exists
|
868
|
-
target_page.verify_page_ui
|
869
|
-
# let PageManager store an instance of the current page object
|
870
|
-
PageManager.current_page = target_page
|
850
|
+
|
851
|
+
### Starting and stopping Appium Server
|
852
|
+
|
853
|
+
The Appium server must be running prior to invoking Cucumber to run your features/scenarios on locally hosted mobile simulators
|
854
|
+
or physical device. To programmatically control the starting and stopping of Appium server with the execution of your automated
|
855
|
+
tests, place the code shown below into your `hooks.rb` file.
|
856
|
+
|
857
|
+
BeforeAll do
|
858
|
+
# start Appium Server if command line option was specified and target browser is mobile simulator or device
|
859
|
+
if ENV['APPIUM_SERVER'] == 'run' && Environ.driver == :appium
|
860
|
+
end
|
871
861
|
end
|
872
862
|
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
863
|
+
AfterAll do
|
864
|
+
# terminate Appium Server if command line option was specified and target browser is mobile simulator or device
|
865
|
+
if ENV['APPIUM_SERVER'] == 'run' && Environ.driver == :appium && $server.running?
|
866
|
+
$server.stop
|
867
|
+
end
|
878
868
|
end
|
879
869
|
|
880
870
|
|
871
|
+
The `APPIUM_SERVER` environment variable must be set to `run` in order to programmatically start and stop Appium server. This can be
|
872
|
+
set by adding the following to your `cucumber.yml` file and including `-p run_appium` in your command line when starting your Cucumber
|
873
|
+
test suite(s):
|
881
874
|
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
### Locally hosted desktop web browser
|
893
|
-
|
894
|
-
For locally hosted desktop web browsers running on macOS (OS X) or Windows platforms, the `WEB_BROWSER` Environment Variable must be set to one of the
|
895
|
-
values from the table below:
|
896
|
-
|
897
|
-
`WEB_BROWSER` | **Desktop Platform**
|
898
|
-
--------------|----------------
|
899
|
-
`firefox` | macOS (OS X) or Windows
|
900
|
-
`chrome` | macOS (OS X) or Windows
|
901
|
-
`safari` | macOS (OS X) only
|
902
|
-
`ie` | Windows only
|
903
|
-
`poltergeist` | macOS (OS X) or Windows
|
904
|
-
|
905
|
-
To set the size of a desktop browser window, you set the `BROWSER_SIZE` Environment Variable to the desired width and height in pixels as shown below:
|
906
|
-
|
907
|
-
BROWSER_SIZE=1600,1000
|
908
|
-
|
909
|
-
To maximize a desktop browser window, you set the `BROWSER_SIZE` Environment Variable to 'max' as shown below:
|
910
|
-
|
911
|
-
BROWSER_SIZE=max
|
912
|
-
|
913
|
-
|
914
|
-
### Locally hosted emulated mobile web browser
|
915
|
-
|
916
|
-
You can run your tests against mobile device browsers that are emulated within a locally hosted instance of a Chrome desktop browser on OS X or
|
917
|
-
Windows. The specified mobile browser's user agent, CSS screen dimensions, and default screen orientation will be automatically set within the
|
918
|
-
local Chrome browser instance. You may even specify the emulated device's screen orientation. For locally hosted emulated mobile web browsers,
|
919
|
-
the `WEB_BROWSER` Environment Variable must be set to one of the values from the table below:
|
920
|
-
|
921
|
-
`WEB_BROWSER` | `HOST_BROWSER` | **CSS Screen Dimensions** | **Default Orientation** | **OS Version**
|
922
|
-
----------------------|----------------------|-----------|----------|---------
|
923
|
-
`ipad` |`chrome` |1024 x 768 |landscape |iOS 10
|
924
|
-
`ipad_pro` |`chrome` |1366 x 1024|landscape |iOS 11
|
925
|
-
`ipad_pro_10_5` |`chrome` |1112 x 834 |landscape |iOS 11
|
926
|
-
`ipad_chrome` |`chrome` |1024 x 768 |landscape |iOS 10 - Mobile Chrome browser for iOS
|
927
|
-
`ipad_firefox` |`chrome` |1024 x 768 |landscape |iOS 10 - Mobile Firefox browser for iOS
|
928
|
-
`ipad_edge` |`chrome` |1024 x 768 |landscape |iOS 10 - Mobile Edge browser for iOS
|
929
|
-
`android_tablet` |`chrome` |1024 x 768 |landscape |Android 3.0
|
930
|
-
`kindle_fire` |`chrome` |1024 x 600 |landscape |
|
931
|
-
`kindle_firehd7` |`chrome` |800 x 480 |landscape |Fire OS 3
|
932
|
-
`kindle_firehd8` |`chrome` |1280 x 800 |landscape |Fire OS 5
|
933
|
-
`kindle_firehd10` |`chrome` |1920 x 1200 |landscape |Fire OS 5
|
934
|
-
`surface` |`chrome` |1366 x 768 |landscape |
|
935
|
-
`blackberry_playbook` |`chrome` |1024 x 600 |landscape |BlackBerry Tablet OS
|
936
|
-
`samsung_galaxy_tab` |`chrome` |1280 x 800 |landscape |Android 4.0.4
|
937
|
-
`google_nexus7` |`chrome` |960 x 600 |landscape |Android 4.4.4
|
938
|
-
`google_nexus9` |`chrome` |1024 x 768 |landscape |Android 5.1
|
939
|
-
`google_nexus10` |`chrome` |1280 x 800 |landscape |Android 5.1
|
940
|
-
`iphone` |`chrome` |320 x 480 |portrait |iOS 9.1
|
941
|
-
`iphone4` |`chrome` |320 x 480 |portrait |iOS 9.1
|
942
|
-
`iphone5` |`chrome` |320 x 568 |portrait |iOS 9.1
|
943
|
-
`iphone6` |`chrome` |375 x 667 |portrait |iOS 9.1
|
944
|
-
`iphone6_plus` |`chrome` |414 x 736 |portrait |iOS 9.1
|
945
|
-
`iphone7` |`chrome` |375 x 667 |portrait |iOS 10
|
946
|
-
`iphone7_plus` |`chrome` |414 x 736 |portrait |iOS 10
|
947
|
-
`iphone7_chrome` |`chrome` |375 x 667 |portrait |iOS 10 - Mobile Chrome browser for iOS
|
948
|
-
`iphone7_firefox` |`chrome` |375 x 667 |portrait |iOS 10 - Mobile Firefox browser for iOS
|
949
|
-
`iphone7_edge` |`chrome` |375 x 667 |portrait |iOS 10 - Microsoft Edge browser for iOS
|
950
|
-
`iphone8` |`chrome` |375 x 667 |portrait |iOS 11
|
951
|
-
`iphone8_plus` |`chrome` |414 x 736 |portrait |iOS 11
|
952
|
-
`iphonex` |`chrome` |375 x 812 |portrait |iOS 11
|
953
|
-
`android_phone` |`chrome` |360 x 640 |portrait |Android 4.2.1
|
954
|
-
`nexus6` |`chrome` |411 x 731 |portrait |Android 6
|
955
|
-
`pixel` |`chrome` |411 x 731 |portrait |Android 8
|
956
|
-
`pixel_xl` |`chrome` |411 x 731 |portrait |Android 8
|
957
|
-
`samsung_galaxy_s4` |`chrome` |360 x 640 |portrait |Android 5.0.1
|
958
|
-
`samsung_galaxy_s5` |`chrome` |360 x 640 |portrait |Android 6.0.1
|
959
|
-
`samsung_galaxy_s6` |`chrome` |360 x 640 |portrait |Android 6.0.1
|
960
|
-
`windows_phone7` |`chrome` |320 x 480 |portrait |Windows Phone OS 7.5
|
961
|
-
`windows_phone8` |`chrome` |320 x 480 |portrait |Windows Phone OS 8.0
|
962
|
-
`lumia_950_xl` |`chrome` |360 x 640 |portrait |Windows Phone OS 10
|
963
|
-
`blackberry_z10` |`chrome` |384 x 640 |portrait |BlackBerry 10 OS
|
964
|
-
`blackberry_z30` |`chrome` |360 x 640 |portrait |BlackBerry 10 OS
|
965
|
-
`blackberry_leap` |`chrome` |360 x 640 |portrait |BlackBerry 10 OS
|
966
|
-
`blackberry_passport` |`chrome` |504 x 504 |square |BlackBerry 10 OS
|
967
|
-
|
968
|
-
To change the emulated device's screen orientation from the default setting, set the `ORIENTATION` Environment Variable to either `portrait` or `landscape`.
|
969
|
-
|
970
|
-
To use a local instance of the Chrome desktop browser to host the emulated mobile web browser, you must set the `HOST_BROWSER` Environment Variable
|
971
|
-
to `chrome`.
|
972
|
-
|
973
|
-
|
974
|
-
### Mobile Safari browser on iOS Simulators or iOS Physical Devices
|
975
|
-
|
976
|
-
You can run your mobile web tests against the mobile Safari browser on simulated iOS devices or physically connected iOS devices using Appium and XCode on
|
977
|
-
OS X. You must install Appium, XCode, and the iOS version-specific device simulators for XCode. You must also ensure that the `appium_capybara` gem is
|
978
|
-
installed and required as described in **section 2.4 (Setup - Using Appium)** above.
|
979
|
-
|
980
|
-
Information about Appium setup and configuration requirements for testing on physically connected iOS devices can be found on [this page](https://github.com/appium/appium/blob/master/docs/en/drivers/ios-xcuitest-real-devices.md).
|
875
|
+
run_appium: APPIUM_SERVER=run
|
876
|
+
|
877
|
+
|
878
|
+
### Connecting to Locally Hosted iOS Simulators or Physical Devices
|
879
|
+
|
880
|
+
You can run your automated tests on locally hosted iOS simulators or physically connected devices using Appium and XCode on macOS. You
|
881
|
+
must install Appium, XCode, and the iOS version-specific device simulators for XCode. Information about Appium setup and configuration
|
882
|
+
requirements for testing on physically connected iOS devices can be found on [this page](https://github.com/appium/appium/blob/master/docs/en/drivers/ios-xcuitest-real-devices.md).
|
981
883
|
The Appium server must be running prior to invoking Cucumber to run your features/scenarios.
|
982
884
|
|
983
885
|
Once your test environment is properly configured, the following **Environment Variables** must be set as described in the table below.
|
984
886
|
|
985
|
-
**Environment Variable**
|
986
|
-
|
987
|
-
`WEB_BROWSER`
|
988
|
-
`APP_PLATFORM_NAME`
|
989
|
-
`
|
990
|
-
`APP_VERSION`
|
991
|
-
`APP_DEVICE`
|
992
|
-
`DEVICE_TYPE`
|
993
|
-
`APP_UDID`
|
994
|
-
`TEAM_ID`
|
995
|
-
`TEAM_NAME`
|
996
|
-
`
|
997
|
-
`
|
998
|
-
`
|
999
|
-
`
|
1000
|
-
`
|
1001
|
-
`
|
1002
|
-
`
|
1003
|
-
`LANGUAGE` | [Optional] Language to set for the simulator. e.g. `fr`
|
1004
|
-
`ORIENTATION` | [Optional] Set to `portrait` or `landscape` (only for iOS simulators)
|
1005
|
-
`NEW_COMMAND_TIMEOUT` | [Optional] Time (in Seconds) that Appium will wait for a new command from the client
|
1006
|
-
|
1007
|
-
|
1008
|
-
### Mobile Chrome or Android browsers on Android Studio Virtual Device emulators
|
1009
|
-
|
1010
|
-
You can run your mobile web tests against the mobile Chrome or Android browser on emulated Android devices using Appium and Android Studio on OS X. You
|
1011
|
-
must install Android Studio, the desired Android version-specific virtual device emulators, and Appium. Refer to [this page](https://github.com/appium/ruby_console/blob/master/osx.md)
|
1012
|
-
for information on configuring Appium to work with the Android SDK. You must also ensure that the `appium_capybara` gem is installed and required as
|
1013
|
-
described in **section 2.4 (Setup - Using Appium)** above.
|
1014
|
-
|
1015
|
-
The Appium server must be running prior to invoking Cucumber to run your features/scenarios. Refer to [this page](https://appium.io/docs/en/writing-running-appium/web/chromedriver/index.html)
|
1016
|
-
for information on configuring Appium to use the correct version of Chromedriver required to work with the web browser supported by each Android OS version.
|
887
|
+
| **Environment Variable** | **Description** |
|
888
|
+
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
889
|
+
| `WEB_BROWSER` | Must be set to `appium` |
|
890
|
+
| `APP_PLATFORM_NAME` | Must be set to `iOS` |
|
891
|
+
| `AUTOMATION_ENGINE` | Must be set to `XCUITest` |
|
892
|
+
| `APP_VERSION` | Must be set to `15.4`, `14.5`, or which ever iOS version you wish to run within the XCode Simulator |
|
893
|
+
| `APP_DEVICE` | Set to iOS device name supported by the iOS Simulator (`iPhone 13 Pro Max`, `iPad Pro (12.9-inch) (5th generation)`, etc.) or name of physically connected iOS device |
|
894
|
+
| `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
|
895
|
+
| `APP_UDID` | UDID of physically connected iOS device (not used for simulators) |
|
896
|
+
| `TEAM_ID` | unique 10-character Apple developer team identifier string (not used for simulators) |
|
897
|
+
| `TEAM_NAME` | String representing a signing certificate (not used for simulators) |
|
898
|
+
| `APP_NO_RESET` | [Optional] Don't reset app state after each test. Set to `true` or `false` |
|
899
|
+
| `APP_FULL_RESET` | [Optional] Perform a complete reset. Set to `true` or `false` |
|
900
|
+
| `WDA_LOCAL_PORT` | [Optional] Used to forward traffic from Mac host to real iOS devices over USB. Default value is same as port number used by WDA on device. |
|
901
|
+
| `LOCALE` | [Optional] Locale to set for the simulator. e.g. `fr_CA` |
|
902
|
+
| `LANGUAGE` | [Optional] Language to set for the simulator. e.g. `fr` |
|
903
|
+
| `ORIENTATION` | [Optional] Set to `portrait` or `landscape` (only for iOS simulators) |
|
904
|
+
| `NEW_COMMAND_TIMEOUT` | [Optional] Time (in Seconds) that Appium will wait for a new command from the client |
|
1017
905
|
|
1018
|
-
Once your test environment is properly configured, the following **Environment Variables** must be set as described in the table below.
|
1019
906
|
|
1020
|
-
|
1021
|
-
--------------- | ----------------
|
1022
|
-
`WEB_BROWSER` | Must be set to `appium`
|
1023
|
-
`APP_PLATFORM_NAME` | Must be set to `Android`
|
1024
|
-
`APP_BROWSER` | Must be set to `Chrome` or `Browser`
|
1025
|
-
`APP_VERSION` | Must be set to `8.0`, `7.0`, or which ever Android OS version you wish to run with the Android Virtual Device
|
1026
|
-
`APP_DEVICE` | Set to Android Virtual Device ID (`Pixel_2_XL_API_26`, `Nexus_6_API_23`, etc.) found in Advanced Settings of AVD Configuration
|
1027
|
-
`DEVICE_TYPE` | Must be set to `phone` or `tablet`
|
1028
|
-
`ORIENTATION` | [Optional] Set to `portrait` or `landscape`
|
1029
|
-
`APP_INITIAL_URL` | [Optional] Initial URL, default is a local welcome page. e.g. `http://www.apple.com`
|
1030
|
-
`APP_NO_RESET` | [Optional] Don't reset app state after each test. Set to `true` or `false`
|
1031
|
-
`APP_FULL_RESET` | [Optional] Perform a complete reset. Set to `true` or `false`
|
1032
|
-
`LOCALE` | [Optional] Locale to set for the simulator. e.g. `fr_CA`
|
1033
|
-
`LANGUAGE` | [Optional] Language to set for the simulator. e.g. `fr`
|
1034
|
-
`NEW_COMMAND_TIMEOUT` | [Optional] Time (in Seconds) that Appium will wait for a new command from the client
|
1035
|
-
`CHROMEDRIVER_EXECUTABLE` | [Optional] Absolute local path to webdriver executable
|
907
|
+
Refer to **section 9.5 (Using Configuration Specific Profiles in cucumber.yml)** below.
|
1036
908
|
|
1037
909
|
|
1038
|
-
###
|
910
|
+
### Connecting to Locally Hosted Android Simulators or Physical Devices
|
1039
911
|
|
1040
|
-
You can run your automated tests
|
1041
|
-
|
1042
|
-
|
912
|
+
You can run your automated tests on emulated Android devices using Appium and Android Studio on macOS. You must install Android
|
913
|
+
Studio, the desired Android version-specific virtual device emulators, and Appium. Refer to [this page](http://appium.io/docs/en/drivers/android-uiautomator2/index.html)
|
914
|
+
for information on configuring Appium to work with the Android SDK. The Appium server must be running prior to invoking Cucumber
|
915
|
+
to run your features/scenarios.
|
1043
916
|
|
917
|
+
Once your test environment is properly configured, the following **Environment Variables** must be set as described in the table below.
|
1044
918
|
|
1045
|
-
|
919
|
+
| **Environment Variable** | **Description** |
|
920
|
+
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------|
|
921
|
+
| `WEB_BROWSER` | Must be set to `appium` |
|
922
|
+
| `APP_PLATFORM_NAME` | Must be set to `Android` |
|
923
|
+
| `AUTOMATION_ENGINE` | Must be set to `UiAutomator2` |
|
924
|
+
| `APP_VERSION` | Must be set to `12.0`, or which ever Android OS version you wish to run with the Android Virtual Device |
|
925
|
+
| `APP_DEVICE` | Set to Android Virtual Device ID (`Pixel_2_XL_API_26`, `Nexus_6_API_23`, etc.) found in Advanced Settings of AVD Configuration |
|
926
|
+
| `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
|
927
|
+
| `APP_UDID` | UDID of physically connected Android device (not used for simulators) |
|
928
|
+
| `ORIENTATION` | [Optional] Set to `portrait` or `landscape` |
|
929
|
+
| `APP_NO_RESET` | [Optional] Don't reset app state after each test. Set to `true` or `false` |
|
930
|
+
| `APP_FULL_RESET` | [Optional] Perform a complete reset. Set to `true` or `false` |
|
931
|
+
| `LOCALE` | [Optional] Locale to set for the simulator. e.g. `fr_CA` |
|
932
|
+
| `LANGUAGE` | [Optional] Language to set for the simulator. e.g. `fr` |
|
933
|
+
| `NEW_COMMAND_TIMEOUT` | [Optional] Time (in Seconds) that Appium will wait for a new command from the client |
|
1046
934
|
|
1047
|
-
For remotely hosted desktop web browsers on the BrowserStack service, the following **Environment Variables** must be set as described in
|
1048
|
-
the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities#capabilities-browserstack)
|
1049
|
-
for information regarding the specific capabilities.
|
1050
935
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
`BS_AUTHKEY` | Must be set to your BrowserStack account access key
|
1056
|
-
`BS_OS` | Must be set to `OS X` or `Windows`
|
1057
|
-
`BS_OS_VERSION` | Refer to `os_version` capability in chart
|
1058
|
-
`BS_BROWSER` | Refer to `browser` capability in chart
|
1059
|
-
`BS_VERSION` | [Optional] Refer to `browser_version` capability in chart. If not specified, latest stable version of browser will be used.
|
1060
|
-
`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.
|
1061
|
-
`RESOLUTION` | [Optional] Refer to supported screen `resolution` capability in chart
|
1062
|
-
`BROWSER_SIZE` | [Optional] Specify width, height of browser window
|
1063
|
-
`RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
|
1064
|
-
`TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
|
1065
|
-
|
1066
|
-
If the BrowserStack Local instance is running (`TUNNELING` Environment Variable is `true`), call the`TestCentricity::WebDriverConnect.close_tunnel` method
|
1067
|
-
upon completion of your test suite to stop the Local instance. Place the code shown below in your `env.rb` file.
|
1068
|
-
|
1069
|
-
# Code to stop BrowserStack Local instance after end of test (if tunneling is enabled)
|
1070
|
-
at_exit do
|
1071
|
-
TestCentricity::WebDriverConnect.close_tunnel if Environ.tunneling
|
1072
|
-
end
|
936
|
+
Refer to **section 9.5 (Using Configuration Specific Profiles in cucumber.yml)** below.
|
937
|
+
|
938
|
+
|
939
|
+
### Connecting to Remote Cloud Hosted iOS and Android Simulators or Physical Devices
|
1073
940
|
|
941
|
+
You can run your automated tests against remote cloud hosted iOS and Android simulators and real devices using the BrowserStack,
|
942
|
+
SauceLabs, or TestingBot services. Refer to **section 9.5 (Using Configuration Specific Profiles in cucumber.yml)** below.
|
1074
943
|
|
1075
|
-
#### Remote mobile browsers on the BrowserStack service
|
1076
944
|
|
1077
|
-
|
1078
|
-
|
945
|
+
#### Remote iOS and Android Physical Devices on the BrowserStack service
|
946
|
+
|
947
|
+
For remotely hosted iOS and Android simulators and real devices on the BrowserStack service, the following **Environment Variables**
|
948
|
+
must be set as described in the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/app-automate/capabilities?tag=w3c)
|
1079
949
|
for information regarding the specific capabilities.
|
1080
950
|
|
1081
|
-
**Environment Variable** | **Description**
|
1082
|
-
|
1083
|
-
`WEB_BROWSER`
|
1084
|
-
`BS_USERNAME`
|
1085
|
-
`BS_AUTHKEY`
|
1086
|
-
`BS_OS`
|
1087
|
-
`
|
1088
|
-
`
|
1089
|
-
`
|
1090
|
-
`
|
1091
|
-
`
|
1092
|
-
|
1093
|
-
`
|
1094
|
-
`
|
1095
|
-
`
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
#### Remote
|
1100
|
-
|
1101
|
-
For remotely hosted
|
1102
|
-
the table below.
|
1103
|
-
information regarding the specific capabilities.
|
1104
|
-
|
1105
|
-
**Environment Variable** | **Description**
|
1106
|
-
|
1107
|
-
`WEB_BROWSER`
|
1108
|
-
`
|
1109
|
-
`
|
1110
|
-
`
|
1111
|
-
`
|
1112
|
-
`
|
1113
|
-
`
|
1114
|
-
`
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
`WEB_BROWSER` | Must be set to `crossbrowser`
|
1126
|
-
`CB_USERNAME` | Must be set to your CrossBrowserTesting account user name or email address
|
1127
|
-
`CB_AUTHKEY` | Must be set to your CrossBrowserTesting account access key
|
1128
|
-
`CB_PLATFORM` | Refer to `os_api_name` capability in the sample script of the Wizard
|
1129
|
-
`CB_BROWSER` | Refer to `browser_api_name` capability in the sample script of the Wizard
|
1130
|
-
`RESOLUTION` | Refer to supported `screen_resolution` capability in the sample script of the Wizard
|
1131
|
-
`DEVICE_TYPE` | Must be set to `phone` or `tablet`
|
1132
|
-
`RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
#### Remote desktop browsers on the Sauce Labs service
|
1137
|
-
|
1138
|
-
For remotely hosted desktop web browsers on the Sauce Labs service, the following **Environment Variables** must be set as described in
|
1139
|
-
the table below. Use the Selenium API on the [Platform Configurator page](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/) to obtain
|
1140
|
-
information regarding the specific capabilities.
|
1141
|
-
|
1142
|
-
**Environment Variable** | **Description**
|
1143
|
-
--------------- | ----------------
|
1144
|
-
`WEB_BROWSER` | Must be set to `saucelabs`
|
1145
|
-
`SL_USERNAME` | Must be set to your Sauce Labs account user name or email address
|
1146
|
-
`SL_AUTHKEY` | Must be set to your Sauce Labs account access key
|
1147
|
-
`SL_OS` | Refer to `platform` capability in the Copy Code section of the Platform Configurator page
|
1148
|
-
`SL_BROWSER` | Must be set to `chrome`, `firefox`, `safari`, `internet explorer`, or `edge`
|
1149
|
-
`SL_VERSION` | Refer to `version` capability in the Copy Code section of the Platform Configurator page
|
1150
|
-
`RESOLUTION` | [Optional] Refer to supported `screenResolution` capability in the Copy Code section of the Platform Configurator page
|
1151
|
-
`BROWSER_SIZE `| [Optional] Specify width, height of browser window
|
1152
|
-
`RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
|
1153
|
-
|
1154
|
-
|
1155
|
-
#### Remote desktop browsers on the TestingBot service
|
1156
|
-
|
1157
|
-
For remotely hosted desktop web browsers on the TestingBot service, the following **Environment Variables** must be set as described in
|
1158
|
-
the table below. Refer to the [TestingBot List of Available Browsers page](https://testingbot.com/support/getting-started/browsers.html) for information
|
1159
|
-
regarding the specific capabilities.
|
1160
|
-
|
1161
|
-
**Environment Variable** | **Description**
|
1162
|
-
--------------- | ----------------
|
1163
|
-
`WEB_BROWSER` | Must be set to `testingbot`
|
1164
|
-
`TB_USERNAME` | Must be set to your TestingBot account user name
|
1165
|
-
`TB_AUTHKEY` | Must be set to your TestingBot account access key
|
1166
|
-
`TB_OS` | Refer to `platform` capability in chart
|
1167
|
-
`TB_BROWSER` | Refer to `browserName` capability in chart
|
1168
|
-
`TB_VERSION` | Refer to `version` capability in chart
|
1169
|
-
`TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
|
1170
|
-
`RESOLUTION` | [Optional] Possible values: `800x600`, `1024x768`, `1280x960`, `1280x1024`, `1600x1200`, `1920x1200`, `2560x1440`
|
1171
|
-
`BROWSER_SIZE`| [Optional] Specify width, height of browser window
|
1172
|
-
|
1173
|
-
|
1174
|
-
#### Remote mobile browsers on the TestingBot service
|
1175
|
-
|
1176
|
-
For remotely hosted mobile web browsers on the TestingBot service, the following **Environment Variables** must be set as described in
|
1177
|
-
the table below. Refer to the [TestingBot List of Available Browsers page](https://testingbot.com/support/getting-started/browsers.html) for information
|
1178
|
-
regarding the specific capabilities.
|
1179
|
-
|
1180
|
-
**Environment Variable** | **Description**
|
1181
|
-
--------------- | ----------------
|
1182
|
-
`WEB_BROWSER` | Must be set to `testingbot`
|
1183
|
-
`TB_USERNAME` | Must be set to your TestingBot account user name
|
1184
|
-
`TB_AUTHKEY` | Must be set to your TestingBot account access key
|
1185
|
-
`TB_OS` | Must be set to `MAC` (for iOS) or `ANDROID`
|
1186
|
-
`TB_BROWSER` | Must be set to `safari` (for iOS) or `browser` (for Android)
|
1187
|
-
`TB_VERSION` | Refer to `version` capability in chart
|
1188
|
-
`TB_PLATFORM` | Must be set to `iOS` or `ANDROID`
|
1189
|
-
`TB_DEVICE` | Refer to `deviceName` capability in chart
|
1190
|
-
`DEVICE_TYPE` | Must be set to `phone` or `tablet`
|
1191
|
-
`TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
|
1192
|
-
`ORIENTATION` | [Optional] Set to `portrait` or `landscape`
|
1193
|
-
|
951
|
+
| **Environment Variable** | **Description** |
|
952
|
+
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
|
953
|
+
| `WEB_BROWSER` | Must be set to `browserstack` |
|
954
|
+
| `BS_USERNAME` | Must be set to your BrowserStack account user name |
|
955
|
+
| `BS_AUTHKEY` | Must be set to your BrowserStack account access key |
|
956
|
+
| `BS_OS` | Must be set to `ios` or `android` |
|
957
|
+
| `BS_DEVICE` | Refer to `deviceName` capability in chart |
|
958
|
+
| `BS_OS_VERSION` | Set to the OS version specified in the `platformVersion` capability in the chart |
|
959
|
+
| `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
|
960
|
+
| `ORIENTATION` | [Optional] Set to `portrait` or `landscape` |
|
961
|
+
| `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`) |
|
962
|
+
| `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart |
|
963
|
+
| `IP_GEOLOCATION` | [Optional] Specify IP Geolocation. Refer to [IP Geolocation](https://www.browserstack.com/ip-geolocation) to select a country code. |
|
964
|
+
| `SCREENSHOTS` | [Optional] Generate screenshots for debugging (`true` or `false`) |
|
965
|
+
| `NETWORK_LOGS` | [Optional] Capture network logs (`true` or `false`) |
|
966
|
+
| `APPIUM_LOGS` | [Optional] Generate Appium logs (`true` or `false`) |
|
967
|
+
|
968
|
+
|
969
|
+
#### Remote iOS and Android Physical Devices and Simulators on the Sauce Labs service
|
970
|
+
|
971
|
+
For remotely hosted iOS and Android simulators and real devices on the Sauce Labs service, the following **Environment Variables**
|
972
|
+
must be set as described in the table below. Refer to the [Platform Configurator page](https://saucelabs.com/platform/platform-configurator)
|
973
|
+
to obtain information regarding the specific capabilities.
|
974
|
+
|
975
|
+
| **Environment Variable** | **Description** |
|
976
|
+
|--------------------------|-----------------------------------------------------------------------------------------------------------------|
|
977
|
+
| `WEB_BROWSER` | Must be set to `saucelabs` |
|
978
|
+
| `SL_USERNAME` | Must be set to your Sauce Labs account user name or email address |
|
979
|
+
| `SL_AUTHKEY` | Must be set to your Sauce Labs account access key |
|
980
|
+
| `DATA_CENTER` | Must be set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`) |
|
981
|
+
| `SL_OS` | Must be set to `ios` or `android` |
|
982
|
+
| `SL_DEVICE` | Refer to `deviceName` capability in chart |
|
983
|
+
| `SL_OS_VERSION` | Refer to `platformVersion` capability in the Config Script section of the Platform Configurator page |
|
984
|
+
| `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
|
985
|
+
| `ORIENTATION` | [Optional] Set to `portrait` or `landscape` |
|
986
|
+
| `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`) |
|
987
|
+
| `SCREENSHOTS` | [Optional] Generate screenshots for debugging (`true` or `false`) |
|
988
|
+
|
989
|
+
|
990
|
+
#### Remote iOS and Android Physical Devices and Simulators on the TestingBot service
|
991
|
+
|
992
|
+
For remotely hosted iOS and Android simulators and real devices on the TestingBot service, the following **Environment Variables**
|
993
|
+
must be set as described in the table below. Refer to the [TestingBot List of Devices page](https://testingbot.com/support/devices)
|
994
|
+
for information regarding the specific capabilities.
|
1194
995
|
|
1195
|
-
|
996
|
+
| **Environment Variable** | **Description** |
|
997
|
+
|--------------------------|---------------------------------------------------|
|
998
|
+
| `WEB_BROWSER` | Must be set to `testingbot` |
|
999
|
+
| `TB_USERNAME` | Must be set to your TestingBot account user name |
|
1000
|
+
| `TB_AUTHKEY` | Must be set to your TestingBot account access key |
|
1001
|
+
| `TB_OS` | Must be set to `ios` or `android` |
|
1002
|
+
| `TB_DEVICE` | Refer to `deviceName` capability in chart |
|
1003
|
+
| `TB_OS_VERSION` | Refer to `version` capability in chart |
|
1004
|
+
| `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
|
1005
|
+
| `REAL_DEVICE` | Must be set to `true` for real devices |
|
1196
1006
|
|
1197
|
-
While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and managing
|
1198
|
-
target web browsers is to create browser specific **Profiles** that set the appropriate **Environment Variables** for each target browser
|
1199
|
-
in your `cucumber.yml` file.
|
1200
1007
|
|
1201
|
-
Below is a list of Cucumber **Profiles** for supported locally and remotely hosted desktop and mobile web browsers (put these in in your
|
1202
|
-
`cucumber.yml` file). Before you can use the BrowserStack, CrossBrowserTesting, Sauce Labs, or TestingBot services, you will need to
|
1203
|
-
replace the *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization code for the cloud
|
1204
|
-
service(s) that you intend to connect with.
|
1205
1008
|
|
1009
|
+
### Using Configuration Specific Profiles in cucumber.yml
|
1206
1010
|
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
safari: WEB_BROWSER=safari <%= desktop %>
|
1216
|
-
chrome: WEB_BROWSER=chrome <%= desktop %>
|
1217
|
-
ie: WEB_BROWSER=ie <%= desktop %>
|
1218
|
-
headless: WEB_BROWSER=poltergeist <%= desktop %>
|
1219
|
-
|
1220
|
-
#==============
|
1221
|
-
# profiles for locally hosted mobile web browsers (emulated locally in Firefox browser)
|
1222
|
-
# NOTE: to host emulated mobile browsers in Chrome set the HOST_BROWSER=chrome
|
1223
|
-
#==============
|
1224
|
-
|
1225
|
-
ipad: WEB_BROWSER=ipad HOST_BROWSER=chrome <%= mobile %>
|
1226
|
-
ipad_pro: WEB_BROWSER=ipad_pro HOST_BROWSER=chrome <%= mobile %>
|
1227
|
-
ipad_pro_10_5: WEB_BROWSER=ipad_pro_10_5 HOST_BROWSER=chrome <%= mobile %>
|
1228
|
-
ipad_chrome: WEB_BROWSER=ipad_chrome HOST_BROWSER=chrome <%= mobile %>
|
1229
|
-
ipad_firefox: WEB_BROWSER=ipad_firefox HOST_BROWSER=chrome <%= mobile %>
|
1230
|
-
ipad_edge: WEB_BROWSER=ipad_edge HOST_BROWSER=chrome <%= mobile %>
|
1231
|
-
iphone: WEB_BROWSER=iphone HOST_BROWSER=chrome <%= mobile %>
|
1232
|
-
iphone4: WEB_BROWSER=iphone4 HOST_BROWSER=chrome <%= mobile %>
|
1233
|
-
iphone5: WEB_BROWSER=iphone5 HOST_BROWSER=chrome <%= mobile %>
|
1234
|
-
iphone6: WEB_BROWSER=iphone6 HOST_BROWSER=chrome <%= mobile %>
|
1235
|
-
iphone6_plus: WEB_BROWSER=iphone6_plus HOST_BROWSER=chrome <%= mobile %>
|
1236
|
-
iphone7: WEB_BROWSER=iphone7 HOST_BROWSER=chrome <%= mobile %>
|
1237
|
-
iphone7_plus: WEB_BROWSER=iphone7_plus HOST_BROWSER=chrome <%= mobile %>
|
1238
|
-
iphone7_chrome: WEB_BROWSER=iphone7_chrome HOST_BROWSER=chrome <%= mobile %>
|
1239
|
-
iphone7_firefox: WEB_BROWSER=iphone7_firefox HOST_BROWSER=chrome <%= mobile %>
|
1240
|
-
iphone7_edge: WEB_BROWSER=iphone7_edge HOST_BROWSER=chrome <%= mobile %>
|
1241
|
-
iphone8: WEB_BROWSER=iphone8 HOST_BROWSER=chrome <%= mobile %>
|
1242
|
-
iphone8_plus: WEB_BROWSER=iphone8_plus HOST_BROWSER=chrome <%= mobile %>
|
1243
|
-
iphoneX: WEB_BROWSER=iphonex HOST_BROWSER=chrome <%= mobile %>
|
1244
|
-
android_phone: WEB_BROWSER=android_phone HOST_BROWSER=chrome <%= mobile %>
|
1245
|
-
nexus6: WEB_BROWSER=nexus6 HOST_BROWSER=chrome <%= mobile %>
|
1246
|
-
android_tablet: WEB_BROWSER=android_tablet HOST_BROWSER=chrome <%= mobile %>
|
1247
|
-
kindle_fire: WEB_BROWSER=kindle_fire HOST_BROWSER=chrome <%= mobile %>
|
1248
|
-
kindle_firehd7: WEB_BROWSER=kindle_firehd7 HOST_BROWSER=chrome <%= mobile %>
|
1249
|
-
kindle_firehd8: WEB_BROWSER=kindle_firehd8 HOST_BROWSER=chrome <%= mobile %>
|
1250
|
-
kindle_firehd10: WEB_BROWSER=kindle_firehd10 HOST_BROWSER=chrome <%= tablet %>
|
1251
|
-
surface: WEB_BROWSER=surface HOST_BROWSER=chrome <%= mobile %>
|
1252
|
-
blackberry_playbook: WEB_BROWSER=blackberry_playbook HOST_BROWSER=chrome <%= mobile %>
|
1253
|
-
samsung_galaxy_tab: WEB_BROWSER=samsung_galaxy_tab HOST_BROWSER=chrome <%= mobile %>
|
1254
|
-
google_nexus7: WEB_BROWSER=google_nexus7 HOST_BROWSER=chrome <%= mobile %>
|
1255
|
-
google_nexus9: WEB_BROWSER=google_nexus9 HOST_BROWSER=chrome <%= mobile %>
|
1256
|
-
google_nexus10: WEB_BROWSER=google_nexus10 HOST_BROWSER=chrome <%= mobile %>
|
1257
|
-
samsung_galaxy_s4: WEB_BROWSER=samsung_galaxy_s4 HOST_BROWSER=chrome <%= mobile %>
|
1258
|
-
samsung_galaxy_s5: WEB_BROWSER=samsung_galaxy_s5 HOST_BROWSER=chrome <%= mobile %>
|
1259
|
-
samsung_galaxy_s6: WEB_BROWSER=samsung_galaxy_s6 HOST_BROWSER=chrome <%= mobile %>
|
1260
|
-
pixel: WEB_BROWSER=pixel HOST_BROWSER=chrome <%= mobile %>
|
1261
|
-
pixel_xl: WEB_BROWSER=pixel_xl HOST_BROWSER=chrome <%= mobile %>
|
1262
|
-
windows_phone7: WEB_BROWSER=windows_phone7 HOST_BROWSER=chrome <%= mobile %>
|
1263
|
-
windows_phone8: WEB_BROWSER=windows_phone8 HOST_BROWSER=chrome <%= mobile %>
|
1264
|
-
lumia_950_xl: WEB_BROWSER=lumia_950_xl HOST_BROWSER=chrome <%= mobile %>
|
1265
|
-
blackberry_z10: WEB_BROWSER=blackberry_z10 HOST_BROWSER=chrome <%= mobile %>
|
1266
|
-
blackberry_z30: WEB_BROWSER=blackberry_z30 HOST_BROWSER=chrome <%= mobile %>
|
1267
|
-
blackberry_leap: WEB_BROWSER=blackberry_leap HOST_BROWSER=chrome <%= mobile %>
|
1268
|
-
blackberry_passport: WEB_BROWSER=blackberry_passport HOST_BROWSER=chrome <%= mobile %>
|
1011
|
+
While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and managing
|
1012
|
+
target platforms is to create platform specific **Profiles** that set the appropriate **Environment Variables** for each target
|
1013
|
+
platform in your `cucumber.yml` file.
|
1014
|
+
|
1015
|
+
Below is a list of Cucumber **Profiles** for supported locally and remotely hosted iOS and Android simulators and real devices (put
|
1016
|
+
these in in your `cucumber.yml` file). Before you can use the BrowserStack, SauceLabs, TestingBot or LambdaTest services, you will
|
1017
|
+
need to replace the *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization
|
1018
|
+
code for the cloud service(s) that you intend to connect with.
|
1269
1019
|
|
1270
|
-
|
1271
1020
|
#==============
|
1272
|
-
#
|
1021
|
+
# conditionally load Page and Screen Object implementations based on which target platform we're running on
|
1273
1022
|
#==============
|
1274
1023
|
|
1275
|
-
|
1276
|
-
|
1024
|
+
ios: PLATFORM=ios --tags @ios -r features/support/ios -e features/support/android
|
1025
|
+
android: PLATFORM=android --tags @android -r features/support/android -e features/support/ios
|
1026
|
+
web: PLATFORM=web --tags @web -r features/support/web -e features/support/ios -e features/support/android
|
1277
1027
|
|
1278
1028
|
|
1279
1029
|
#==============
|
1280
|
-
# profiles for mobile
|
1281
|
-
# NOTE: Requires installation of XCode, iOS version specific target simulators, Appium, and the appium_capybara gem
|
1030
|
+
# profiles for mobile device screen orientation
|
1282
1031
|
#==============
|
1283
1032
|
|
1284
|
-
|
1285
|
-
|
1286
|
-
app_ios_11: --profile appium_ios APP_VERSION="11.2"
|
1033
|
+
landscape: ORIENTATION=landscape
|
1034
|
+
portrait: ORIENTATION=portrait
|
1287
1035
|
|
1288
|
-
iphone_7_plus_10_sim: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="iPhone 7 Plus"
|
1289
|
-
iphone_7_10_sim: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="iPhone 7"
|
1290
|
-
iphone_7se_10_sim: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="iPhone SE"
|
1291
|
-
iphone_6s_plus_10_sim: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="iPhone 6s Plus"
|
1292
|
-
iphone_6s_10_sim: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="iPhone 6s"
|
1293
|
-
iphone_SE_10_sim: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="iPhone SE"
|
1294
|
-
iphone_X_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone X"
|
1295
|
-
iphone_8_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone 8"
|
1296
|
-
iphone_8_plus_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone 8 Plus"
|
1297
|
-
iphone_7_plus_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone 7 Plus"
|
1298
|
-
iphone_7_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone 7"
|
1299
|
-
iphone_7se_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone SE"
|
1300
|
-
iphone_6s_plus_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone 6s Plus"
|
1301
|
-
iphone_6s_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone 6s"
|
1302
|
-
iphone_SE_11_sim: --profile app_ios_11 DEVICE_TYPE=phone APP_DEVICE="iPhone SE"
|
1303
1036
|
|
1304
|
-
ipad_pro_12_9_11_sim: --profile app_ios_11 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch)"
|
1305
|
-
ipad_pro_12_9_10_sim: --profile app_ios_10 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch)"
|
1306
|
-
ipad_pro_10_5_11_sim: --profile app_ios_11 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (10.5-inch)"
|
1307
|
-
ipad_pro_10_5_10_sim: --profile app_ios_10 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (10.5-inch)"
|
1308
|
-
ipad_pro_9_7_11_sim: --profile app_ios_11 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (9.7-inch)"
|
1309
|
-
ipad_pro_9_7_10_sim: --profile app_ios_10 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (9.7-inch)"
|
1310
|
-
ipad_air_2_11_sim: --profile app_ios_11 DEVICE_TYPE=tablet APP_DEVICE="iPad Air 2"
|
1311
|
-
ipad_air_2_10_sim: --profile app_ios_10 DEVICE_TYPE=tablet APP_DEVICE="iPad Air 2"
|
1312
|
-
|
1313
|
-
|
1314
1037
|
#==============
|
1315
|
-
#
|
1316
|
-
# NOTE: Requires installation of XCode, Appium, and the appium_capybara gem
|
1317
|
-
#==============
|
1318
|
-
|
1319
|
-
my_ios_10_3_iphone: --profile app_ios_10 DEVICE_TYPE=phone APP_DEVICE="My Test iPhone6" APP_UDID="INSERT YOUR DEVICE UDID"
|
1320
|
-
my_ios_10_3_ipad: --profile app_ios_10 DEVICE_TYPE=tablet APP_DEVICE="My Test iPad Pro" APP_UDID="INSERT YOUR DEVICE UDID"
|
1321
|
-
|
1322
|
-
|
1323
|
-
#==============
|
1324
|
-
# profiles for Android mobile web browsers hosted within Android Studio Android Virtual Device emulators
|
1325
|
-
# NOTE: Requires installation of Android Studio, Android version specific virtual device simulators, Appium, and the appium_capybara gem
|
1038
|
+
# profile to start Appium Server prior to running mobile browser tests on iOS or Android simulators or physical devices
|
1326
1039
|
#==============
|
1040
|
+
run_appium: APPIUM_SERVER=run
|
1327
1041
|
|
1328
|
-
appium_android: WEB_BROWSER=appium APP_PLATFORM_NAME="Android" <%= mobile %>
|
1329
|
-
android_api_26: --profile appium_android APP_BROWSER="Chrome" APP_VERSION="8.0"
|
1330
|
-
android_api_23: --profile appium_android APP_BROWSER="Browser" APP_VERSION="6.0"
|
1331
|
-
pixel_xl_api26_sim: --profile android_api_26 DEVICE_TYPE=phone APP_DEVICE="Pixel_XL_API_26"
|
1332
|
-
pixel_2_xl_api26_sim: --profile android_api_26 DEVICE_TYPE=phone APP_DEVICE="Pixel_2_XL_API_26"
|
1333
|
-
nexus_6_api23_sim: --profile android_api_23 DEVICE_TYPE=phone APP_DEVICE="Nexus_6_API_23"
|
1334
1042
|
|
1335
1043
|
#==============
|
1336
|
-
# profiles for
|
1044
|
+
# profiles for native iOS apps hosted within XCode iOS simulators
|
1045
|
+
# NOTE: Requires installation of XCode, iOS version specific target simulators, and Appium
|
1337
1046
|
#==============
|
1338
1047
|
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
# BrowserStack OS X desktop browser profiles
|
1344
|
-
bs_macos_high_sierra: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="High Sierra"
|
1345
|
-
bs_ff_high_sierra: --profile bs_macos_high_sierra BS_BROWSER="Firefox"
|
1346
|
-
bs_chrome_high_sierra: --profile bs_macos_high_sierra BS_BROWSER="Chrome"
|
1347
|
-
bs_safari_high_sierra: --profile bs_macos_high_sierra BS_BROWSER="Safari"
|
1348
|
-
|
1349
|
-
bs_macos_sierra: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="Sierra"
|
1350
|
-
bs_ff_sierra: --profile bs_macos_sierra BS_BROWSER="Firefox"
|
1351
|
-
bs_chrome_sierra: --profile bs_macos_sierra BS_BROWSER="Chrome"
|
1352
|
-
bs_safari_sierra: --profile bs_macos_sierra BS_BROWSER="Safari"
|
1353
|
-
|
1354
|
-
bs_osx_el_capitan: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="El Capitan"
|
1355
|
-
bs_ff_el_cap: --profile bs_osx_el_capitan BS_BROWSER="Firefox"
|
1356
|
-
bs_chrome_el_cap: --profile bs_osx_el_capitan BS_BROWSER="Chrome"
|
1357
|
-
bs_safari_el_cap: --profile bs_osx_el_capitan BS_BROWSER="Safari"
|
1358
|
-
|
1359
|
-
bs_osx_yosemite: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="Yosemite"
|
1360
|
-
bs_ff_yos: --profile bs_osx_yosemite BS_BROWSER="Firefox"
|
1361
|
-
bs_chrome_yos: --profile bs_osx_yosemite BS_BROWSER="Chrome"
|
1362
|
-
bs_safari_yos: --profile bs_osx_yosemite BS_BROWSER="Safari"
|
1048
|
+
appium_ios: WEB_BROWSER=appium --profile ios AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="iOS" NEW_COMMAND_TIMEOUT="30" <%= mobile %>
|
1049
|
+
app_ios_14: --profile appium_ios APP_VERSION="14.5"
|
1050
|
+
app_ios_15: --profile appium_ios APP_VERSION="15.4"
|
1363
1051
|
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1052
|
+
iphone_12PM_14_sim: --profile app_ios_14 DEVICE_TYPE=phone APP_DEVICE="iPhone 12 Pro Max"
|
1053
|
+
iphone_13PM_15_sim: --profile app_ios_15 DEVICE_TYPE=phone APP_DEVICE="iPhone 13 Pro Max"
|
1054
|
+
iphone_11_14_sim: --profile app_ios_14 DEVICE_TYPE=phone APP_DEVICE="iPhone 11"
|
1055
|
+
ipad_pro_12_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch) (5th generation)"
|
1368
1056
|
|
1369
|
-
# BrowserStack Windows desktop browser profiles
|
1370
|
-
bs_win7: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="7"
|
1371
|
-
bs_win8: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="8"
|
1372
|
-
bs_win10: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="10"
|
1373
|
-
bs_ff_win7: --profile bs_win7 BS_BROWSER="Firefox"
|
1374
|
-
bs_ff_win8: --profile bs_win8 BS_BROWSER="Firefox"
|
1375
|
-
bs_ff_win10: --profile bs_win10 BS_BROWSER="Firefox"
|
1376
|
-
bs_chrome_win7: --profile bs_win7 BS_BROWSER="Chrome"
|
1377
|
-
bs_chrome_win8: --profile bs_win8 BS_BROWSER="Chrome"
|
1378
|
-
bs_chrome_win10: --profile bs_win10 BS_BROWSER="Chrome"
|
1379
|
-
|
1380
|
-
bs_ie_win7: --profile bs_win7 BS_BROWSER="IE"
|
1381
|
-
bs_ie11_win7: --profile bs_ie_win7 BS_VERSION="11.0"
|
1382
|
-
bs_ie10_win7: --profile bs_ie_win7 BS_VERSION="10.0"
|
1383
|
-
bs_ie9_win7: --profile bs_ie_win7 BS_VERSION="9.0"
|
1384
|
-
bs_ie10_win8: --profile bs_win8 BS_BROWSER="IE" BS_VERSION="10.0"
|
1385
|
-
bs_ie11_win8: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="8.1" BS_BROWSER="IE" BS_VERSION="11.0"
|
1386
|
-
bs_ie11_win10: --profile bs_win10 BS_BROWSER="IE" BS_VERSION="11.0"
|
1387
|
-
bs_edge_win10: --profile bs_win10 BS_BROWSER="Edge" BS_VERSION="15.0"
|
1388
|
-
|
1389
|
-
# BrowserStack iOS mobile browser profiles
|
1390
|
-
bs_iphone: --profile bs_mobile BS_PLATFORM=MAC BS_OS=ios BS_BROWSER=iPhone DEVICE_TYPE=phone
|
1391
|
-
bs_iphone6s_plus: --profile bs_iphone BS_DEVICE="iPhone 6S Plus"
|
1392
|
-
bs_iphone6s: --profile bs_iphone BS_DEVICE="iPhone 6S"
|
1393
|
-
bs_iphone6_plus: --profile bs_iphone BS_DEVICE="iPhone 6 Plus"
|
1394
|
-
bs_iphone6: --profile bs_iphone BS_DEVICE="iPhone 6"
|
1395
|
-
bs_iphone5s: --profile bs_iphone BS_DEVICE="iPhone 5S"
|
1396
|
-
bs_iphone4s: --profile bs_iphone BS_DEVICE="iPhone 4S (6.0)"
|
1397
|
-
|
1398
|
-
bs_ipad: --profile bs_mobile BS_PLATFORM=MAC BS_BROWSER=iPad DEVICE_TYPE=tablet
|
1399
|
-
bs_ipad_pro: --profile bs_ipad BS_DEVICE="iPad Pro"
|
1400
|
-
bs_ipad_air2: --profile bs_ipad BS_DEVICE="iPad Air 2"
|
1401
|
-
bs_ipad_air: --profile bs_ipad BS_DEVICE="iPad Air"
|
1402
|
-
bs_ipad_mini: --profile bs_ipad BS_DEVICE="iPad Mini 4"
|
1403
|
-
|
1404
|
-
# BrowserStack iOS real device mobile browser profiles
|
1405
|
-
bs_iphone_device: --profile bs_iphone BS_REAL_MOBILE="true"
|
1406
|
-
bs_iphoneX: --profile bs_iphone_device BS_OS_VERSION="11.0" BS_DEVICE="iPhone X"
|
1407
|
-
bs_iphone8_plus: --profile bs_iphone_device BS_OS_VERSION="11.0" BS_DEVICE="iPhone 8 Plus"
|
1408
|
-
bs_iphone8: --profile bs_iphone_device BS_OS_VERSION="11.0" BS_DEVICE="iPhone 8"
|
1409
|
-
bs_iphone7_plus: --profile bs_iphone_device BS_OS_VERSION="10.3" BS_DEVICE="iPhone 7 Plus"
|
1410
|
-
bs_iphone7: --profile bs_iphone_device BS_OS_VERSION="10.3" BS_DEVICE="iPhone 7"
|
1411
|
-
|
1412
|
-
bs_ipad_device: --profile bs_ipad BS_REAL_MOBILE="true"
|
1413
|
-
bs_ipad5: --profile bs_ipad_device BS_OS_VERSION="11.0" BS_DEVICE="iPad 5th"
|
1414
|
-
|
1415
|
-
# BrowserStack Android mobile browser profiles
|
1416
|
-
bs_android: --profile bs_mobile BS_PLATFORM=ANDROID BS_BROWSER=android BS_OS=android
|
1417
|
-
bs_android_phone: --profile bs_android DEVICE_TYPE=phone
|
1418
|
-
bs_galaxy_s5: --profile bs_android_phone BS_DEVICE="Samsung Galaxy S5"
|
1419
|
-
bs_nexus5: --profile bs_android_phone BS_DEVICE="Google Nexus 5"
|
1420
|
-
bs_moto_razr: --profile bs_android_phone BS_DEVICE="Motorola Razr"
|
1421
|
-
bs_sony_xperia: --profile bs_android_phone BS_DEVICE="Sony Xperia Tipo"
|
1422
|
-
|
1423
|
-
bs_android_tablet: --profile bs_android DEVICE_TYPE=tablet
|
1424
|
-
bs_kindle_fire_hd89: --profile bs_android_tablet BS_DEVICE="Amazon Kindle Fire HD 8.9"
|
1425
|
-
bs_kindle_fire_hdx7: --profile bs_android_tablet BS_DEVICE="Amazon Kindle Fire HDX 7"
|
1426
|
-
bs_kindle_fire2: --profile bs_android_tablet BS_DEVICE="Amazon Kindle Fire 2"
|
1427
|
-
bs_nexus7: --profile bs_android_tablet BS_DEVICE="Google Nexus 7"
|
1428
|
-
|
1429
|
-
# BrowserStack Android real device mobile browser profiles
|
1430
|
-
bs_android_device: --profile bs_mobile BS_BROWSER=android BS_OS=android BS_REAL_MOBILE="true"
|
1431
|
-
bs_google_pixel8: --profile bs_android_device BS_DEVICE="Google Pixel" BS_OS_VERSION="8.0" DEVICE_TYPE=phone
|
1432
|
-
bs_google_pixel71: --profile bs_android_device BS_DEVICE="Google Pixel" BS_OS_VERSION="7.1" DEVICE_TYPE=phone
|
1433
|
-
bs_nexus6: --profile bs_android_device BS_DEVICE="Google Nexus 6" DEVICE_TYPE=phone
|
1434
|
-
bs_galaxy_s8_plus: --profile bs_android_device BS_DEVICE="Samsung Galaxy S8 Plus" DEVICE_TYPE=phone
|
1435
|
-
bs_galaxy_s8: --profile bs_android_device BS_DEVICE="Samsung Galaxy S8" DEVICE_TYPE=phone
|
1436
|
-
bs_galaxy_s7: --profile bs_android_device BS_DEVICE="Samsung Galaxy S7" DEVICE_TYPE=phone
|
1437
|
-
bs_galaxy_s6: --profile bs_android_device BS_DEVICE="Samsung Galaxy S6" DEVICE_TYPE=phone
|
1438
|
-
bs_galaxy_note4: --profile bs_android_device BS_DEVICE="Samsung Galaxy Note 4" DEVICE_TYPE=tablet
|
1439
|
-
bs_nexus9: --profile bs_android_device BS_DEVICE="Google Nexus 9" DEVICE_TYPE=tablet
|
1440
|
-
|
1441
1057
|
|
1442
1058
|
#==============
|
1443
|
-
# profiles for
|
1059
|
+
# profiles for native Android apps hosted within Android Studio Android Virtual Device emulators
|
1060
|
+
# NOTE: Requires installation of Android Studio, Android version specific virtual device simulators, and Appium
|
1444
1061
|
#==============
|
1445
1062
|
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
# CrossBrowserTesting OS X desktop browser profiles
|
1451
|
-
cb_osx: --profile cb_desktop RESOLUTION="1920x1200"
|
1452
|
-
cb_macos_sierra: --profile cb_osx CB_OS="Mac10.12"
|
1453
|
-
cb_chrome_sierra: --profile cb_macos_sierra CB_BROWSER="Chrome53x64"
|
1454
|
-
cb_safari_sierra: --profile cb_macos_sierra CB_BROWSER="Safari10"
|
1455
|
-
|
1456
|
-
cb_osx_el_capitan: --profile cb_osx CB_OS="Mac10.11"
|
1457
|
-
cb_ff_el_cap: --profile cb_osx_el_capitan CB_BROWSER="FF46"
|
1458
|
-
cb_chrome_el_cap: --profile cb_osx_el_capitan CB_BROWSER="Chrome48x64"
|
1459
|
-
cb_safari_el_cap: --profile cb_osx_el_capitan CB_BROWSER="Safari9"
|
1460
|
-
|
1461
|
-
cb_osx_yosemite: --profile cb_osx CB_OS="Mac10.10"
|
1462
|
-
cb_ff_yos: --profile cb_osx_yosemite CB_BROWSER="FF46"
|
1463
|
-
cb_chrome_yos: --profile cb_osx_yosemite CB_BROWSER="Chrome48x64"
|
1464
|
-
cb_safari_yos: --profile cb_osx_yosemite CB_BROWSER="Safari8"
|
1465
|
-
|
1466
|
-
cb_osx_mavericks: --profile cb_osx CB_OS="Mac10.9"
|
1467
|
-
cb_ff_mav: --profile cb_osx_mavericks CB_BROWSER="FF46"
|
1468
|
-
cb_chrome_mav: --profile cb_osx_mavericks CB_BROWSER="Chrome48x64"
|
1469
|
-
cb_safari_mav: --profile cb_osx_mavericks CB_BROWSER="Safari7"
|
1470
|
-
|
1471
|
-
# CrossBrowserTesting Windows desktop browser profiles
|
1472
|
-
cb_win: --profile cb_desktop RESOLUTION="1920x1080"
|
1473
|
-
cb_win7: --profile cb_win CB_OS="Win7x64-C1"
|
1474
|
-
cb_win8: --profile cb_win CB_OS="Win8"
|
1475
|
-
cb_win10: --profile cb_win CB_OS="Win10"
|
1476
|
-
cb_ff_win7: --profile cb_win7 CB_BROWSER="FF46"
|
1477
|
-
cb_ff_win8: --profile cb_win8 CB_BROWSER="FF46"
|
1478
|
-
cb_ff_win10: --profile cb_win10 CB_BROWSER="FF46"
|
1479
|
-
cb_chrome_win7: --profile cb_win7 CB_BROWSER="Chrome48x64"
|
1480
|
-
cb_chrome_win8: --profile cb_win8 CB_BROWSER="Chrome48x64"
|
1481
|
-
cb_chrome_win10: --profile cb_win10 CB_BROWSER="Chrome48x64"
|
1482
|
-
cb_edge_win10: --profile cb_win10 CB_BROWSER="Edge20"
|
1483
|
-
|
1484
|
-
cb_ie11_win7: --profile cb_win7 CB_BROWSER="IE11"
|
1485
|
-
cb_ie10_win7: --profile cb_win7 CB_BROWSER="IE10"
|
1486
|
-
cb_ie9_win7: --profile cb_win7 CB_BROWSER="IE9"
|
1487
|
-
cb_ie11_win8: --profile cb_win8 CB_BROWSER="IE11"
|
1488
|
-
cb_ie10_win8: --profile cb_win8 CB_BROWSER="IE10"
|
1489
|
-
cb_ie11_win10: --profile cb_win10 CB_BROWSER="IE11"
|
1490
|
-
|
1491
|
-
# CrossBrowserTesting iOS mobile browser profiles
|
1492
|
-
cb_iphone6s_plus: --profile cb_mobile DEVICE_TYPE=phone CB_PLATFORM="iPhone6sPlus-iOS9sim" CB_BROWSER="MblSafari9.0" RESOLUTION="1242x2208"
|
1493
|
-
cb_iphone6s: --profile cb_mobile DEVICE_TYPE=phone CB_PLATFORM="iPhone6s-iOS9sim" CB_BROWSER="MblSafari9.0" RESOLUTION="750x1334"
|
1494
|
-
cb_iphone6_plus: --profile cb_mobile DEVICE_TYPE=phone CB_PLATFORM="iPhone6Plus-iOS8sim" CB_BROWSER="MblSafari8.0" RESOLUTION="1242x2208"
|
1495
|
-
cb_iphone6: --profile cb_mobile DEVICE_TYPE=phone CB_PLATFORM="iPhone6-iOS8sim" CB_BROWSER="MblSafari8.0" RESOLUTION="750x1334"
|
1496
|
-
cb_iphone5s: --profile cb_mobile DEVICE_TYPE=phone CB_PLATFORM="iPhone5s-iOS7sim" CB_BROWSER="MblSafari7.0" RESOLUTION="640x1136"
|
1497
|
-
cb_ipad_pro: --profile cb_mobile DEVICE_TYPE=tablet CB_PLATFORM="iPadPro-iOS9Sim" CB_BROWSER="MblSafari9.0" RESOLUTION="2732x2048"
|
1498
|
-
cb_ipad_air2: --profile cb_mobile DEVICE_TYPE=tablet CB_PLATFORM="iPadAir2-iOS9Sim" CB_BROWSER="MblSafari9.0" RESOLUTION="2048x1536"
|
1499
|
-
cb_ipad_air: --profile cb_mobile DEVICE_TYPE=tablet CB_PLATFORM="iPadAir-iOS8Sim" CB_BROWSER="MblSafari8.0" RESOLUTION="2048x1536"
|
1500
|
-
cb_ipad_mini: --profile cb_mobile DEVICE_TYPE=tablet CB_PLATFORM="iPadMiniRetina-iOS7Sim" CB_BROWSER="MblSafari7.0" RESOLUTION="2048x1536"
|
1501
|
-
|
1502
|
-
# CrossBrowserTesting Android mobile browser profiles
|
1503
|
-
cb_nexus7: --profile cb_mobile CB_PLATFORM="Nexus7-And42" CB_BROWSER="MblChrome37" RESOLUTION="800x1280"
|
1504
|
-
cb_galaxy_tab2: --profile cb_mobile CB_PLATFORM="GalaxyTab2-And41" CB_BROWSER="MblChrome38" RESOLUTION="1280x800"
|
1505
|
-
cb_galaxy_s5: --profile cb_mobile CB_PLATFORM="GalaxyS5-And44" CB_BROWSER="MblChrome35" RESOLUTION="1080x1920"
|
1506
|
-
cb_galaxy_s4: --profile cb_mobile CB_PLATFORM="GalaxyS4-And42" CB_BROWSER="MblChrome33" RESOLUTION="1080x1920"
|
1063
|
+
appium_android: WEB_BROWSER=appium --profile android AUTOMATION_ENGINE=UiAutomator2 APP_PLATFORM_NAME="Android" <%= mobile %>
|
1064
|
+
app_android_12: --profile appium_android APP_VERSION="12.0"
|
1065
|
+
pixel_5_api31_sim: --profile app_android_12 DEVICE_TYPE=phone APP_DEVICE="Pixel_5_API_31"
|
1507
1066
|
|
1508
1067
|
|
1509
1068
|
#==============
|
1510
|
-
# profiles for remotely hosted
|
1069
|
+
# profiles for remotely hosted devices on the BrowserStack service
|
1070
|
+
# WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
|
1071
|
+
# to your version control system
|
1511
1072
|
#==============
|
1512
1073
|
|
1513
|
-
|
1514
|
-
sl_desktop: --profile saucelabs <%= desktop %>
|
1515
|
-
|
1516
|
-
# SauceLabs OS X desktop browser profiles
|
1517
|
-
sl_osx_sierra: --profile sl_desktop SL_OS="macOS 10.12"
|
1518
|
-
sl_ff_sierra: --profile sl_osx_sierra SL_BROWSER="firefox"
|
1519
|
-
sl_chrome_sierra: --profile sl_osx_sierra SL_BROWSER="chrome"
|
1520
|
-
sl_safari_sierra: --profile sl_osx_sierra SL_BROWSER="safari"
|
1521
|
-
|
1522
|
-
sl_osx_el_capitan: --profile sl_desktop SL_OS="OS X 10.11"
|
1523
|
-
sl_ff_el_cap: --profile sl_osx_el_capitan SL_BROWSER="firefox"
|
1524
|
-
sl_chrome_el_cap: --profile sl_osx_el_capitan SL_BROWSER="chrome"
|
1525
|
-
sl_safari_el_cap: --profile sl_osx_el_capitan SL_BROWSER="safari"
|
1074
|
+
browserstack: WEB_BROWSER=browserstack BS_USERNAME="<INSERT USER NAME HERE>" BS_AUTHKEY="<INSERT PASSWORD HERE>" TEST_CONTEXT="TestCentricity"
|
1526
1075
|
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1076
|
+
# BrowserStack iOS real device native app profiles
|
1077
|
+
bs_ios: --profile browserstack --profile ios BS_OS=ios <%= mobile %>
|
1078
|
+
bs_iphone: --profile bs_ios DEVICE_TYPE=phone
|
1079
|
+
bs_iphone13PM_15: --profile bs_iphone BS_OS_VERSION="15" BS_DEVICE="iPhone 13 Pro Max"
|
1080
|
+
bs_iphone11_14: --profile bs_iphone BS_OS_VERSION="14" BS_DEVICE="iPhone 11"
|
1531
1081
|
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
sl_safari_mav: --profile sl_osx_mavericks SL_BROWSER="safari"
|
1536
|
-
|
1537
|
-
# SauceLabs Windows desktop browser profiles
|
1538
|
-
sl_win7: --profile sl_desktop SL_OS="Windows 7" RESOLUTION="1920x1200"
|
1539
|
-
sl_win8: --profile sl_desktop SL_OS="Windows 8.1" RESOLUTION="1280x1024"
|
1540
|
-
sl_win10: --profile sl_desktop SL_OS="Windows 10" RESOLUTION="1280x1024"
|
1541
|
-
sl_ff_win7: --profile sl_win7 SL_BROWSER="firefox"
|
1542
|
-
sl_ff_win8: --profile sl_win8 SL_BROWSER="firefox"
|
1543
|
-
sl_ff_win10: --profile sl_win10 SL_BROWSER="firefox"
|
1544
|
-
sl_chrome_win7: --profile sl_win7 SL_BROWSER="chrome"
|
1545
|
-
sl_chrome_win8: --profile sl_win8 SL_BROWSER="chrome"
|
1546
|
-
sl_chrome_win10: --profile sl_win10 SL_BROWSER="chrome"
|
1547
|
-
|
1548
|
-
sl_ie11_win7: --profile sl_win7 SL_BROWSER="internet explorer" SL_VERSION="11.0"
|
1549
|
-
sl_ie10_win7: --profile sl_win7 SL_BROWSER="internet explorer" SL_VERSION="10.0"
|
1550
|
-
sl_ie9_win7: --profile sl_win7 SL_BROWSER="internet explorer" SL_VERSION="9.0"
|
1551
|
-
sl_ie11_win8: --profile sl_win8 SL_BROWSER="internet explorer" SL_VERSION="11.0"
|
1552
|
-
sl_ie11_win10: --profile sl_win10 SL_BROWSER="internet explorer"
|
1082
|
+
# BrowserStack Android real device native app profiles
|
1083
|
+
bs_android: --profile browserstack --profile android BS_OS=android <%= mobile %>
|
1084
|
+
bs_pixel5: --profile bs_android BS_DEVICE="Google Pixel 5" BS_OS_VERSION="12.0" DEVICE_TYPE=phone
|
1553
1085
|
|
1554
1086
|
|
1555
1087
|
#==============
|
1556
|
-
# profiles for remotely hosted
|
1088
|
+
# profiles for remotely hosted devices on the SauceLabs service
|
1089
|
+
# WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
|
1090
|
+
# to your version control system
|
1557
1091
|
#==============
|
1558
1092
|
|
1559
|
-
|
1560
|
-
tb_desktop: --profile testingbot <%= desktop %> RESOLUTION="1920x1200"
|
1561
|
-
tb_mobile: --profile testingbot <%= mobile %>
|
1562
|
-
|
1563
|
-
# TestingBot OS X desktop browser profiles
|
1564
|
-
tb_macos_sierra: --profile tb_desktop TB_OS="SIERRA"
|
1565
|
-
tb_ff_sierra: --profile tb_macos_sierra TB_BROWSER="firefox"
|
1566
|
-
tb_chrome_sierra: --profile tb_macos_sierra TB_BROWSER="chrome"
|
1567
|
-
tb_safari_sierra: --profile tb_macos_sierra TB_BROWSER="safari" TB_VERSION="10"
|
1568
|
-
|
1569
|
-
tb_osx_el_capitan: --profile tb_desktop TB_OS="CAPITAN"
|
1570
|
-
tb_ff_el_cap: --profile tb_osx_el_capitan TB_BROWSER="firefox"
|
1571
|
-
tb_chrome_el_cap: --profile tb_osx_el_capitan TB_BROWSER="chrome"
|
1572
|
-
tb_safari_el_cap: --profile tb_osx_el_capitan TB_BROWSER="safari" TB_VERSION="9"
|
1573
|
-
|
1574
|
-
tb_osx_yosemite: --profile tb_desktop TB_OS="YOSEMITE"
|
1575
|
-
tb_ff_yos: --profile tb_osx_yosemite TB_BROWSER="firefox"
|
1576
|
-
tb_chrome_yos: --profile tb_osx_yosemite TB_BROWSER="chrome"
|
1577
|
-
tb_safari_yos: --profile tb_osx_yosemite TB_BROWSER="safari" TB_VERSION="8"
|
1093
|
+
saucelabs: WEB_BROWSER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" DATA_CENTER="us-west-1" AUTOMATE_PROJECT="TestCentricity - SauceLabs"
|
1578
1094
|
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1095
|
+
# SauceLabs iOS real device native app profiles
|
1096
|
+
sl_ios: --profile saucelabs --profile ios SL_OS=ios <%= mobile %>
|
1097
|
+
sl_iphone: --profile sl_ios DEVICE_TYPE=phone
|
1098
|
+
sl_iphone13PM_15: --profile sl_iphone SL_DEVICE="iPhone 13 Pro Max Simulator" SL_OS_VERSION="15.4"
|
1583
1099
|
|
1584
|
-
#
|
1585
|
-
|
1586
|
-
|
1587
|
-
tb_win10: --profile tb_desktop TB_OS="WIN10"
|
1588
|
-
tb_ff_win7: --profile tb_win7 TB_BROWSER="firefox"
|
1589
|
-
tb_ff_win8: --profile tb_win8 TB_BROWSER="firefox"
|
1590
|
-
tb_ff_win10: --profile tb_win10 TB_BROWSER="firefox"
|
1591
|
-
tb_chrome_win7: --profile tb_win7 TB_BROWSER="chrome"
|
1592
|
-
tb_chrome_win8: --profile tb_win8 TB_BROWSER="chrome"
|
1593
|
-
tb_chrome_win10: --profile tb_win10 TB_BROWSER="chrome"
|
1100
|
+
# SauceLabs Android real device native app profiles
|
1101
|
+
sl_android: --profile saucelabs --profile android SL_OS=android <%= mobile %>
|
1102
|
+
sl_pixel5: --profile sl_android SL_DEVICE="Google Pixel 5 GoogleAPI Emulator" SL_OS_VERSION="12.0" DEVICE_TYPE=phone
|
1594
1103
|
|
1595
|
-
tb_ie9_win7: --profile tb_win7 TB_BROWSER="internet explorer" TB_VERSION="9"
|
1596
|
-
tb_ie11_win8: --profile tb_win8 TB_BROWSER="internet explorer" TB_VERSION="11"
|
1597
|
-
tb_ie10_win8: --profile tb_win8 TB_BROWSER="internet explorer" TB_VERSION="10"
|
1598
|
-
tb_ie11_win10: --profile tb_win10 TB_BROWSER="internet explorer" TB_VERSION="11"
|
1599
|
-
tb_edge_win10: --profile tb_win10 TB_BROWSER="microsoftedge" TB_VERSION="14"
|
1600
1104
|
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
tb_iphone6_plus_93: --profile tb_ios DEVICE_TYPE=phone TB_VERSION="9.3" TB_DEVICE="iPhone 6 Plus"
|
1607
|
-
tb_iphone6s_10: --profile tb_ios DEVICE_TYPE=phone TB_VERSION="10.0" TB_DEVICE="iPhone 6s"
|
1608
|
-
tb_iphone6s_93: --profile tb_ios DEVICE_TYPE=phone TB_VERSION="9.3" TB_DEVICE="iPhone 6s"
|
1609
|
-
tb_iphone5s_10: --profile tb_ios DEVICE_TYPE=phone TB_VERSION="10.0" TB_DEVICE="iPhone 5s"
|
1610
|
-
tb_iphone5s_93: --profile tb_ios DEVICE_TYPE=phone TB_VERSION="9.3" TB_DEVICE="iPhone 5s"
|
1611
|
-
tb_ipad_pro_10: --profile tb_ios DEVICE_TYPE=tablet TB_VERSION="10.0" TB_DEVICE="iPad Pro"
|
1612
|
-
tb_ipad_pro_93: --profile tb_ios DEVICE_TYPE=tablet TB_VERSION="9.3" TB_DEVICE="iPad Pro"
|
1613
|
-
tb_ipad_air2_10: --profile tb_ios DEVICE_TYPE=tablet TB_VERSION="10.0" TB_DEVICE="iPad Air 2"
|
1614
|
-
tb_ipad_air2_93: --profile tb_ios DEVICE_TYPE=tablet TB_VERSION="9.3" TB_DEVICE="iPad Air 2"
|
1105
|
+
#==============
|
1106
|
+
# profiles for remotely hosted devices on the TestingBot service
|
1107
|
+
# WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
|
1108
|
+
# to your version control system
|
1109
|
+
#==============
|
1615
1110
|
|
1111
|
+
testingbot: WEB_BROWSER=testingbot TB_USERNAME="<INSERT USER NAME HERE>" TB_AUTHKEY="<INSERT PASSWORD HERE>" AUTOMATE_PROJECT="TestCentricity - TestingBot"
|
1616
1112
|
|
1617
|
-
# TestingBot
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
tb_galaxy_s4: --profile tb_android TB_VERSION="4.4" TB_DEVICE="Galaxy S4"
|
1624
|
-
tb_galaxy_s5: --profile tb_android TB_VERSION="5.0" TB_DEVICE="Galaxy S5"
|
1625
|
-
tb_galaxy_s6: --profile tb_android TB_VERSION="6.0" TB_DEVICE="Galaxy S6"
|
1626
|
-
|
1627
|
-
|
1628
|
-
To specify a locally hosted target browser using a profile at runtime, you use the flag `--profile` or `-p` followed by the profile name when
|
1629
|
-
invoking Cucumber in the command line. For instance, the following command invokes Cucumber and specifies that a local instance of Chrome
|
1630
|
-
will be used as the target web browser:
|
1113
|
+
# TestingBot iOS real device native app profiles
|
1114
|
+
tb_ios: --profile testingbot --profile ios TB_OS=iOS <%= mobile %>
|
1115
|
+
tb_iphone: --profile tb_ios DEVICE_TYPE=phone
|
1116
|
+
tb_iphone11_14_dev: --profile tb_iphone TB_OS_VERSION="14.0" TB_DEVICE="iPhone 11" REAL_DEVICE=true
|
1117
|
+
tb_iphone11_14_sim: --profile tb_iphone TB_OS_VERSION="14.2" TB_DEVICE="iPhone 11"
|
1118
|
+
tb_iphone13PM_15_sim: --profile tb_iphone TB_OS_VERSION="15.4" TB_DEVICE="iPhone 13 Pro Max"
|
1631
1119
|
|
1632
|
-
|
1120
|
+
# TestingBot Android real device native app profiles
|
1121
|
+
tb_android: --profile testingbot --profile android TB_OS=Android <%= mobile %>
|
1122
|
+
tb_pixel_dev: --profile tb_android TB_DEVICE="Pixel" TB_OS_VERSION="9.0" DEVICE_TYPE=phone REAL_DEVICE=true
|
1123
|
+
tb_pixel6_sim: --profile tb_android TB_DEVICE="Pixel 6" TB_OS_VERSION="12.0" DEVICE_TYPE=phone
|
1633
1124
|
|
1634
1125
|
|
1635
|
-
|
1636
|
-
in
|
1637
|
-
|
1638
|
-
$ cucumber -p ipad_pro -p landscape
|
1639
|
-
|
1126
|
+
To specify a mobile simulator or real device target using a profile at runtime, you use the flag `--profile` or `-p` followed
|
1127
|
+
by the profile name when invoking Cucumber in the command line. For instance, the following command specifies that Cucumber will
|
1128
|
+
run tests against an iPad Pro (12.9-inch) (5th generation) with iOS version 15.4 in an XCode Simulator in portrait orientation:
|
1640
1129
|
|
1641
|
-
|
1642
|
-
in landscape orientation:
|
1643
|
-
|
1644
|
-
$ cucumber -p ipad_pro_93_sim -p landscape
|
1130
|
+
cucumber -p ipad_pro_12_15_sim -p portrait
|
1645
1131
|
|
1646
1132
|
NOTE: Appium must be running prior to executing this command
|
1647
1133
|
|
1134
|
+
You can ensure that Appium Server is running by including `-p run_appium` in your command line:
|
1648
1135
|
|
1649
|
-
|
1650
|
-
virtual machine on the BrowserStack service:
|
1136
|
+
cucumber -p ipad_pro_12_15_sim -p portrait -p run_appium
|
1651
1137
|
|
1652
|
-
cucumber -p bs_safari_yos
|
1653
|
-
|
1654
1138
|
|
1655
|
-
The following command specifies that Cucumber will run tests against a
|
1656
|
-
|
1139
|
+
The following command specifies that Cucumber will run tests against a cloud hosted iPhone 13 Pro Max running iOS 15.4 on the
|
1140
|
+
BrowserStack service:
|
1657
1141
|
|
1658
|
-
|
1142
|
+
cucumber -p bs_iphone13PM_15
|
1659
1143
|
|
1660
1144
|
|
1661
1145
|
|
1662
|
-
##
|
1146
|
+
## Recommended Project Organization and Structure
|
1663
1147
|
|
1664
|
-
|
1148
|
+
Below is an example of the project structure of a typical Cucumber based native mobile app test automation framework with a Screen
|
1149
|
+
Object Model architecture. `ScreenObject` class definitions should be stored in the `/features/support/<platform>/screens`
|
1150
|
+
folders, organized in functional area sub-folders as needed. Likewise, `ScreenSection` class definitions should be stored in
|
1151
|
+
the `/features/support/<platform>/sections` folder, where `<platform>` is typically `ios` or `android`.
|
1665
1152
|
|
1153
|
+
Common embedded WebViews for native and hybrid apps that are shared with both iOS and Android platforms should be stored in
|
1154
|
+
the `/features/support/shared_webviews` folder.
|
1666
1155
|
|
1156
|
+
my_automation_project
|
1157
|
+
├── config
|
1158
|
+
│ ├── locales
|
1159
|
+
│ ├── test_data
|
1160
|
+
│ └── cucumber.yml
|
1161
|
+
├── features
|
1162
|
+
│ ├── step_definitions
|
1163
|
+
│ ├── support
|
1164
|
+
│ │ ├── android
|
1165
|
+
| | | ├── screens
|
1166
|
+
| | | └── sections
|
1167
|
+
│ │ ├── ios
|
1168
|
+
| | | ├── screens
|
1169
|
+
| | | └── sections
|
1170
|
+
│ │ ├── shared_webviews
|
1171
|
+
│ │ ├── env.rb
|
1172
|
+
│ │ ├── hooks.rb
|
1173
|
+
│ │ └── world_pages.rb
|
1174
|
+
├── Gemfile
|
1175
|
+
└── README.md
|
1667
1176
|
|
1668
1177
|
|
1669
|
-
|
1178
|
+
<img src="https://i.imgur.com/DdoDOxV.jpg" alt="TestCentricity Native Mobile App Framework Overview" title="TestCentricity Native Mobile App Framework Overview">
|
1670
1179
|
|
1671
|
-
TestCentricity™ Framework is Copyright (c) 2014-2018, Tony Mrozinski.
|
1672
|
-
All rights reserved.
|
1673
1180
|
|
1181
|
+
### Combined native iOS/Android app and web app project
|
1182
|
+
|
1183
|
+
If your native mobile apps share feature parity and a common user experience with a responsive web UI that is accessed via
|
1184
|
+
desktop/mobile web browsers, you can effectively create one set of Cucumber feature files and scenarios that can be used
|
1185
|
+
to test across all three platforms - iOS, Android, and web.
|
1186
|
+
|
1187
|
+
Below is an example of the project structure of a typical Cucumber based native mobile app and web UI test automation framework
|
1188
|
+
with a Screen and Page Object Model architecture. `ScreenObject` class definitions should be stored in the `/features/support/<platform>/screens`
|
1189
|
+
folders, organized in functional area sub-folders as needed. Likewise, `ScreenSection` class definitions should be stored in
|
1190
|
+
the `/features/support/<platform>/sections` folder. `PageObject` class definitions should be stored in the `/features/support/web/pages`
|
1191
|
+
folders, organized in functional area sub-folders as needed, while `PageSection` class definitions should be stored in the
|
1192
|
+
the `/features/support/web/sections` folder.
|
1674
1193
|
|
1675
|
-
|
1676
|
-
|
1194
|
+
my_automation_project
|
1195
|
+
├── config
|
1196
|
+
│ ├── locales
|
1197
|
+
│ ├── test_data
|
1198
|
+
│ └── cucumber.yml
|
1199
|
+
├── features
|
1200
|
+
│ ├── step_definitions
|
1201
|
+
│ ├── support
|
1202
|
+
│ │ ├── android
|
1203
|
+
| | | ├── screens
|
1204
|
+
| | | └── sections
|
1205
|
+
│ │ ├── ios
|
1206
|
+
| | | ├── screens
|
1207
|
+
| | | └── sections
|
1208
|
+
│ │ ├── web
|
1209
|
+
| | | ├── pages
|
1210
|
+
| | | └── sections
|
1211
|
+
│ │ ├── env.rb
|
1212
|
+
│ │ ├── hooks.rb
|
1213
|
+
│ │ └── world_pages.rb
|
1214
|
+
├── Gemfile
|
1215
|
+
└── README.md
|
1677
1216
|
|
1678
|
-
1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
|
1679
1217
|
|
1680
|
-
|
1681
|
-
the documentation and/or other materials provided with the distribution.
|
1218
|
+
<img src="https://i.imgur.com/uzFhvu4.jpg" alt="TestCentricity Native Mobile App and Web Framework Overview" title="TestCentricity Native Mobile App and Web Framework Overview">
|
1682
1219
|
|
1683
|
-
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from
|
1684
|
-
this software without specific prior written permission.
|
1685
1220
|
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1221
|
+
## Copyright and License
|
1222
|
+
|
1223
|
+
TestCentricity™ Framework is Copyright (c) 2014-2022, Tony Mrozinski.
|
1224
|
+
All rights reserved.
|
1225
|
+
|
1226
|
+
Redistribution and use in source and binary forms, with or without
|
1227
|
+
modification, are permitted provided that the following conditions are met:
|
1228
|
+
|
1229
|
+
1. Redistributions of source code must retain the above copyright notice,
|
1230
|
+
this list of conditions and the following disclaimer.
|
1231
|
+
|
1232
|
+
2. Redistributions in binary form must reproduce the above copyright
|
1233
|
+
notice, this list of conditions and the following disclaimer in the
|
1234
|
+
documentation and/or other materials provided with the distribution.
|
1235
|
+
|
1236
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
1237
|
+
may be used to endorse or promote products derived from this software without
|
1238
|
+
specific prior written permission.
|
1239
|
+
|
1240
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
1241
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
1242
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
1243
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
1244
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
1245
|
+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
1246
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
1247
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
1248
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
1249
|
+
POSSIBILITY OF SUCH DAMAGE.
|