testcentricity_web 2.1.8.2 → 2.1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +27 -0
  3. data/.rubocop.yml +41 -0
  4. data/.yardopts +2 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +28 -0
  7. data/README.md +1438 -0
  8. data/Rakefile +1 -0
  9. data/lib/devices/devices.yml +280 -0
  10. data/lib/testcentricity_web.rb +140 -0
  11. data/lib/testcentricity_web/browser_helper.rb +173 -0
  12. data/lib/testcentricity_web/data_objects_helper.rb +78 -0
  13. data/lib/testcentricity_web/drag_drop_helper.rb +15 -0
  14. data/lib/testcentricity_web/elements/button.rb +8 -0
  15. data/lib/testcentricity_web/elements/cell_button.rb +8 -0
  16. data/lib/testcentricity_web/elements/cell_checkbox.rb +38 -0
  17. data/lib/testcentricity_web/elements/cell_element.rb +62 -0
  18. data/lib/testcentricity_web/elements/cell_image.rb +8 -0
  19. data/lib/testcentricity_web/elements/cell_radio.rb +31 -0
  20. data/lib/testcentricity_web/elements/checkbox.rb +99 -0
  21. data/lib/testcentricity_web/elements/file_field.rb +45 -0
  22. data/lib/testcentricity_web/elements/image.rb +34 -0
  23. data/lib/testcentricity_web/elements/label.rb +8 -0
  24. data/lib/testcentricity_web/elements/link.rb +8 -0
  25. data/lib/testcentricity_web/elements/list.rb +54 -0
  26. data/lib/testcentricity_web/elements/list_button.rb +8 -0
  27. data/lib/testcentricity_web/elements/list_checkbox.rb +38 -0
  28. data/lib/testcentricity_web/elements/list_element.rb +51 -0
  29. data/lib/testcentricity_web/elements/list_radio.rb +31 -0
  30. data/lib/testcentricity_web/elements/radio.rb +73 -0
  31. data/lib/testcentricity_web/elements/select_list.rb +189 -0
  32. data/lib/testcentricity_web/elements/table.rb +473 -0
  33. data/lib/testcentricity_web/elements/textfield.rb +84 -0
  34. data/lib/testcentricity_web/environment.rb +249 -0
  35. data/lib/testcentricity_web/excel_helper.rb +242 -0
  36. data/lib/testcentricity_web/exception_queue_helper.rb +47 -0
  37. data/lib/testcentricity_web/page_objects_helper.rb +656 -0
  38. data/lib/testcentricity_web/page_sections_helper.rb +811 -0
  39. data/lib/testcentricity_web/siebel_open_ui_helper.rb +15 -0
  40. data/lib/testcentricity_web/ui_elements_helper.rb +425 -0
  41. data/lib/testcentricity_web/utility_helpers.rb +28 -0
  42. data/lib/testcentricity_web/version.rb +3 -0
  43. data/lib/testcentricity_web/webdriver_helper.rb +451 -0
  44. data/lib/testcentricity_web/world_extensions.rb +26 -0
  45. data/testcentricity_web.gemspec +42 -0
  46. metadata +52 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e678f8e881ffda2cf15a55d5a5e45c2f868aa0cb
4
- data.tar.gz: 24b52c49cbdb7cb15e03752b3d189ebc65b96be4
3
+ metadata.gz: d9ce21fa3ed070540857f13c91d4e26737fafbb4
4
+ data.tar.gz: ec4148037d084b344a7b2f01fef0c6aaf1b97169
5
5
  SHA512:
