testcentricity_web 2.1.7 → 2.1.8

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