6
- metadata.gz: c7804f2f97c94e5c1c2e46b93d714450989ed9e0be070292b285bda3b7bb015fa21deb693314d6625a00675b80f0083083ccddeb9a2891e0334ab7ce53a325bb
7
- data.tar.gz: ec65d387ce42c477d12491cc065cdcd0a04adaf9a7298d9f0e0021900d3aced5b0fd367ec9d1ec87e140ceba0177084e416f0544f45cf95798a5f0ae16be2922
6
+ metadata.gz: fe011d194b633020d0d3f5745e37984c1ca46f386e4c993b469bfd21afc6f09fea98829f3fe26db0b5896d57b76f1e4d5d5a8a53be0b4396a1c42acb76cc7ebb
7
+ data.tar.gz: a391da7ab4f408f181f36e31d225e9243751de034607dea79a84cf98f8a8d4d5a2a84b6a217ab2fe3a77165beff51bbe1845e87076a1a2f8203733977f42cfd5
data/.gitignore ADDED
@@ -0,0 +1,27 @@
1
+ # OSX folder stuff
2
+ .DS_Store
3
+ Thumbs.db
4
+
5
+ #IDE project files
6
+ .idea
7
+ .settings
8
+ .project
9
+ .idea/workspace.xml
10
+ .idea/.rakeTasks
11
+ *.iml
12
+
13
+ doc/*
14
+ .yardoc/*
15
+ notes.txt
16
+ coverage
17
+ .bundle
18
+ .ruby-version
19
+ .ruby-gemset
20
+ /my_templates
21
+
22
+ Gemfile.lock
23
+
24
+
25
+ .idea/testcentricity_web.iml
26
+
27
+ .idea/.rakeTasks
data/.rubocop.yml ADDED
@@ -0,0 +1,41 @@
1
+ # See full list of defaults here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
2
+ # To see all cops used see here: https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
3
+
4
+ Documentation:
5
+ Enabled: false
6
+
7
+ AccessorMethodName:
8
+ Enabled: false
9
+
10
+ TrivialAccessors:
11
+ Enabled: false
12
+
13
+ RedundantReturn:
14
+ Enabled: false
15
+
16
+ Metrics/ModuleLength:
17
+ Enabled: false
18
+
19
+ Metrics/ClassLength:
20
+ Enabled: false
21
+
22
+ Encoding:
23
+ EnforcedStyle: when_needed
24
+
25
+ Metrics/LineLength:
26
+ Enabled: false
27
+
28
+ Metrics/MethodLength:
29
+ Enabled: false
30
+
31
+ Style/RegexpLiteral:
32
+ Enabled: false
33
+
34
+ Style/HashSyntax:
35
+ Enabled: false
36
+
37
+ Metrics/CyclomaticComplexity:
38
+ Enabled: false
39
+
40
+ Style/EmptyLines:
41
+ Enabled: false
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --markup markdown
2
+ --markup-provider redcarpet
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in testcentricity_web.gemspec
4
+ gemspec
5
+
6
+ gem 'redcarpet', :groups => [:development, :test]
data/LICENSE.txt ADDED
@@ -0,0 +1,28 @@
1
+ TestCentricity Web (tm) Framework is Copyright (c) 2014-2017, Tony Mrozinski
2
+ All rights reserved.
3
+
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions, and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright
12
+ notice, this list of conditions, and the following disclaimer in the
13
+ documentation and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its contributors
16
+ may be used to endorse or promote products derived from this software without
17
+ specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
25
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
+ POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,1438 @@
1
+ # TestCentricity™ Web
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/testcentricity_web.svg)](https://badge.fury.io/rb/testcentricity_web) [![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
+ The TestCentricity™ Web core generic framework for desktop and mobile web site testing implements a Page Object and Data Object Model DSL for
7
+ use with Cucumber, Capybara, and Selenium-Webdriver.
8
+
9
+ The TestCentricity™ Web gem supports running automated tests against the following web test targets:
10
+
11
+ * locally hosted desktop browsers (Firefox*, Chrome, Safari, or IE)
12
+ * locally hosted emulated iOS Mobile Safari, Android, Windows Phone, or Blackberry mobile browsers (running within Firefox or Chrome)
13
+ * a "headless" browser (using Poltergeist and PhantomJS)
14
+ * mobile Safari browsers on iOS device simulators (using Appium and XCode on OS X)
15
+ * cloud hosted desktop (Firefox, Chrome, Safari, IE, or Edge) or mobile (iOS Mobile Safari or Android) web browsers using the [Browserstack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate),
16
+ [Sauce Labs](https://saucelabs.com/open-source#automated-testing-platform), [CrossBrowserTesting](https://crossbrowsertesting.com/selenium-testing), or
17
+ [TestingBot](https://testingbot.com/features) services.
18
+
19
+
20
+ **Note:** Test execution against local instances of Firefox version 48 or greater is currently not supported by the TestCentricity™ Web gem. Testing with
21
+ locally hosted instances of Firefox 48 or greater requires Marionette (aka geckodriver) and selenium-webdriver version 3.x, both of which are currently
22
+ feature incomplete and potentially unstable. More information can be found [here](https://github.com/teamcapybara/capybara/issues/1710).
23
+
24
+
25
+ ## What's New
26
+ ###Version 2.1.8
27
+
28
+ * Added `PageSection.verify_list_items` method for **Indexed PageSection Objects**.
29
+
30
+ ###Version 2.1.7
31
+
32
+ * Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to use backspace characters to delete contents of a textfield
33
+ instead of using `clear`, which was preventing `onchange` JavaScript events from being triggered in some browsers.
34
+
35
+ ###Version 2.1.5
36
+
37
+ * Added `get_min`, `get_max`, and `get_step` methods to `TextField` class.
38
+
39
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `min`, `max`, and `step` attributes
40
+ for textfields.
41
+
42
+ ###Version 2.1.4
43
+
44
+ * Added suppression of the Info Bar that displays "Chrome is being controlled by automated test software" on locally hosted instances of the Chrome browser.
45
+
46
+
47
+ ###Version 2.1.3
48
+
49
+ * Added support for "tiling" or cascading multiple browser windows when the `BROWSER_TILE` and `PARALLEL` Environment Variables are set to true. For each
50
+ 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,
51
+ use the [parallel_tests gem](https://github.com/grosser/parallel_tests) to decrease overall test execution time.
52
+
53
+ ###Version 2.1.2
54
+
55
+ * Added device profiles for Microsoft Lumia 950, Blackberry Leap, Blackberry Passport, and Kindle Fire HD 10
56
+ * Added ability to set browser language support via the `LOCALE` Environment Variable for local instances of Chrome or Firefox browsers
57
+
58
+ ###Version 2.1.0
59
+
60
+ * Added device profiles for iPhone 8, iPhone 8 Plus, iPhone X devices running iOS 11
61
+ * Added device profile for iPad Pro 10.5" with iOS 11
62
+ * Updated iPhone 7 and iPhone 7 Plus profiles to iOS 10
63
+ * Updated Google Pixel and Google Pixel XL profiles to Android 8
64
+ * Added device profiles for iPhone 7 (iOS 10) with Mobile Chrome browser and iPad (iOS 10) with Mobile Chrome browser
65
+
66
+
67
+ ## What's Fixed
68
+ ###Version 2.1.6
69
+
70
+ * Fixed bug in `TestCentricity::WebDriverConnect.set_webdriver_path` method that was failing to set the path to the appropriate chromedriver file for OS X
71
+ and Windows.
72
+
73
+ ###Version 2.1.5
74
+
75
+ * Fixed Chrome and Firefox support for setting browser language via the `LOCALE` Environment Variable. This capability now works for emulated mobile
76
+ browsers hosted in a local instance of Chrome or Firefox.
77
+
78
+ ###Version 2.1.0
79
+
80
+ * The `TestCentricity::WebDriverConnect.initialize_web_driver` method now sets the `Environ` object to the correct device connection states for local and
81
+ cloud hosted browsers.
82
+ * The `TestCentricity::WebDriverConnect.initialize_web_driver` method no longer calls `initialize_browser_size` when running tests against cloud hosted
83
+ mobile web browser, which was resulting in Appium throwing exceptions for unsupported method calls.
84
+ * The `TestCentricity::WebDriverConnect.set_webdriver_path` method now correctly sets the path for Chrome webDrivers when the `HOST_BROWSER` Environment
85
+ Variable is set to `chrome`. Tests against locally hosted emulated mobile web browser running on a local instance of Chrome will now work correctly.
86
+
87
+
88
+ ## Installation
89
+
90
+ Add this line to your automation project's Gemfile:
91
+
92
+ gem 'testcentricity_web'
93
+
94
+ And then execute:
95
+
96
+ $ bundle
97
+
98
+ Or install it yourself as:
99
+
100
+ $ gem install testcentricity_web
101
+
102
+
103
+ ## Setup
104
+ ###Using Cucumber
105
+
106
+ If you are using Cucumber, you need to require the following in your *env.rb* file:
107
+
108
+ require 'capybara'
109
+ require 'capybara/cucumber'
110
+ require 'testcentricity_web'
111
+
112
+
113
+ ###Using RSpec
114
+
115
+ If you are using RSpec instead, you need to require the following in your *env.rb* file:
116
+
117
+ require 'capybara'
118
+ require 'capybara/rspec'
119
+ require 'testcentricity_web'
120
+
121
+
122
+ ### Using Poltergeist
123
+
124
+ If you will be running your tests on a "headless" web browser using Poltergeist and PhantomJS, you must add this line to your automation
125
+ project's Gemfile:
126
+
127
+ gem 'poltergeist'
128
+
129
+
130
+ ### Using Appium
131
+
132
+ If you will be running your tests on mobile Safari browsers on simulated iOS devices using Appium and XCode Simulators, you need to require
133
+ the following in your *env.rb* file:
134
+
135
+ require 'appium_capybara'
136
+
137
+ You also need to add this line to your automation project's Gemfile:
138
+
139
+ gem 'appium_capybara'
140
+
141
+ And then execute:
142
+
143
+ $ bundle
144
+
145
+
146
+
147
+ ## Page Objects
148
+
149
+ The **Page Object Model** is a test automation pattern that aims to create an abstraction of your web app's User Interface that can be used
150
+ in tests. A **Page Object** is an object that represents a single page in your AUT (Application Under Test). **Page Objects** encapsulate the
151
+ implementation details of a web page and expose an API that supports interaction with, and validation of the UI elements on the page.
152
+
153
+ **Page Objects** makes it easier to maintain automated tests because changes to page UI elements are updated in only one location - in the
154
+ **Page Object** class definition. By adopting a **Page Object Model**, Cucumber Feature files and step definitions are no longer required to
155
+ hold specific information about a page's UI objects, thus minimizing maintenance requirements. If any element on a page changes (URL path,
156
+ text field attributes, button captions, etc.), maintenance is performed in the **Page Object** class definition only, typically with no need
157
+ to update the affected feature file, scenarios, or step definitions.
158
+
159
+
160
+ ### Defining a Page Object
161
+
162
+ Your **Page Object** class definitions should be contained within individual `.rb` files in the `features/support/pages` folder of your
163
+ test automation project. You define new **Page Objects** as shown below:
164
+
165
+ class LoginPage < TestCentricity::PageObject
166
+ end
167
+
168
+
169
+ class HomePage < TestCentricity::PageObject
170
+ end
171
+
172
+
173
+ class RegistrationPage < TestCentricity::PageObject
174
+ end
175
+
176
+
177
+ ### Adding Traits to your Page Object
178
+
179
+ Web pages typically have names and URLs associated with them. Web pages also typically have a unique object or attribute that, when present,
180
+ indicates that the page's contents have fully loaded.
181
+
182
+ The `page_name` trait is registered with the **PageManager** object, which includes a `find_page` method that takes a page name as a
183
+ parameter and returns an instance of the associated **Page Object**. If you intend to use the **PageManager**, you must define a `page_name`
184
+ trait for each of the **Page Objects** to be registered.
185
+
186
+ The `page_name` trait is usually a `String` value that represents the name of the page that will be matched by the `PageManager.findpage` method.
187
+ `page_name` traits are case and white-space sensitive. For pages that may be referenced with multiple names, the `page_name` trait may also be
188
+ an `Array` of `String` values representing those page names.
189
+
190
+ A `page_url` trait should be defined if a page can be directly loaded using a URL. If you set Capybara's `app_host`, or specify a base URL
191
+ when calling the `WebDriverConnect.initialize_web_driver` method, then your `page_url` trait can be the relative URL slug that will
192
+ be appended to the base URL specified in `app_host`. Specifying a `page_url` trait is optional, as not all web pages can be directly loaded
193
+ via a URL.
194
+
195
+ A `page_locator` trait is defined if a page has a unique object or attribute that exists once the page's contents have fully loaded. The
196
+ `page_locator` trait is a CSS or Xpath expression that uniquely identifies the object or attribute. The `verify_page_exists` method waits
197
+ for the `page_locator` trait to exist.
198
+
199
+ You define your page's **Traits** as shown below:
200
+
201
+ class LoginPage < TestCentricity::PageObject
202
+ trait(:page_name) { 'Login' }
203
+ trait(:page_url) { '/sign_in' }
204
+ trait(:page_locator) { 'body.login-body' }
205
+ end
206
+
207
+
208
+ class HomePage < TestCentricity::PageObject
209
+ # this page may be referred to as 'Home' or 'Dashboard' page so page_name trait is an Array of Strings
210
+ trait(:page_name) { ['Home', 'Dashboard'] }
211
+ trait(:page_url) { '/dashboard' }
212
+ trait(:page_locator) { 'body.dashboard' }
213
+ end
214
+
215
+
216
+ class RegistrationPage < TestCentricity::PageObject
217
+ trait(:page_name) { 'Registration' }
218
+ trait(:page_url) { '/register' }
219
+ trait(:page_locator) { 'body.registration' }
220
+ end
221
+
222
+
223
+ ### Adding UI Elements to your Page Object
224
+
225
+ Web pages are made up of UI elements like text fields, check boxes, combo boxes, radio buttons, tables, lists, buttons, etc.
226
+ **UI Elements** are added to your **Page Object** class definition as shown below:
227
+
228
+ class LoginPage < TestCentricity::PageObject
229
+ trait(:page_name) { 'Login' }
230
+ trait(:page_url) { '/sign_in' }
231
+ trait(:page_locator) { 'body.login-body' }
232
+
233
+ # Login page UI elements
234
+ textfield :user_id_field, 'input#userName'
235
+ textfield :password_field, 'input#password'
236
+ button :login_button, 'button#login'
237
+ checkbox :remember_checkbox, 'input#rememberUser'
238
+ label :error_message_label, 'div#statusBar.login-error'
239
+ end
240
+
241
+
242
+ class RegistrationPage < TestCentricity::PageObject
243
+ trait(:page_name) { 'Registration' }
244
+ trait(:page_url) { '/register' }
245
+ trait(:page_locator) { 'body.registration' }
246
+
247
+ # Registration page UI elements
248
+ textfields first_name_field: 'input#firstName',
249
+ last_name_field: 'input#lastName',
250
+ email_field: 'input#email',
251
+ phone_number_field: 'input#phone',
252
+ address_field: 'input#streetAddress',
253
+ city_field: 'input#city',
254
+ post_code_field: 'input#postalCode',
255
+ password_field: 'input#password',
256
+ pword_confirm_field: 'input#passwordConfirmation'
257
+ selectlists title_select: 'select#title',
258
+ gender_select: 'select#gender',
259
+ state_select: 'select#stateProvince'
260
+ checkbox :email_opt_in_check, 'input#marketingEmailsOptIn'
261
+ button :sign_up_button, 'button#registrationSignUp'
262
+ end
263
+
264
+
265
+ ### Adding Methods to your Page Object
266
+
267
+ It is good practice for your Cucumber step definitions to call high level methods in your your **Page Object** instead of directly accessing
268
+ and interacting with a page object's UI elements. You can add high level methods to your **Page Object** class definition for interacting with
269
+ the UI to hide implementation details, as shown below:
270
+
271
+ class LoginPage < TestCentricity::PageObject
272
+ trait(:page_name) { 'Login' }
273
+ trait(:page_url) { '/sign_in' }
274
+ trait(:page_locator) { 'body.login-body' }
275
+
276
+ # Login page UI elements
277
+ textfield :user_id_field, 'input#userName'
278
+ textfield :password_field, 'input#password'
279
+ button :login_button, 'button#login'
280
+ checkbox :remember_checkbox, 'input#rememberUser'
281
+ label :error_message_label, 'div#statusBar.login-error'
282
+ link :forgot_password_link, 'a.forgotPassword'
283
+
284
+ # log in to web app
285
+ def login(user_id, password)
286
+ user_id_field.set(user_id)
287
+ password_field.set(password)
288
+ login_button.click
289
+ end
290
+
291
+ def remember_me(state)
292
+ remember_checkbox.set_checkbox_state(state)
293
+ end
294
+
295
+ # verify Login page default UI state
296
+ def verify_page_ui
297
+ ui = {
298
+ login_button => { :visible => true, :caption => 'LOGIN' },
299
+ user_id_field => { :visible => true, :enabled => true },
300
+ password_field => { :visible => true, :enabled => true, :value => '', :placeholder => 'Password' },
301
+ remember_checkbox => { :exists => true, :enabled => true, :checked => false },
302
+ forgot_password_link => { :visible => true, :caption => 'Forgot your password?' },
303
+ error_message_label => { :visible => false }
304
+ }
305
+ verify_ui_states(ui)
306
+ super
307
+ end
308
+ end
309
+
310
+
311
+ class RegistrationPage < TestCentricity::PageObject
312
+ trait(:page_name) { 'Registration' }
313
+ trait(:page_url) { '/register' }
314
+ trait(:page_locator) { 'body.registration' }
315
+
316
+ # Registration page UI elements
317
+ textfields first_name_field: 'input#firstName',
318
+ last_name_field: 'input#lastName',
319
+ email_field: 'input#email',
320
+ phone_number_field: 'input#phone',
321
+ address_field: 'input#streetAddress',
322
+ city_field: 'input#city',
323
+ post_code_field: 'input#postalCode',
324
+ password_field: 'input#password',
325
+ pword_confirm_field: 'input#passwordConfirmation'
326
+ selectlists title_select: 'select#title',
327
+ gender_select: 'select#gender',
328
+ state_select: 'select#stateProvince'
329
+ checkbox :email_opt_in_check, 'input#marketingEmailsOptIn'
330
+ button :sign_up_button, 'button#registrationSignUp'
331
+
332
+ # populate Registration page fields with profile data
333
+ def enter_profile_data(profile)
334
+ fields = { title_select => profile.title,
335
+ first_name_field => profile.first_name,
336
+ last_name_field => profile.last_name,
337
+ gender_select => profile.gender,
338
+ phone_number_field => profile.phone,
339
+ email_field => profile.email,
340
+ address_field => profile.address,
341
+ city_field => profile.city,
342
+ state_select => profile.state,
343
+ post_code_field => profile.postal_code,
344
+ password_field => profile.password,
345
+ pword_confirm_field => profile.confirm_password
346
+ }
347
+ populate_data_fields(fields)
348
+ sign_up_button.click
349
+ end
350
+ end
351
+
352
+
353
+
354
+ Once your **Page Objects** have been instantiated, you can call your methods as shown below:
355
+
356
+ login_page.remember_me(true)
357
+ login_page.user_id_field.set('snicklefritz', 'Pa55w0rd')
358
+
359
+
360
+
361
+ ## PageSection Objects
362
+
363
+ 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
364
+ app. It is a collection of **UI Elements** that represent a conceptual area of functionality, like a navigation bar, a search capability,
365
+ or a menu. **UI Elements** and functional behavior are confined to the scope of a **PageSection Object**.
366
+
367
+ A **PageSection Object** may contain other **PageSection Objects**.
368
+
369
+
370
+ ### Defining a PageSection Object
371
+
372
+ Your **PageSection** class definitions should be contained within individual `.rb` files in the `features/support/sections` folder of
373
+ your test automation project. You define new **PageSection Objects** as shown below:
374
+
375
+ class SearchForm < TestCentricity::PageSection
376
+ end
377
+
378
+
379
+ ### Adding Traits to a PageSection Object
380
+
381
+ A **PageSection Object** typically has a root node object that encapsulates a collection of **UI Elements**. The `section_locator` trait
382
+ specifies the CSS or Xpath expression that uniquely identifies that root node object.
383
+
384
+ You define your page section's **Traits** as shown below:
385
+
386
+ class SearchForm < TestCentricity::PageSection
387
+ trait(:section_locator) { 'form#gnav-search' }
388
+ trait(:section_name) { 'Search widget' }
389
+ end
390
+
391
+
392
+ ### Adding UI Elements to your PageSection Object
393
+
394
+ Page sections are typically made up of UI elements like text fields, check boxes, combo boxes, radio buttons, tables, lists, buttons, etc.
395
+ **UI Elements** are added to your **PageSection** class definition as shown below:
396
+
397
+ class SearchForm < TestCentricity::PageSection
398
+ trait(:section_locator) { 'form#gnav-search' }
399
+ trait(:section_name) { 'Search widget' }
400
+
401
+ # Search Form UI elements
402
+ textfield :search_field, 'input#search-query'
403
+ button :search_button, 'button[type=submit]'
404
+ end
405
+
406
+
407
+ ### Adding Methods to your PageSection Object
408
+
409
+ You can add high level methods to your **PageSection** class definition, as shown below:
410
+
411
+ class SearchForm < TestCentricity::PageSection
412
+ trait(:section_locator) { 'form#gnav-search' }
413
+ trait(:section_name) { 'Search widget' }
414
+
415
+ # Search Form UI elements
416
+ textfield :search_field, 'input#search-query'
417
+ button :search_button, 'button[type=submit]'
418
+
419
+ def search_for(value)
420
+ search_field.set(value)
421
+ search_button.click
422
+ end
423
+ end
424
+
425
+
426
+ ### Adding PageSection Objects to your Page Object
427
+
428
+ You add a **PageSection Object** to its associated **Page Object** as shown below:
429
+
430
+ class HomePage < TestCentricity::PageObject
431
+ trait(:page_name) { 'Home' }
432
+ trait(:page_url) { '/dashboard' }
433
+ trait(:page_locator) { 'body.dashboard' }
434
+
435
+ # Home page Section Objects
436
+ section :search_form, SearchForm
437
+ end
438
+
439
+ Once your **Page Object** has been instantiated, you can call its **PageSection** methods as shown below:
440
+
441
+ home_page.search_form.search_for('ocarina')
442
+
443
+
444
+
445
+ ## UI Elements
446
+
447
+ **Page Objects** and **PageSection Objects** are typically made up of **UI Element** like text fields, check boxes, combo boxes, radio buttons,
448
+ tables, lists, buttons, etc. **UI Elements** are declared and instantiated within the class definition of the **Page Object** or **PageSection
449
+ Object** in which they are contained. With TestCentricity Web, all UI elements are based on the **UIElement** class.
450
+
451
+
452
+ ### Declaring and Instantiating UI Element
453
+
454
+ Single **UIElement** declarations have the following format:
455
+
456
+ elementType :element Name, locator
457
+
458
+ * The `element name` is the unique name that you will use to refer to the UI element and is specified as a symbol.
459
+ * The `locator` is the CSS or XPath attribute that uniquely and unambiguously identifies the UI element.
460
+
461
+ Multiple **UIElement** declarations for a collection of elements of the same type can be performed by passing a hash table containing the
462
+ names and locators of each individual element.
463
+
464
+ ### Example UI Element Declarations
465
+
466
+ Supported **UI Element** elementTypes and their declarations have the following format:
467
+
468
+ *Single element declarations:*
469
+
470
+ class SamplePage < TestCentricity::PageObject
471
+
472
+ button :button_name, locator
473
+ textfield :field_name, locator
474
+ checkbox :checkbox_name, locator
475
+ radio :radio_button_name, locator
476
+ label :label_name, locator
477
+ link :link_name, locator
478
+ selectlist :select_name, locator
479
+ list :list_name, locator
480
+ table :table_name, locator
481
+ image :image_name, locator
482
+ filefield :filefield_name, locator
483
+
484
+ end
485
+
486
+ *Multiple element declarations:*
487
+
488
+ class SamplePage < TestCentricity::PageObject
489
+
490
+ buttons button_1_name: locator,
491
+ button_2_name: locator,
492
+ button_X_name: locator
493
+ textfields field_1_name: locator,
494
+ field_2_name: locator,
495
+ field_X_name: locator
496
+ checkboxes check_1_name: locator,
497
+ check_2_name: locator,
498
+ check_X_name: locator
499
+ radios radio_1_name: locator,
500
+ radio_X_name: locator
501
+ labels label_1_name: locator,
502
+ label_X_name: locator
503
+ links link_1_name: locator,
504
+ link_X_name: locator
505
+ selectlists selectlist_1_name: locator,
506
+ selectlist_X_name: locator
507
+ lists list_1_name: locator,
508
+ list_X_name: locator
509
+ tables table_1_name: locator,
510
+ table_X_name: locator
511
+ images image_1_name: locator,
512
+ image_X_name: locator
513
+ filefields filefield_1_name: locator,
514
+ filefield_X_name: locator
515
+
516
+ end
517
+
518
+
519
+ Refer to the Class List documentation for the **PageObject** and **PageSection** classes for details on the class methods used for declaring
520
+ and instantiating **UI Elements**. Examples of UI element declarations can be found in the ***Adding UI Elements to your Page Object*** and
521
+ ***Adding UI Elements to your PageSection Object*** sections above.
522
+
523
+
524
+ ### UIElement Inherited Methods
525
+
526
+ With TestCentricity, all UI elements are based on the **UIElement** class, and inherit the following methods:
527
+
528
+ **Action methods:**
529
+
530
+ element.click
531
+ element.double_click
532
+ element.right_click
533
+ element.click_at(x, y)
534
+ element.hover
535
+ element.drag_by(right_offset, down_offset)
536
+ element.drag_and_drop(target, right_offset, down_offset)
537
+
538
+ **Object state methods:**
539
+
540
+ element.exists?
541
+ element.visible?
542
+ element.hidden?
543
+ element.enabled?
544
+ element.disabled?
545
+ element.get_value
546
+ element.get_attribute(attrib)
547
+ element.get_native_attribute(attrib)
548
+
549
+ **Waiting methods:**
550
+
551
+ element.wait_until_exists(seconds)
552
+ element.wait_until_gone(seconds)
553
+ element.wait_until_visible(seconds)
554
+ element.wait_until_hidden(seconds)
555
+ element.wait_until_value_is(value, seconds)
556
+ element.wait_until_value_changes(seconds)
557
+
558
+
559
+ ## Instantiating your Page Objects
560
+
561
+ Before you can call the methods in your **Page Objects** and **PageSection Objects**, you must instantiate the **Page Objects** of your
562
+ web application, as well as create instance variables which can be used when calling a **Page Objects** methods from your step definitions.
563
+ There are several ways to instantiate your **Page Objects**.
564
+
565
+ One common implementation is shown below:
566
+
567
+ module WorldPages
568
+ def login_page
569
+ @login_page ||= LoginPage.new
570
+ end
571
+
572
+ def home_page
573
+ @home_page ||= HomePage.new
574
+ end
575
+
576
+ def registration_page
577
+ @registration_page ||= RegistrationPage.new
578
+ end
579
+
580
+ def search_results_page
581
+ @search_results_page ||= SearchResultsPage.new
582
+ end
583
+ end
584
+
585
+ World(WorldPages)
586
+
587
+ 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
588
+ `features/support` folder.
589
+
590
+ While this approach is effective for small web applications with only a few pages (and hence few **Page Objects**), it quickly becomes
591
+ cumbersome to manage if your web application has dozens of **Page Objects** that need to be instantiated and managed.
592
+
593
+ ### Using the PageManager
594
+
595
+ The **PageManager** class provides methods for supporting the instantiation and management of **Page Objects**. In the code example below,
596
+ the `page_objects` method contains a hash table of your **Page Object** instances and their associated **Page Object** class names
597
+ to be instantiated by **PageManager**:
598
+
599
+ module WorldPages
600
+ def page_objects
601
+ { :login_page => LoginPage,
602
+ :home_page => HomePage,
603
+ :registration_page => RegistrationPage,
604
+ :search_results_page => SearchResultsPage,
605
+ :products_grid_page => ProductsCollectionPage,
606
+ :product_detail_page => ProductDetailPage,
607
+ :shopping_basket_page => ShoppingBasketPage,
608
+ :payment_method_page => PaymentMethodPage,
609
+ :confirm_purchase_page => PurchaseConfirmationPage,
610
+ :my_account_page => MyAccountPage,
611
+ :my_order_history_page => MyOrderHistoryPage,
612
+ :my_ship_to_addresses_page => MyShipToAddressesPage,
613
+ :terms_conditions_page => TermsConditionsPage,
614
+ :privacy_policy_page => PrivacyPolicyPage,
615
+ :faqs_page => FAQsPage,
616
+ :contact_us_page => ContactUsPage
617
+ }
618
+ end
619
+ end
620
+
621
+ World(WorldPages)
622
+
623
+ The `WorldPages` module above should be defined in the `world_pages.rb` file in the `features/support` folder.
624
+
625
+ Include the code below in your `env.rb` file to ensure that your **Page Objects** are instantiated before your Cucumber scenarios are
626
+ executed:
627
+
628
+ include WorldPages
629
+ WorldPages.instantiate_page_objects
630
+
631
+ **NOTE:** If you intend to use the **PageManager**, you must define a `page_name` trait for each of the **Page Objects** to be registered.
632
+
633
+
634
+ ### Leveraging the PageManager in your Cucumber tests
635
+
636
+ Many Cucumber based automated tests suites include scenarios that verify that web pages are correctly loaded, displayed, or can be
637
+ navigated to by clicking associated links. One such Cucumber navigation scenario is displayed below:
638
+
639
+ Scenario Outline: Verify Home page navigation links
640
+ Given I am on the Home page
641
+ When I click the <page> navigation link
642
+ Then I expect the <page> page to be correctly displayed
643
+
644
+ Examples:
645
+ |page |
646
+ |Registration |
647
+ |My Account |
648
+ |Terms & Conditions |
649
+ |Privacy Policy |
650
+ |FAQs |
651
+ |Contact Us |
652
+
653
+ In the above example, the step definitions associated with the 3 steps might be implemented using a page_dispatcher method using a
654
+ `case` statement to parse the `page` parameter as in the example below:
655
+
656
+ Given(/^I am on the ([^\"]*) page$/) do |page_name|
657
+ target_page = page_dispatcher(page_name)
658
+ target_page.load_page
659
+ end
660
+
661
+ When(/^I click the ([^\"]*) navigation link$/) do |link_name|
662
+ target_page = page_dispatcher(link_name)
663
+ target_page.navigate_to
664
+ end
665
+
666
+ Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
667
+ target_page = page_dispatcher(page_name)
668
+ target_page.verify_page_exists
669
+ target_page.verify_page_ui
670
+ end
671
+
672
+ # this method takes a page name as a parameter and returns an instance of the associated Page Object
673
+ def page_dispatcher(page_name)
674
+ case page_name
675
+ when 'Registration'
676
+ page = registration_page
677
+ when 'My Account'
678
+ page = my_account_page
679
+ when 'Terms & Conditions'
680
+ page = terms_conditions_page
681
+ when 'Privacy Policy'
682
+ page = privacy_policy_page
683
+ when 'Contact Us'
684
+ page = contact_us_page
685
+ when 'FAQs'
686
+ page = faqs_page
687
+ end
688
+ raise "No page object defined for page named '#{page_name}'" unless page
689
+ page
690
+ end
691
+
692
+
693
+ While this approach may be effective for small web applications with only a few pages (and hence few **Page Objects**), it quickly becomes
694
+ cumbersome to manage if your web application has dozens of **Page Objects** that need to be managed.
695
+
696
+ The **PageManager** class provides a `find_page` method that replaces the cumbersome and difficult to maintain `case` statement used in the
697
+ above example. The **PageManager** `current_page` method allows you to set or get an instance of the currently active Page Object.
698
+
699
+ To use these **PageManager** methods, include the step definitions and code below in a `page_steps.rb` or `generic_steps.rb` file in the
700
+ `features/step_definitions` folder:
701
+
702
+ include TestCentricity
703
+
704
+ Given(/^I am on the ([^\"]*) page$/) do |page_name|
705
+ target_page = page_dispatcher(page_name)
706
+ target_page.load_page if target_page
707
+ # let PageManager store an instance of the current page object
708
+ PageManager.current_page = target_page
709
+ end
710
+
711
+ When(/^I click the ([^\"]*) navigation link$/) do |link_name|
712
+ target_page = page_dispatcher(link_name)
713
+ target_page.navigate_to if target_page
714
+ end
715
+
716
+ Then(/^I expect to see the ([^\"]*) page$/) do |page_name|
717
+ target_page = page_dispatcher(page_name)
718
+ target_page.verify_page_exists if target_page
719
+ # let PageManager store an instance of the current page object
720
+ PageManager.current_page = target_page
721
+ end
722
+
723
+ Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
724
+ target_page = page_dispatcher(page_name)
725
+ target_page.verify_page_exists
726
+ target_page.verify_page_ui
727
+ # let PageManager store an instance of the current page object
728
+ PageManager.current_page = target_page
729
+ end
730
+
731
+ # this method takes a page name as a parameter and returns an instance of the associated Page Object
732
+ def page_dispatcher(page_name)
733
+ page = PageManager.find_page(page_name)
734
+ raise "No page object defined for page named '#{page_name}'" unless page
735
+ page
736
+ end
737
+
738
+
739
+
740
+ ## Connecting to a Web Browser
741
+
742
+ The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures the appropriate selenium-webdriver capabilities required to establish a
743
+ connection with a target web browser, and sets the base host URL of the web site you are running your tests against.
744
+
745
+ The `TestCentricity::WebDriverConnect.initialize_web_driver` method accepts a single optional parameter - the base host URL. Cucumber **Environment
746
+ Variables** are used to specify the target local or remote web browser, and the various webdriver capability parameters required to configure
747
+ the connection.
748
+
749
+
750
+ ### Locally hosted desktop web browser
751
+
752
+ 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
753
+ values from the table below:
754
+
755
+ `WEB_BROWSER` | **Desktop Platform**
756
+ --------------|----------------
757
+ `firefox` | macOS (OS X) or Windows
758
+ `chrome` | macOS (OS X) or Windows
759
+ `safari` | macOS (OS X) only
760
+ `ie` | Windows only
761
+ `poltergeist` | macOS (OS X) or Windows
762
+
763
+ 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:
764
+
765
+ BROWSER_SIZE=1600,1000
766
+
767
+ To maximize a desktop browser window, you set the `BROWSER_SIZE` Environment Variable to 'max' as shown below:
768
+
769
+ BROWSER_SIZE=max
770
+
771
+
772
+ ### Locally hosted emulated mobile web browser
773
+
774
+ You can run your tests against mobile device browsers that are emulated within a locally hosted instance of a Firefox or Chrome desktop browser
775
+ on OS X or Windows. The specified mobile browser's user agent, CSS screen dimensions, and default screen orientation will be automatically set
776
+ within the local Firefox or Chrome browser instance. You may even specify the emulated device's screen orientation. For locally hosted emulated
777
+ mobile web browsers, the `WEB_BROWSER` Environment Variable must be set to one of the values from the table below:
778
+
779
+ `WEB_BROWSER` | `HOST_BROWSER` | **CSS Screen Dimensions** | **Default Orientation** | **OS Version**
780
+ ----------------------|----------------------|-----------|----------|---------
781
+ `ipad` |`firefox` or `chrome` |1024 x 768 |landscape |iOS 10
782
+ `ipad_pro` |`firefox` or `chrome` |1366 x 1024|landscape |iOS 11
783
+ `ipad_pro_10_5` |`firefox` or `chrome` |1112 x 834 |landscape |iOS 11
784
+ `ipad_chrome` |`firefox` or `chrome` |1024 x 768 |landscape |iOS 10 - Mobile Chrome browser for iOS
785
+ `android_tablet` |`firefox` or `chrome` |1024 x 768 |landscape |Android 3.0
786
+ `kindle_fire` |`firefox` or `chrome` |1024 x 600 |landscape |
787
+ `kindle_firehd7` |`firefox` or `chrome` |800 x 480 |landscape |Fire OS 3
788
+ `kindle_firehd8` |`firefox` or `chrome` |1280 x 800 |landscape |Fire OS 5
789
+ `kindle_firehd10` |`firefox` or `chrome` |1920 x 1200 |landscape |Fire OS 5
790
+ `surface` |`firefox` or `chrome` |1366 x 768 |landscape |
791
+ `blackberry_playbook` |`firefox` or `chrome` |1024 x 600 |landscape |BlackBerry Tablet OS
792
+ `samsung_galaxy_tab` |`firefox` or `chrome` |1280 x 800 |landscape |Android 4.0.4
793
+ `google_nexus7` |`firefox` or `chrome` |960 x 600 |landscape |Android 4.4.4
794
+ `google_nexus9` |`firefox` or `chrome` |1024 x 768 |landscape |Android 5.1
795
+ `google_nexus10` |`firefox` or `chrome` |1280 x 800 |landscape |Android 5.1
796
+ `iphone` |`firefox` or `chrome` |320 x 480 |portrait |iOS 9.1
797
+ `iphone4` |`firefox` or `chrome` |320 x 480 |portrait |iOS 9.1
798
+ `iphone5` |`firefox` or `chrome` |320 x 568 |portrait |iOS 9.1
799
+ `iphone6` |`firefox` or `chrome` |375 x 667 |portrait |iOS 9.1
800
+ `iphone6_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 9.1
801
+ `iphone7` |`firefox` or `chrome` |375 x 667 |portrait |iOS 10
802
+ `iphone7_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 10
803
+ `iphone7_chrome` |`firefox` or `chrome` |375 x 667 |portrait |iOS 10 - Mobile Chrome browser for iOS
804
+ `iphone8` |`firefox` or `chrome` |375 x 667 |portrait |iOS 11
805
+ `iphone8_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 11
806
+ `iphonex` |`firefox` or `chrome` |375 x 812 |portrait |iOS 11
807
+ `android_phone` |`firefox` or `chrome` |320 x 480 |portrait |Android 4
808
+ `nexus6` |`firefox` or `chrome` |411 x 731 |portrait |Android 6
809
+ `pixel` |`firefox` or `chrome` |411 x 731 |portrait |Android 8
810
+ `pixel_xl` |`firefox` or `chrome` |411 x 731 |portrait |Android 8
811
+ `samsung_galaxy_s4` |`firefox` or `chrome` |360 x 640 |portrait |Android 5.0.1
812
+ `samsung_galaxy_s5` |`firefox` or `chrome` |360 x 640 |portrait |Android 6.0.1
813
+ `samsung_galaxy_s6` |`firefox` or `chrome` |360 x 640 |portrait |Android 6.0.1
814
+ `windows_phone7` |`firefox` or `chrome` |320 x 480 |portrait |Windows Phone OS 7.5
815
+ `windows_phone8` |`firefox` or `chrome` |320 x 480 |portrait |Windows Phone OS 8.0
816
+ `lumia_950_xl` |`firefox` or `chrome` |360 x 640 |portrait |Windows Phone OS 10
817
+ `blackberry_z10` |`firefox` or `chrome` |384 x 640 |portrait |BlackBerry 10 OS
818
+ `blackberry_z30` |`firefox` or `chrome` |360 x 640 |portrait |BlackBerry 10 OS
819
+ `blackberry_leap` |`firefox` or `chrome` |360 x 640 |portrait |BlackBerry 10 OS
820
+ `blackberry_passport` |`firefox` or `chrome` |504 x 504 |square |BlackBerry 10 OS
821
+
822
+ To change the emulated device's screen orientation from the default setting, set the `ORIENTATION` Environment Variable to either `portrait` or `landscape`.
823
+
824
+ 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
825
+ to `chrome`.
826
+
827
+
828
+ ### Mobile Safari browser on iOS Simulators
829
+
830
+ You can run your mobile web tests against the mobile Safari browser on simulated iOS devices using Appium and XCode on OS X. You must install XCode, the
831
+ iOS version-specific device simulators for XCode, and Appium. You must ensure that the `appium_capybara` gem is installed and required as described in
832
+ **section 2.4 (Setup - Using Appium)** above.
833
+
834
+ Appium must be running prior to invoking Cucumber to run your features/scenarios.
835
+
836
+ Once your test environment is properly configured, the following **Environment Variables** must be set as described in the table below.
837
+
838
+ **Environment Variable** | **Description**
839
+ --------------- | ----------------
840
+ `WEB_BROWSER` | Must be set to `appium`
841
+ `APP_PLATFORM_NAME` | Must be set to `iOS`
842
+ `APP_BROWSER` | Must be set to `Safari`
843
+ `APP_VERSION` | Must be set to `10.0`, `9.3`, `9.2`, or which ever iOS version you wish to run within the XCode Simulator
844
+ `APP_DEVICE` | Set to iOS device name supported by the iOS Simulator (`iPhone 6s Plus`, `iPad Pro`, `iPad Air 2`, etc.)
845
+ `ORIENTATION` | [Optional] Set to `portrait` or `landscape`
846
+ `APP_ALLOW_POPUPS` | [Optional] Allow javascript to open new windows in Safari. Set to `true` or `false`
847
+ `APP_IGNORE_FRAUD_WARNING` | [Optional] Prevent Safari from showing a fraudulent website warning. Set to `true` or `false`
848
+ `APP_NO_RESET` | [Optional] Don't reset app state after each test. Set to `true` or `false`
849
+ `APP_INITIAL_URL` | [Optional] Initial URL, default is a local welcome page. e.g. `http://www.apple.com`
850
+ `LOCALE` | [Optional] Locale to set for the simulator. e.g. `fr_CA`
851
+
852
+
853
+
854
+ ### Remotely hosted desktop and mobile web browsers
855
+
856
+ You can run your automated tests against remotely hosted desktop and mobile web browsers using the BrowserStack, CrossBrowserTesting,
857
+ Sauce Labs, or TestingBot services. If your tests are running against a web site hosted on your local computer (`localhost`), or on a
858
+ staging server inside your LAN, you must set the `TUNNELING` Environment Variable to `true`.
859
+
860
+
861
+ #### Remote desktop browsers on the BrowserStack service
862
+
863
+ For remotely hosted desktop web browsers on the BrowserStack service, the following **Environment Variables** must be set as described in
864
+ the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities#capabilities-browserstack)
865
+ for information regarding the specific capabilities.
866
+
867
+ **Environment Variable** | **Description**
868
+ --------------- | ----------------
869
+ `WEB_BROWSER` | Must be set to `browserstack`
870
+ `BS_USERNAME` | Must be set to your BrowserStack account user name
871
+ `BS_AUTHKEY` | Must be set to your BrowserStack account access key
872
+ `BS_OS` | Must be set to `OS X` or `Windows`
873
+ `BS_OS_VERSION` | Refer to `os_version` capability in chart
874
+ `BS_BROWSER` | Refer to `browser` capability in chart
875
+ `BS_VERSION` | [Optional] Refer to `browser_version` capability in chart. If not specified, latest stable version of browser will be used.
876
+ `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
877
+ `RESOLUTION` | [Optional] Refer to supported screen `resolution` capability in chart
878
+ `BROWSER_SIZE` | [Optional] Specify width, height of browser window
879
+ `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
880
+ `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
881
+
882
+
883
+ #### Remote mobile browsers on the BrowserStack service
884
+
885
+ For remotely hosted mobile web browsers on the BrowserStack service, the following **Environment Variables** must be set as described in
886
+ the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities#capabilities-browserstack)
887
+ for information regarding the specific capabilities.
888
+
889
+ **Environment Variable** | **Description**
890
+ --------------- | ----------------
891
+ `WEB_BROWSER` | Must be set to `browserstack`
892
+ `BS_USERNAME` | Must be set to your BrowserStack account user name
893
+ `BS_AUTHKEY` | Must be set to your BrowserStack account access key
894
+ `BS_OS` | Must be set to `ios` or `android`
895
+ `BS_BROWSER` | Must be set to `iPhone`, `iPad`, or `android`
896
+ `BS_PLATFORM` | Must be set to `MAC` (for iOS) or `ANDROID`
897
+ `BS_DEVICE` | Refer to `device` capability in chart
898
+ `BS_REAL_MOBILE` | Set to `true` if running against a real device
899
+ `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
900
+ `ORIENTATION` | [Optional] Set to `portrait` or `landscape`
901
+ `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
902
+ `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
903
+
904
+
905
+
906
+ #### Remote desktop browsers on the CrossBrowserTesting service
907
+
908
+ For remotely hosted desktop web browsers on the CrossBrowserTesting service, the following **Environment Variables** must be set as described in
909
+ the table below. Use the Configuration Wizard on the [Start a Selenium Test page](https://app.crossbrowsertesting.com/selenium/run) to obtain
910
+ information regarding the specific capabilities.
911
+
912
+ **Environment Variable** | **Description**
913
+ --------------- | ----------------
914
+ `WEB_BROWSER` | Must be set to `crossbrowser`
915
+ `CB_USERNAME` | Must be set to your CrossBrowserTesting account user name or email address
916
+ `CB_AUTHKEY` | Must be set to your CrossBrowserTesting account access key
917
+ `CB_OS` | Refer to `os_api_name` capability in the sample script of the Wizard
918
+ `CB_BROWSER` | Refer to `browser_api_name` capability in the sample script of the Wizard
919
+ `RESOLUTION` | [Optional] Refer to supported `screen_resolution` capability in the sample script of the Wizard
920
+ `BROWSER_SIZE` | [Optional] Specify width, height of browser window
921
+ `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
922
+
923
+
924
+ #### Remote mobile browsers on the CrossBrowserTesting service
925
+
926
+ For remotely hosted mobile web browsers on the CrossBrowserTesting service, the following **Environment Variables** must be set as described in
927
+ the table below. Use the Configuration Wizard on the [Start a Selenium Test page](https://app.crossbrowsertesting.com/selenium/run) to obtain
928
+ information regarding the specific capabilities.
929
+
930
+ **Environment Variable** | **Description**
931
+ --------------- | ----------------
932
+ `WEB_BROWSER` | Must be set to `crossbrowser`
933
+ `CB_USERNAME` | Must be set to your CrossBrowserTesting account user name or email address
934
+ `CB_AUTHKEY` | Must be set to your CrossBrowserTesting account access key
935
+ `CB_PLATFORM` | Refer to `os_api_name` capability in the sample script of the Wizard
936
+ `CB_BROWSER` | Refer to `browser_api_name` capability in the sample script of the Wizard
937
+ `RESOLUTION` | Refer to supported `screen_resolution` capability in the sample script of the Wizard
938
+ `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
939
+
940
+
941
+
942
+ #### Remote desktop browsers on the Sauce Labs service
943
+
944
+ For remotely hosted desktop web browsers on the Sauce Labs service, the following **Environment Variables** must be set as described in
945
+ the table below. Use the Selenium API on the [Platform Configurator page](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/) to obtain
946
+ information regarding the specific capabilities.
947
+
948
+ **Environment Variable** | **Description**
949
+ --------------- | ----------------
950
+ `WEB_BROWSER` | Must be set to `saucelabs`
951
+ `SL_USERNAME` | Must be set to your Sauce Labs account user name or email address
952
+ `SL_AUTHKEY` | Must be set to your Sauce Labs account access key
953
+ `SL_OS` | Refer to `platform` capability in the Copy Code section of the Platform Configurator page
954
+ `SL_BROWSER` | Must be set to `chrome`, `firefox`, `safari`, `internet explorer`, or `edge`
955
+ `SL_VERSION` | Refer to `version` capability in the Copy Code section of the Platform Configurator page
956
+ `RESOLUTION` | [Optional] Refer to supported `screenResolution` capability in the Copy Code section of the Platform Configurator page
957
+ `BROWSER_SIZE `| [Optional] Specify width, height of browser window
958
+ `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
959
+
960
+
961
+ #### Remote desktop browsers on the TestingBot service
962
+
963
+ For remotely hosted desktop web browsers on the TestingBot service, the following **Environment Variables** must be set as described in
964
+ the table below. Refer to the [TestingBot List of Available Browsers page](https://testingbot.com/support/getting-started/browsers.html) for information
965
+ regarding the specific capabilities.
966
+
967
+ **Environment Variable** | **Description**
968
+ --------------- | ----------------
969
+ `WEB_BROWSER` | Must be set to `testingbot`
970
+ `TB_USERNAME` | Must be set to your TestingBot account user name
971
+ `TB_AUTHKEY` | Must be set to your TestingBot account access key
972
+ `TB_OS` | Refer to `platform` capability in chart
973
+ `TB_BROWSER` | Refer to `browserName` capability in chart
974
+ `TB_VERSION` | Refer to `version` capability in chart
975
+ `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
976
+ `RESOLUTION` | [Optional] Possible values: `800x600`, `1024x768`, `1280x960`, `1280x1024`, `1600x1200`, `1920x1200`, `2560x1440`
977
+ `BROWSER_SIZE`| [Optional] Specify width, height of browser window
978
+
979
+
980
+ #### Remote mobile browsers on the TestingBot service
981
+
982
+ For remotely hosted mobile web browsers on the TestingBot service, the following **Environment Variables** must be set as described in
983
+ the table below. Refer to the [TestingBot List of Available Browsers page](https://testingbot.com/support/getting-started/browsers.html) for information
984
+ regarding the specific capabilities.
985
+
986
+ **Environment Variable** | **Description**
987
+ --------------- | ----------------
988
+ `WEB_BROWSER` | Must be set to `testingbot`
989
+ `TB_USERNAME` | Must be set to your TestingBot account user name
990
+ `TB_AUTHKEY` | Must be set to your TestingBot account access key
991
+ `TB_OS` | Must be set to `MAC` (for iOS) or `ANDROID`
992
+ `TB_BROWSER` | Must be set to `safari` (for iOS) or `browser` (for Android)
993
+ `TB_VERSION` | Refer to `version` capability in chart
994
+ `TB_PLATFORM` | Must be set to `iOS` or `ANDROID`
995
+ `TB_DEVICE` | Refer to `deviceName` capability in chart
996
+ `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
997
+ `ORIENTATION` | [Optional] Set to `portrait` or `landscape`
998
+
999
+
1000
+ ### Using Browser specific Profiles in cucumber.yml
1001
+
1002
+ While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and managing
1003
+ target web browsers is to create browser specific **Profiles** that set the appropriate **Environment Variables** for each target browser
1004
+ in your `cucumber.yml` file.
1005
+
1006
+ Below is a list of Cucumber **Profiles** for supported locally and remotely hosted desktop and mobile web browsers (put these in in your
1007
+ `cucumber.yml` file). Before you can use the BrowserStack, CrossBrowserTesting, Sauce Labs, or TestingBot services, you will need to
1008
+ replace the *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization code for the cloud
1009
+ service(s) that you intend to connect with.
1010
+
1011
+
1012
+ <% desktop = "--tags ~@wip --tags ~@failing --tags @desktop --require features BROWSER_SIZE=1600,1000" %>
1013
+ <% mobile = "--tags ~@wip --tags ~@failing --tags @mobile --require features" %>
1014
+
1015
+ #==============
1016
+ # profiles for locally hosted desktop web browsers
1017
+ #==============
1018
+
1019
+ firefox: WEB_BROWSER=firefox <%= desktop %>
1020
+ safari: WEB_BROWSER=safari <%= desktop %>
1021
+ chrome: WEB_BROWSER=chrome <%= desktop %>
1022
+ ie: WEB_BROWSER=ie <%= desktop %>
1023
+ headless: WEB_BROWSER=poltergeist <%= desktop %>
1024
+
1025
+ #==============
1026
+ # profiles for locally hosted mobile web browsers (emulated locally in Firefox browser)
1027
+ # NOTE: to host emulated mobile browsers in Chrome set the HOST_BROWSER=chrome
1028
+ #==============
1029
+
1030
+ ipad: WEB_BROWSER=ipad HOST_BROWSER=firefox <%= mobile %>
1031
+ ipad_pro: WEB_BROWSER=ipad_pro HOST_BROWSER=firefox <%= mobile %>
1032
+ ipad_pro_10_5: WEB_BROWSER=ipad_pro_10_5 HOST_BROWSER=firefox <%= mobile %>
1033
+ ipad_chrome: WEB_BROWSER=ipad_chrome HOST_BROWSER=firefox <%= mobile %>
1034
+ iphone: WEB_BROWSER=iphone HOST_BROWSER=firefox <%= mobile %>
1035
+ iphone4: WEB_BROWSER=iphone4 HOST_BROWSER=firefox <%= mobile %>
1036
+ iphone5: WEB_BROWSER=iphone5 HOST_BROWSER=firefox <%= mobile %>
1037
+ iphone6: WEB_BROWSER=iphone6 HOST_BROWSER=firefox <%= mobile %>
1038
+ iphone6_plus: WEB_BROWSER=iphone6_plus HOST_BROWSER=firefox <%= mobile %>
1039
+ iphone7: WEB_BROWSER=iphone7 HOST_BROWSER=firefox <%= mobile %>
1040
+ iphone7_plus: WEB_BROWSER=iphone7_plus HOST_BROWSER=firefox <%= mobile %>
1041
+ iphone7_chrome: WEB_BROWSER=iphone7_chrome HOST_BROWSER=firefox <%= mobile %>
1042
+ iphone8: WEB_BROWSER=iphone8 HOST_BROWSER=firefox <%= mobile %>
1043
+ iphone8_plus: WEB_BROWSER=iphone8_plus HOST_BROWSER=firefox <%= mobile %>
1044
+ iphoneX: WEB_BROWSER=iphonex HOST_BROWSER=firefox <%= mobile %>
1045
+ android_phone: WEB_BROWSER=android_phone HOST_BROWSER=firefox <%= mobile %>
1046
+ nexus6: WEB_BROWSER=nexus6 HOST_BROWSER=firefox <%= mobile %>
1047
+ android_tablet: WEB_BROWSER=android_tablet HOST_BROWSER=firefox <%= mobile %>
1048
+ kindle_fire: WEB_BROWSER=kindle_fire HOST_BROWSER=firefox <%= mobile %>
1049
+ kindle_firehd7: WEB_BROWSER=kindle_firehd7 HOST_BROWSER=firefox <%= mobile %>
1050
+ kindle_firehd8: WEB_BROWSER=kindle_firehd8 HOST_BROWSER=firefox <%= mobile %>
1051
+ kindle_firehd10: WEB_BROWSER=kindle_firehd10 HOST_BROWSER=firefox <%= tablet %>
1052
+ surface: WEB_BROWSER=surface HOST_BROWSER=firefox <%= mobile %>
1053
+ blackberry_playbook: WEB_BROWSER=blackberry_playbook HOST_BROWSER=firefox <%= mobile %>
1054
+ samsung_galaxy_tab: WEB_BROWSER=samsung_galaxy_tab HOST_BROWSER=firefox <%= mobile %>
1055
+ google_nexus7: WEB_BROWSER=google_nexus7 HOST_BROWSER=firefox <%= mobile %>
1056
+ google_nexus9: WEB_BROWSER=google_nexus9 HOST_BROWSER=firefox <%= mobile %>
1057
+ google_nexus10: WEB_BROWSER=google_nexus10 HOST_BROWSER=firefox <%= mobile %>
1058
+ samsung_galaxy_s4: WEB_BROWSER=samsung_galaxy_s4 HOST_BROWSER=firefox <%= mobile %>
1059
+ samsung_galaxy_s5: WEB_BROWSER=samsung_galaxy_s5 HOST_BROWSER=firefox <%= mobile %>
1060
+ samsung_galaxy_s6: WEB_BROWSER=samsung_galaxy_s6 HOST_BROWSER=firefox <%= mobile %>
1061
+ pixel: WEB_BROWSER=pixel HOST_BROWSER=firefox <%= mobile %>
1062
+ pixel_xl: WEB_BROWSER=pixel_xl HOST_BROWSER=firefox <%= mobile %>
1063
+ windows_phone7: WEB_BROWSER=windows_phone7 HOST_BROWSER=firefox <%= mobile %>
1064
+ windows_phone8: WEB_BROWSER=windows_phone8 HOST_BROWSER=firefox <%= mobile %>
1065
+ lumia_950_xl: WEB_BROWSER=lumia_950_xl HOST_BROWSER=firefox <%= mobile %>
1066
+ blackberry_z10: WEB_BROWSER=blackberry_z10 HOST_BROWSER=firefox <%= mobile %>
1067
+ blackberry_z30: WEB_BROWSER=blackberry_z30 HOST_BROWSER=firefox <%= mobile %>
1068
+ blackberry_leap: WEB_BROWSER=blackberry_leap HOST_BROWSER=firefox <%= mobile %>
1069
+ blackberry_passport: WEB_BROWSER=blackberry_passport HOST_BROWSER=firefox <%= mobile %>
1070
+
1071
+
1072
+ #==============
1073
+ # profiles for mobile device screen orientation
1074
+ #==============
1075
+
1076
+ portrait: ORIENTATION=portrait
1077
+ landscape: ORIENTATION=landscape
1078
+
1079
+
1080
+ #==============
1081
+ # profiles for mobile Safari web browsers hosted within XCode iOS simulator
1082
+ # NOTE: Requires installation of XCode, iOS version specific target simulators, Appium, and the appium_capybara gem
1083
+ #==============
1084
+
1085
+ appium_ios: WEB_BROWSER=appium APP_PLATFORM_NAME="iOS" APP_BROWSER="Safari" <%= mobile %>
1086
+ app_ios_93: --profile appium_ios APP_VERSION="9.3"
1087
+ app_ios_92: --profile appium_ios APP_VERSION="9.2"
1088
+ ipad_retina_93_sim: --profile app_ios_93 APP_DEVICE="iPad Retina"
1089
+ ipad_pro_93_sim: --profile app_ios_93 APP_DEVICE="iPad Pro"
1090
+ ipad_air_93_sim: --profile app_ios_93 APP_DEVICE="iPad Air"
1091
+ ipad_air2_93_sim: --profile app_ios_93 APP_DEVICE="iPad Air 2"
1092
+ ipad_2_93_sim: --profile app_ios_93 APP_DEVICE="iPad 2"
1093
+ iphone_6s_plus_93_sim: --profile app_ios_93 APP_DEVICE="iPhone 6s Plus"
1094
+ iphone_6s_93_sim: --profile app_ios_93 APP_DEVICE="iPhone 6s"
1095
+ iphone_5s_93_sim: --profile app_ios_93 APP_DEVICE="iPhone 5s"
1096
+ iphone_4s_93_sim: --profile app_ios_93 APP_DEVICE="iPhone 4s"
1097
+
1098
+
1099
+ #==============
1100
+ # profiles for remotely hosted web browsers on the BrowserStack service
1101
+ #==============
1102
+
1103
+ browserstack: WEB_BROWSER=browserstack BS_USERNAME=<INSERT USER NAME HERE> BS_AUTHKEY=<INSERT PASSWORD HERE>
1104
+ bs_desktop: --profile browserstack <%= desktop %> RESOLUTION="1920x1080"
1105
+ bs_mobile: --profile browserstack <%= mobile %>
1106
+
1107
+ # BrowserStack OS X desktop browser profiles
1108
+ bs_macos_sierra: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="Sierra"
1109
+ bs_ff_sierra: --profile bs_macos_sierra BS_BROWSER="Firefox"
1110
+ bs_chrome_sierra: --profile bs_macos_sierra BS_BROWSER="Chrome"
1111
+ bs_safari_sierra: --profile bs_macos_sierra BS_BROWSER="Safari"
1112
+
1113
+ bs_osx_el_capitan: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="El Capitan"
1114
+ bs_ff_el_cap: --profile bs_osx_el_capitan BS_BROWSER="Firefox"
1115
+ bs_chrome_el_cap: --profile bs_osx_el_capitan BS_BROWSER="Chrome"
1116
+ bs_safari_el_cap: --profile bs_osx_el_capitan BS_BROWSER="Safari"
1117
+
1118
+ bs_osx_yosemite: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="Yosemite"
1119
+ bs_ff_yos: --profile bs_osx_yosemite BS_BROWSER="Firefox"
1120
+ bs_chrome_yos: --profile bs_osx_yosemite BS_BROWSER="Chrome"
1121
+ bs_safari_yos: --profile bs_osx_yosemite BS_BROWSER="Safari"
1122
+
1123
+ bs_osx_mavericks: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="Mavericks"
1124
+ bs_ff_mav: --profile bs_osx_mavericks BS_BROWSER="Firefox"
1125
+ bs_chrome_mav: --profile bs_osx_mavericks BS_BROWSER="Chrome"
1126
+ bs_safari_mav: --profile bs_osx_mavericks BS_BROWSER="Safari"
1127
+
1128
+ # BrowserStack Windows desktop browser profiles
1129
+ bs_win7: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="7"
1130
+ bs_win8: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="8.1"
1131
+ bs_win10: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="10"
1132
+ bs_ff_win7: --profile bs_win7 BS_BROWSER="Firefox"
1133
+ bs_ff_win8: --profile bs_win8 BS_BROWSER="Firefox"
1134
+ bs_ff_win10: --profile bs_win10 BS_BROWSER="Firefox"
1135
+ bs_chrome_win7: --profile bs_win7 BS_BROWSER="Chrome"
1136
+ bs_chrome_win8: --profile bs_win8 BS_BROWSER="Chrome"
1137
+ bs_chrome_win10: --profile bs_win10 BS_BROWSER="Chrome"
1138
+
1139
+ bs_ie_win7: --profile bs_win7 BS_BROWSER="IE"
1140
+ bs_ie11_win7: --profile bs_ie_win7 BS_VERSION="11.0"
1141
+ bs_ie10_win7: --profile bs_ie_win7 BS_VERSION="10.0"
1142
+ bs_ie9_win7: --profile bs_ie_win7 BS_VERSION="9.0"
1143
+ bs_ie11_win8: --profile bs_win8 BS_BROWSER="IE" BS_VERSION="11.0"
1144
+ bs_ie10_win8: --profile bs_desktop BS_OS="Windows" BS_OS_VERSION="8.0" BS_BROWSER="IE" BS_VERSION="10.0"
1145
+ bs_ie11_win10: --profile bs_win10 BS_BROWSER="IE" BS_VERSION="11.0"
1146
+ bs_edge_win10: --profile bs_win10 BS_BROWSER="Edge" BS_VERSION="13.0"
1147
+
1148
+ # BrowserStack iOS mobile browser profiles
1149
+ bs_iphone: --profile bs_mobile BS_PLATFORM=MAC BS_OS=ios BS_BROWSER=iPhone
1150
+ bs_iphone6s_plus: --profile bs_iphone BS_DEVICE="iPhone 6S Plus"
1151
+ bs_iphone6s: --profile bs_iphone BS_DEVICE="iPhone 6S"
1152
+ bs_iphone6_plus: --profile bs_iphone BS_DEVICE="iPhone 6 Plus"
1153
+ bs_iphone6: --profile bs_iphone BS_DEVICE="iPhone 6"
1154
+ bs_iphone5s: --profile bs_iphone BS_DEVICE="iPhone 5S"
1155
+ bs_iphone4s: --profile bs_iphone BS_DEVICE="iPhone 4S (6.0)"
1156
+ bs_ipad: --profile bs_mobile BS_PLATFORM=MAC BS_BROWSER=iPad
1157
+ bs_ipad_pro: --profile bs_ipad BS_DEVICE="iPad Pro"
1158
+ bs_ipad_air2: --profile bs_ipad BS_DEVICE="iPad Air 2"
1159
+ bs_ipad_air: --profile bs_ipad BS_DEVICE="iPad Air"
1160
+ bs_ipad_mini: --profile bs_ipad BS_DEVICE="iPad Mini 4"
1161
+
1162
+ # BrowserStack iOS real device mobile browser profiles
1163
+ bs_iphone_device: --profile bs_mobile BS_BROWSER=iPhone BS_OS=ios BS_REAL_MOBILE="true"
1164
+ bs_iphone7_plus: --profile bs_iphone_device BS_DEVICE="iPhone 7 Plus"
1165
+ bs_iphone7: --profile bs_iphone_device BS_DEVICE="iPhone 7"
1166
+
1167
+ # BrowserStack Android mobile browser profiles
1168
+ bs_android: --profile bs_mobile BS_PLATFORM=ANDROID BS_BROWSER=android BS_OS=android
1169
+ bs_galaxy_s5: --profile bs_android BS_DEVICE="Samsung Galaxy S5"
1170
+ bs_kindle_fire_hd89: --profile bs_android BS_DEVICE="Amazon Kindle Fire HD 8.9"
1171
+ bs_kindle_fire_hdx7: --profile bs_android BS_DEVICE="Amazon Kindle Fire HDX 7"
1172
+ bs_kindle_fire2: --profile bs_android BS_DEVICE="Amazon Kindle Fire 2"
1173
+ bs_nexus7: --profile bs_android BS_DEVICE="Google Nexus 7"
1174
+ bs_nexus5: --profile bs_android BS_DEVICE="Google Nexus 5"
1175
+ bs_moto_razr: --profile bs_android BS_DEVICE="Motorola Razr"
1176
+ bs_sony_xperia: --profile bs_android BS_DEVICE="Sony Xperia Tipo"
1177
+
1178
+ # BrowserStack Android real device mobile browser profiles
1179
+ bs_android_device: --profile bs_mobile BS_BROWSER=android BS_OS=android BS_REAL_MOBILE="true"
1180
+ bs_google_pixel8: --profile bs_android_device BS_DEVICE="Google Pixel" BS_OS_VERSION="8.0"
1181
+ bs_google_pixel71: --profile bs_android_device BS_DEVICE="Google Pixel" BS_OS_VERSION="7.1"
1182
+ bs_nexus9: --profile bs_android_device BS_DEVICE="Google Nexus 9"
1183
+ bs_nexus6: --profile bs_android_device BS_DEVICE="Google Nexus 6"
1184
+ bs_galaxy_s7: --profile bs_android_device BS_DEVICE="Samsung Galaxy S7"
1185
+ bs_galaxy_s6: --profile bs_android_device BS_DEVICE="Samsung Galaxy S6"
1186
+ bs_galaxy_note4: --profile bs_android_device BS_DEVICE="Samsung Galaxy Note 4"
1187
+
1188
+
1189
+ #==============
1190
+ # profiles for remotely hosted web browsers on the CrossBrowserTesting service
1191
+ #==============
1192
+
1193
+ crossbrowser: WEB_BROWSER=crossbrowser CB_USERNAME=<INSERT USER NAME HERE> CB_AUTHKEY=<INSERT PASSWORD HERE>
1194
+ cb_desktop: --profile crossbrowser <%= desktop %>
1195
+ cb_mobile: --profile crossbrowser <%= mobile %>
1196
+
1197
+ # CrossBrowserTesting OS X desktop browser profiles
1198
+ cb_osx: --profile cb_desktop RESOLUTION="1920x1200"
1199
+ cb_macos_sierra: --profile cb_osx CB_OS="Mac10.12"
1200
+ cb_chrome_sierra: --profile cb_macos_sierra CB_BROWSER="Chrome53x64"
1201
+ cb_safari_sierra: --profile cb_macos_sierra CB_BROWSER="Safari10"
1202
+
1203
+ cb_osx_el_capitan: --profile cb_osx CB_OS="Mac10.11"
1204
+ cb_ff_el_cap: --profile cb_osx_el_capitan CB_BROWSER="FF46"
1205
+ cb_chrome_el_cap: --profile cb_osx_el_capitan CB_BROWSER="Chrome48x64"
1206
+ cb_safari_el_cap: --profile cb_osx_el_capitan CB_BROWSER="Safari9"
1207
+
1208
+ cb_osx_yosemite: --profile cb_osx CB_OS="Mac10.10"
1209
+ cb_ff_yos: --profile cb_osx_yosemite CB_BROWSER="FF46"
1210
+ cb_chrome_yos: --profile cb_osx_yosemite CB_BROWSER="Chrome48x64"
1211
+ cb_safari_yos: --profile cb_osx_yosemite CB_BROWSER="Safari8"
1212
+
1213
+ cb_osx_mavericks: --profile cb_osx CB_OS="Mac10.9"
1214
+ cb_ff_mav: --profile cb_osx_mavericks CB_BROWSER="FF46"
1215
+ cb_chrome_mav: --profile cb_osx_mavericks CB_BROWSER="Chrome48x64"
1216
+ cb_safari_mav: --profile cb_osx_mavericks CB_BROWSER="Safari7"
1217
+
1218
+ # CrossBrowserTesting Windows desktop browser profiles
1219
+ cb_win: --profile cb_desktop RESOLUTION="1920x1080"
1220
+ cb_win7: --profile cb_win CB_OS="Win7x64-C1"
1221
+ cb_win8: --profile cb_win CB_OS="Win8"
1222
+ cb_win10: --profile cb_win CB_OS="Win10"
1223
+ cb_ff_win7: --profile cb_win7 CB_BROWSER="FF46"
1224
+ cb_ff_win8: --profile cb_win8 CB_BROWSER="FF46"
1225
+ cb_ff_win10: --profile cb_win10 CB_BROWSER="FF46"
1226
+ cb_chrome_win7: --profile cb_win7 CB_BROWSER="Chrome48x64"
1227
+ cb_chrome_win8: --profile cb_win8 CB_BROWSER="Chrome48x64"
1228
+ cb_chrome_win10: --profile cb_win10 CB_BROWSER="Chrome48x64"
1229
+ cb_edge_win10: --profile cb_win10 CB_BROWSER="Edge20"
1230
+
1231
+ cb_ie11_win7: --profile cb_win7 CB_BROWSER="IE11"
1232
+ cb_ie10_win7: --profile cb_win7 CB_BROWSER="IE10"
1233
+ cb_ie9_win7: --profile cb_win7 CB_BROWSER="IE9"
1234
+ cb_ie11_win8: --profile cb_win8 CB_BROWSER="IE11"
1235
+ cb_ie10_win8: --profile cb_win8 CB_BROWSER="IE10"
1236
+ cb_ie11_win10: --profile cb_win10 CB_BROWSER="IE11"
1237
+
1238
+ # CrossBrowserTesting iOS mobile browser profiles
1239
+ cb_iphone6s_plus: --profile cb_mobile CB_PLATFORM="iPhone6sPlus-iOS9sim" CB_BROWSER="MblSafari9.0" RESOLUTION="1242x2208"
1240
+ cb_iphone6s: --profile cb_mobile CB_PLATFORM="iPhone6s-iOS9sim" CB_BROWSER="MblSafari9.0" RESOLUTION="750x1334"
1241
+ cb_iphone6_plus: --profile cb_mobile CB_PLATFORM="iPhone6Plus-iOS8sim" CB_BROWSER="MblSafari8.0" RESOLUTION="1242x2208"
1242
+ cb_iphone6: --profile cb_mobile CB_PLATFORM="iPhone6-iOS8sim" CB_BROWSER="MblSafari8.0" RESOLUTION="750x1334"
1243
+ cb_iphone5s: --profile cb_mobile CB_PLATFORM="iPhone5s-iOS7sim" CB_BROWSER="MblSafari7.0" RESOLUTION="640x1136"
1244
+ cb_ipad_pro: --profile cb_mobile CB_PLATFORM="iPadPro-iOS9Sim" CB_BROWSER="MblSafari9.0" RESOLUTION="2732x2048"
1245
+ cb_ipad_air2: --profile cb_mobile CB_PLATFORM="iPadAir2-iOS9Sim" CB_BROWSER="MblSafari9.0" RESOLUTION="2048x1536"
1246
+ cb_ipad_air: --profile cb_mobile CB_PLATFORM="iPadAir-iOS8Sim" CB_BROWSER="MblSafari8.0" RESOLUTION="2048x1536"
1247
+ cb_ipad_mini: --profile cb_mobile CB_PLATFORM="iPadMiniRetina-iOS7Sim" CB_BROWSER="MblSafari7.0" RESOLUTION="2048x1536"
1248
+
1249
+ # CrossBrowserTesting Android mobile browser profiles
1250
+ cb_nexus7: --profile cb_mobile CB_PLATFORM="Nexus7-And42" CB_BROWSER="MblChrome37" RESOLUTION="800x1280"
1251
+ cb_galaxy_tab2: --profile cb_mobile CB_PLATFORM="GalaxyTab2-And41" CB_BROWSER="MblChrome38" RESOLUTION="1280x800"
1252
+ cb_galaxy_s5: --profile cb_mobile CB_PLATFORM="GalaxyS5-And44" CB_BROWSER="MblChrome35" RESOLUTION="1080x1920"
1253
+ cb_galaxy_s4: --profile cb_mobile CB_PLATFORM="GalaxyS4-And42" CB_BROWSER="MblChrome33" RESOLUTION="1080x1920"
1254
+
1255
+
1256
+ #==============
1257
+ # profiles for remotely hosted web browsers on the SauceLabs service
1258
+ #==============
1259
+
1260
+ saucelabs: WEB_BROWSER=saucelabs SL_USERNAME=<INSERT USER NAME HERE> SL_AUTHKEY=<INSERT PASSWORD HERE>
1261
+ sl_desktop: --profile saucelabs <%= desktop %>
1262
+
1263
+ # SauceLabs OS X desktop browser profiles
1264
+ sl_osx_sierra: --profile sl_desktop SL_OS="macOS 10.12"
1265
+ sl_ff_sierra: --profile sl_osx_sierra SL_BROWSER="firefox"
1266
+ sl_chrome_sierra: --profile sl_osx_sierra SL_BROWSER="chrome"
1267
+ sl_safari_sierra: --profile sl_osx_sierra SL_BROWSER="safari"
1268
+
1269
+ sl_osx_el_capitan: --profile sl_desktop SL_OS="OS X 10.11"
1270
+ sl_ff_el_cap: --profile sl_osx_el_capitan SL_BROWSER="firefox"
1271
+ sl_chrome_el_cap: --profile sl_osx_el_capitan SL_BROWSER="chrome"
1272
+ sl_safari_el_cap: --profile sl_osx_el_capitan SL_BROWSER="safari"
1273
+
1274
+ sl_osx_yosemite: --profile sl_desktop SL_OS="OS X 10.10" RESOLUTION="1920x1200"
1275
+ sl_ff_yos: --profile sl_osx_yosemite SL_BROWSER="firefox"
1276
+ sl_chrome_yos: --profile sl_osx_yosemite SL_BROWSER="chrome"
1277
+ sl_safari_yos: --profile sl_osx_yosemite SL_BROWSER="safari"
1278
+
1279
+ sl_osx_mavericks: --profile sl_desktop SL_OS="OS X 10.9" RESOLUTION="1920x1200"
1280
+ sl_ff_mav: --profile sl_osx_mavericks SL_BROWSER="firefox"
1281
+ sl_chrome_mav: --profile sl_osx_mavericks SL_BROWSER="chrome"
1282
+ sl_safari_mav: --profile sl_osx_mavericks SL_BROWSER="safari"
1283
+
1284
+ # SauceLabs Windows desktop browser profiles
1285
+ sl_win7: --profile sl_desktop SL_OS="Windows 7" RESOLUTION="1920x1200"
1286
+ sl_win8: --profile sl_desktop SL_OS="Windows 8.1" RESOLUTION="1280x1024"
1287
+ sl_win10: --profile sl_desktop SL_OS="Windows 10" RESOLUTION="1280x1024"
1288
+ sl_ff_win7: --profile sl_win7 SL_BROWSER="firefox"
1289
+ sl_ff_win8: --profile sl_win8 SL_BROWSER="firefox"
1290
+ sl_ff_win10: --profile sl_win10 SL_BROWSER="firefox"
1291
+ sl_chrome_win7: --profile sl_win7 SL_BROWSER="chrome"
1292
+ sl_chrome_win8: --profile sl_win8 SL_BROWSER="chrome"
1293
+ sl_chrome_win10: --profile sl_win10 SL_BROWSER="chrome"
1294
+
1295
+ sl_ie11_win7: --profile sl_win7 SL_BROWSER="internet explorer" SL_VERSION="11.0"
1296
+ sl_ie10_win7: --profile sl_win7 SL_BROWSER="internet explorer" SL_VERSION="10.0"
1297
+ sl_ie9_win7: --profile sl_win7 SL_BROWSER="internet explorer" SL_VERSION="9.0"
1298
+ sl_ie11_win8: --profile sl_win8 SL_BROWSER="internet explorer" SL_VERSION="11.0"
1299
+ sl_ie11_win10: --profile sl_win10 SL_BROWSER="internet explorer"
1300
+
1301
+
1302
+ #==============
1303
+ # profiles for remotely hosted web browsers on the TestingBot service
1304
+ #==============
1305
+
1306
+ testingbot: WEB_BROWSER=testingbot TB_USERNAME=<INSERT USER NAME HERE> TB_AUTHKEY=<INSERT PASSWORD HERE>
1307
+ tb_desktop: --profile testingbot <%= desktop %> RESOLUTION="1920x1200"
1308
+ tb_mobile: --profile testingbot <%= mobile %>
1309
+
1310
+ # TestingBot OS X desktop browser profiles
1311
+ tb_macos_sierra: --profile tb_desktop TB_OS="SIERRA"
1312
+ tb_ff_sierra: --profile tb_macos_sierra TB_BROWSER="firefox"
1313
+ tb_chrome_sierra: --profile tb_macos_sierra TB_BROWSER="chrome"
1314
+ tb_safari_sierra: --profile tb_macos_sierra TB_BROWSER="safari" TB_VERSION="10"
1315
+
1316
+ tb_osx_el_capitan: --profile tb_desktop TB_OS="CAPITAN"
1317
+ tb_ff_el_cap: --profile tb_osx_el_capitan TB_BROWSER="firefox"
1318
+ tb_chrome_el_cap: --profile tb_osx_el_capitan TB_BROWSER="chrome"
1319
+ tb_safari_el_cap: --profile tb_osx_el_capitan TB_BROWSER="safari" TB_VERSION="9"
1320
+
1321
+ tb_osx_yosemite: --profile tb_desktop TB_OS="YOSEMITE"
1322
+ tb_ff_yos: --profile tb_osx_yosemite TB_BROWSER="firefox"
1323
+ tb_chrome_yos: --profile tb_osx_yosemite TB_BROWSER="chrome"
1324
+ tb_safari_yos: --profile tb_osx_yosemite TB_BROWSER="safari" TB_VERSION="8"
1325
+
1326
+ tb_osx_mavericks: --profile tb_desktop TB_OS="MAVERICKS"
1327
+ tb_ff_mav: --profile tb_osx_mavericks TB_BROWSER="firefox"
1328
+ tb_chrome_mav: --profile tb_osx_mavericks TB_BROWSER="chrome"
1329
+ tb_safari_mav: --profile tb_osx_mavericks TB_BROWSER="safari" TB_VERSION="7"
1330
+
1331
+ # TestingBot Windows desktop browser profiles
1332
+ tb_win7: --profile tb_desktop TB_OS="WIN7"
1333
+ tb_win8: --profile tb_desktop TB_OS="WIN8"
1334
+ tb_win10: --profile tb_desktop TB_OS="WIN10"
1335
+ tb_ff_win7: --profile tb_win7 TB_BROWSER="firefox"
1336
+ tb_ff_win8: --profile tb_win8 TB_BROWSER="firefox"
1337
+ tb_ff_win10: --profile tb_win10 TB_BROWSER="firefox"
1338
+ tb_chrome_win7: --profile tb_win7 TB_BROWSER="chrome"
1339
+ tb_chrome_win8: --profile tb_win8 TB_BROWSER="chrome"
1340
+ tb_chrome_win10: --profile tb_win10 TB_BROWSER="chrome"
1341
+
1342
+ tb_ie9_win7: --profile tb_win7 TB_BROWSER="internet explorer" TB_VERSION="9"
1343
+ tb_ie11_win8: --profile tb_win8 TB_BROWSER="internet explorer" TB_VERSION="11"
1344
+ tb_ie10_win8: --profile tb_win8 TB_BROWSER="internet explorer" TB_VERSION="10"
1345
+ tb_ie11_win10: --profile tb_win10 TB_BROWSER="internet explorer" TB_VERSION="11"
1346
+ tb_edge_win10: --profile tb_win10 TB_BROWSER="microsoftedge" TB_VERSION="14"
1347
+
1348
+ # TestingBot iOS mobile browser profiles
1349
+ tb_ios: --profile tb_mobile TB_OS="MAC" TB_BROWSER="safari" TB_PLATFORM="iOS"
1350
+ tb_iphone6s_plus_10: --profile tb_ios TB_VERSION="10.0" TB_DEVICE="iPhone 6s Plus"
1351
+ tb_iphone6s_plus_93: --profile tb_ios TB_VERSION="9.3" TB_DEVICE="iPhone 6s Plus"
1352
+ tb_iphone6_plus_10: --profile tb_ios TB_VERSION="10.0" TB_DEVICE="iPhone 6 Plus"
1353
+ tb_iphone6_plus_93: --profile tb_ios TB_VERSION="9.3" TB_DEVICE="iPhone 6 Plus"
1354
+ tb_iphone6s_10: --profile tb_ios TB_VERSION="10.0" TB_DEVICE="iPhone 6s"
1355
+ tb_iphone6s_93: --profile tb_ios TB_VERSION="9.3" TB_DEVICE="iPhone 6s"
1356
+ tb_iphone5s_10: --profile tb_ios TB_VERSION="10.0" TB_DEVICE="iPhone 5s"
1357
+ tb_iphone5s_93: --profile tb_ios TB_VERSION="9.3" TB_DEVICE="iPhone 5s"
1358
+ tb_ipad_pro_10: --profile tb_ios TB_VERSION="10.0" TB_DEVICE="iPad Pro"
1359
+ tb_ipad_pro_93: --profile tb_ios TB_VERSION="9.3" TB_DEVICE="iPad Pro"
1360
+ tb_ipad_air2_10: --profile tb_ios TB_VERSION="10.0" TB_DEVICE="iPad Air 2"
1361
+ tb_ipad_air2_93: --profile tb_ios TB_VERSION="9.3" TB_DEVICE="iPad Air 2"
1362
+
1363
+
1364
+ # TestingBot Android mobile browser profiles
1365
+ tb_android: --profile tb_mobile TB_OS="ANDROID" TB_BROWSER="browser" TB_PLATFORM="Android"
1366
+ tb_nexus_s: --profile tb_android TB_VERSION="6.0" TB_DEVICE="Nexus S"
1367
+ tb_nexus_1: --profile tb_android TB_VERSION="5.0" TB_DEVICE="Nexus 1"
1368
+ tb_nexus_4: --profile tb_android TB_VERSION="6.0" TB_DEVICE="Nexus 4"
1369
+ tb_galaxy_nexus: --profile tb_android TB_VERSION="4.4" TB_DEVICE="Galaxy Nexus"
1370
+ tb_galaxy_s4: --profile tb_android TB_VERSION="4.4" TB_DEVICE="Galaxy S4"
1371
+ tb_galaxy_s5: --profile tb_android TB_VERSION="5.0" TB_DEVICE="Galaxy S5"
1372
+ tb_galaxy_s6: --profile tb_android TB_VERSION="6.0" TB_DEVICE="Galaxy S6"
1373
+
1374
+
1375
+ 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
1376
+ invoking Cucumber in the command line. For instance, the following command invokes Cucumber and specifies that a local instance of Chrome
1377
+ will be used as the target web browser:
1378
+
1379
+ $ cucumber -p chrome
1380
+
1381
+
1382
+ The following command specifies that Cucumber will run tests against a local instance of Firefox, which will be used to emulate an iPad Pro
1383
+ in landscape orientation:
1384
+
1385
+ $ cucumber -p ipad_pro -p landscape
1386
+
1387
+
1388
+ The following command specifies that Cucumber will run tests against an iPad Pro with iOS version 9.3 in an XCode Simulator
1389
+ in landscape orientation:
1390
+
1391
+ $ cucumber -p ipad_pro_93_sim -p landscape
1392
+
1393
+ NOTE: Appium must be running prior to executing this command
1394
+
1395
+
1396
+ The following command specifies that Cucumber will run tests against a remotely hosted Safari web browser running on an OS X Yosemite
1397
+ virtual machine on the BrowserStack service:
1398
+
1399
+ cucumber -p bs_safari_yos
1400
+
1401
+
1402
+ The following command specifies that Cucumber will run tests against a remotely hosted Mobile Safari web browser on an iPhone 6s Plus in
1403
+ landscape orientation running on the BrowserStack service:
1404
+
1405
+ $ cucumber -p bs_iphone6_plus -p landscape
1406
+
1407
+
1408
+
1409
+ ## Web Test Automation Framework Implementation
1410
+
1411
+ <img src="http://i.imgur.com/RvpxjzW.jpg" width="1024" alt="Web Framework Overview" title="Web Framework Overview">
1412
+
1413
+
1414
+
1415
+
1416
+ ## Copyright and License
1417
+
1418
+ TestCentricity™ Framework is Copyright (c) 2014-2017, Tony Mrozinski.
1419
+ All rights reserved.
1420
+
1421
+
1422
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions
1423
+ are met:
1424
+
1425
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
1426
+
1427
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in
1428
+ the documentation and/or other materials provided with the distribution.
1429
+
1430
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from
1431
+ this software without specific prior written permission.
1432
+
1433
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1434
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1435
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1436
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1437
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
1438
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.