testcentricity_web 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1f34273e6126cc792065a37bdb761e8ca0f0c597e9030b3f9f58f2846a8d5c2
4
- data.tar.gz: 43a3dbfb5c94a0ff10b161e01d4087c3973ed11b61596363b455e1f82897c403
3
+ metadata.gz: 7aca63221f1add18272c5804ac99594a658175ef4590033954f42bc1920aafea
4
+ data.tar.gz: 051be4c6fbd25be53fa9dfeb04ed6c71c1bcf99de3e08b3bb22b4f4f930d5b17
5
5
  SHA512:
6
- metadata.gz: 12b80dbd95dc924ca9b51b0ac5d7876f55642e8824b5f38e0fd19f008487a23f3a4d24418712785d93e93d1f330fbeaa03e7754c2fc8a3a9967d931cf47aab0b
7
- data.tar.gz: a1bdb14f26c27829e71f0fb96c2ccb7183e5058dca09e46b0a515595611680ca6692f6c1a52f3c38cf60ba59c04f3ce720b29f8cd50be507a40119a13298d308
6
+ metadata.gz: 8b7ec300f994b85b223bf71b0fc15ba82fc210979f1c979cea34f0e81efcf49e827a072a12f4a2430392c53dd07f78000fe115d18cca020030190098f7f3a490
7
+ data.tar.gz: '00959032416c0d922a883279c0eebe21d871d9dd80e2c7a6d82fb03fe1a423c25ef0e199d34acd2936a12d11f6fa7620572cd1b198c614eff3ab52729f47f929'
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # CHANGELOG
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [4.3.1] - 19-AUGUST-2022
5
+
6
+ ### Added
7
+ * Added support for connecting to remote mobile browsers on iOS simulators and Android emulators on the TestingBot service.
8
+
4
9
 
5
10
  ## [4.3.0] - 01-AUGUST-2022
6
11
 
data/README.md CHANGED
@@ -4,13 +4,15 @@
4
4
  ![Gem Downloads](https://img.shields.io/gem/dt/testcentricity_web) ![Maintained](https://img.shields.io/maintenance/yes/2022)
5
5
 
6
6
 
7
- The TestCentricity™ Web core framework for desktop and mobile web browser-based app testing implements a Page Object Model DSL for use
8
- with Cucumber (version 7.x or greater), Capybara (version 3.37), and Selenium-Webdriver (version 4.3). It also facilitates the configuration of the appropriate
9
- Selenium-Webdriver capabilities required to establish a connection with a local or cloud hosted desktop or mobile web browser.
7
+ The TestCentricity™ Web core framework for desktop and mobile web browser-based app testing implements a Page Object Model
8
+ DSL for use with Cucumber (version 7.x or greater), Capybara (version 3.37), and Selenium-Webdriver (version 4.3). It also
9
+ facilitates the configuration of the appropriate Selenium-Webdriver capabilities required to establish a connection with a
10
+ local or cloud hosted desktop or mobile web browser.
10
11
 
11
12
  The TestCentricity™ Web gem supports running automated tests against the following web test targets:
12
13
  * locally hosted desktop browsers (Chrome, Edge, Firefox, Safari, or IE)
13
14
  * locally hosted "headless" Chrome, Firefox, or Edge browsers
15
+ *
14
16
  * remote desktop and emulated mobile web browsers hosted on Selenium Grid 4 and Dockerized Selenium Grid 4 environments
15
17
  * mobile Safari browsers on iOS device simulators or physical iOS devices (using Appium and XCode on macOS)
16
18
  * mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on macOS)
@@ -36,8 +38,8 @@ can be found [here](https://github.com/TestCentricity/tc_web_sample).
36
38
 
37
39
  ## Installation
38
40
 
39
- TestCentricity Web version 4.1 and above requires Ruby 2.7.5 or later. To install the TestCentricity Web gem, add this line to your
40
- automation project's Gemfile:
41
+ TestCentricity Web version 4.1 and above requires Ruby 2.7.5 or later. To install the TestCentricity Web gem, add this line
42
+ to your automation project's Gemfile:
41
43
 
42
44
  gem 'testcentricity_web'
43
45
 
@@ -70,8 +72,8 @@ If you are using RSpec instead, you need to require the following in your `spec_
70
72
 
71
73
  ### Using Appium
72
74
 
73
- If you will be running your tests on mobile Safari browsers on simulated iOS devices using Appium and XCode Simulators, you need to require
74
- the following in your `env.rb` and/or `spec_helper.rb` file:
75
+ If you will be running your tests on mobile Safari browsers on simulated iOS devices using Appium and XCode Simulators, you
76
+ need to require the following in your `env.rb` and/or `spec_helper.rb` file:
75
77
 
76
78
  require 'appium_capybara'
77
79
 
@@ -86,21 +88,23 @@ And then execute:
86
88
 
87
89
  ## PageObjects
88
90
 
89
- 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
90
- in tests. A **Page Object** is an object that represents a single page in your AUT (Application Under Test). **Page Objects** encapsulate the
91
- implementation details of a web page and expose an API that supports interaction with, and validation of the UI elements on the page.
91
+ The **Page Object Model** is a test automation pattern that aims to create an abstraction of your web app's User Interface
92
+ that can be used in tests. A **Page Object** represents a single page in your AUT (Application Under Test). **Page Objects**
93
+ encapsulate the implementation details of a web page and expose an API that supports interaction with, and validation of
94
+ the UI elements on the page.
92
95
 
93
- **Page Objects** makes it easier to maintain automated tests because changes to page UI elements are updated in only one location - in the
94
- **Page Object** class definition. By adopting a **Page Object Model**, Cucumber Feature files and step definitions are no longer required to
95
- hold specific information about a page's UI objects, thus minimizing maintenance requirements. If any element on, or property of a page changes
96
- (URL path, text field attributes, button captions, etc.), maintenance is performed in the `PageObject` class definition only, typically with
97
- no need to update the affected feature file, scenarios, or step definitions.
96
+ **Page Objects** makes it easier to maintain automated tests because changes to page UI elements are updated in only one
97
+ location - in the **Page Object** class definition. By adopting a **Page Object Model**, Cucumber Feature files and step
98
+ definitions are no longer required to hold specific information about a page's UI objects, thus minimizing maintenance
99
+ requirements. If any element on, or property of a page changes (URL path, text field attributes, button captions, etc.),
100
+ maintenance is performed in the `PageObject` class definition only, typically with no need to update the affected feature
101
+ file, scenarios, or step definitions.
98
102
 
99
103
 
100
104
  ### Defining a PageObject
101
105
 
102
- Your `PageObject` class definitions should be contained within individual `.rb` files in the `features/support/pages` folder of your
103
- test automation project. You define new `PageObjects` as shown below:
106
+ Your `PageObject` class definitions should be contained within individual `.rb` files in the `features/support/pages` folder
107
+ of your test automation project. You define new `PageObjects` as shown below:
104
108
 
105
109
  class LoginPage < TestCentricity::PageObject
106
110
  end
@@ -116,25 +120,25 @@ test automation project. You define new `PageObjects` as shown below:
116
120
 
117
121
  ### Adding Traits to your PageObject
118
122
 
119
- Web pages typically have names and URLs associated with them. Web pages also typically have a unique object or attribute that, when present,
120
- indicates that the page's contents have fully loaded.
123
+ Web pages typically have names and URLs associated with them. Web pages also typically have a unique object or attribute
124
+ that, when present, indicates that the page's contents have fully loaded.
121
125
 
122
- The `page_name` trait is registered with the `PageManager` object, which includes a `find_page` method that takes a page name as a
123
- parameter and returns an instance of the associated `PageObject`. If you intend to use the `PageManager`, you must define a `page_name`
124
- trait for each `PageObject` to be registered.
126
+ The `page_name` trait is registered with the `PageManager` object, which includes a `find_page` method that takes a page
127
+ name as a parameter and returns an instance of the associated `PageObject`. If you intend to use the `PageManager`, you
128
+ must define a `page_name` trait for each `PageObject` to be registered.
125
129
 
126
- 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.
127
- `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
128
- an `Array` of `String` values representing those page names.
130
+ The `page_name` trait is usually a `String` value that represents the name of the page that will be matched by the `PageManager.findpage`
131
+ method. `page_name` traits are case and white-space sensitive. For pages that may be referenced with multiple names, the
132
+ `page_name` trait may also be an `Array` of `String` values representing those page names.
129
133
 
130
- 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
131
- `page_locator` trait is a CSS or Xpath expression that uniquely identifies the object or attribute. The `verify_page_exists` method waits
132
- for the `page_locator` trait to exist.
134
+ A `page_locator` trait is defined if a page has a unique object or attribute that exists once the page's contents have fully
135
+ loaded. The `page_locator` trait is a CSS or Xpath expression that uniquely identifies the object or attribute. The
136
+ `verify_page_exists` method waits for the `page_locator` trait to exist.
133
137
 
134
- 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
135
- when calling the `WebDriverConnect.initialize_web_driver` method, then your `page_url` trait can be the relative URL slug that will
136
- 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
137
- via a URL.
138
+ 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
139
+ specify a base URL when calling the `WebDriverConnect.initialize_web_driver` method, then your `page_url` trait can be the
140
+ relative URL slug that will be appended to the base URL specified in `app_host`. Specifying a `page_url` trait is optional,
141
+ as not all web pages can be directly loaded via a URL.
138
142
 
139
143
  You define your page's **Traits** as shown below:
140
144
 
@@ -204,9 +208,9 @@ Web pages are made up of UI elements like text fields, check boxes, combo boxes,
204
208
 
205
209
  ### Adding Methods to your PageObject
206
210
 
207
- It is good practice for your Cucumber step definitions to call high level methods in your your `PageObject` instead of directly accessing
208
- and interacting with a page object's UI elements. You can add high level methods to your `PageObject` class definition for interacting with
209
- the UI to hide implementation details, as shown below:
211
+ It is good practice for your Cucumber step definitions to call high level methods in your your `PageObject` instead of
212
+ directly accessing and interacting with a page object's UI elements. You can add high level methods to your `PageObject`
213
+ class definition for interacting with the UI to hide implementation details, as shown below:
210
214
 
211
215
  class LoginPage < TestCentricity::PageObject
212
216
  trait(:page_name) { 'Login' }
@@ -303,9 +307,10 @@ Once your `PageObjects` have been instantiated, you can call your methods as sho
303
307
 
304
308
  ## PageSections
305
309
 
306
- A `PageSection` is a collection of **UI Elements** that may appear in multiple locations on a page, or on multiple pages in a web
307
- app. It is a collection of **UI Elements** that represent a conceptual area of functionality, like a navigation bar, a search capability,
308
- or a menu. **UI Elements** and functional behavior are confined to the scope of a `PageSection` object.
310
+ A `PageSection` is a collection of **UI Elements** that may appear in multiple locations on a page, or on multiple pages
311
+ in a web app. It is a collection of **UI Elements** that represent a conceptual area of functionality, like a navigation
312
+ bar, a search capability, or a menu. **UI Elements** and functional behavior are confined to the scope of a `PageSection`
313
+ object.
309
314
 
310
315
  <img src="https://i.imgur.com/BTgi59R.jpg" alt="Navigation Header" title="Navigation Header">
311
316
 
@@ -319,8 +324,8 @@ A `PageSection` may contain other `PageSection` objects.
319
324
 
320
325
  ### Defining a PageSection
321
326
 
322
- Your `PageSection` class definitions should be contained within individual `.rb` files in the `features/support/sections` folder of
323
- your test automation project. You define new `PageSection` as shown below:
327
+ Your `PageSection` class definitions should be contained within individual `.rb` files in the `features/support/sections`
328
+ folder of your test automation project. You define new `PageSection` as shown below:
324
329
 
325
330
  class SearchForm < TestCentricity::PageSection
326
331
  end
@@ -341,8 +346,8 @@ You define your section's **Traits** as shown below:
341
346
 
342
347
  ### Adding UI Elements to your PageSection
343
348
 
344
- `PageSections` are typically made up of UI elements like text fields, check boxes, combo boxes, radio buttons, tables, lists, buttons, etc.
345
- **UI Elements** are added to your `PageSection` class definition as shown below:
349
+ `PageSections` are typically made up of UI elements like text fields, check boxes, combo boxes, radio buttons, tables, lists,
350
+ buttons, etc. **UI Elements** are added to your `PageSection` class definition as shown below:
346
351
 
347
352
  class SearchForm < TestCentricity::PageSection
348
353
  trait(:section_locator) { 'form#gnav-search' }
@@ -393,10 +398,10 @@ Once your `PageObject` has been instantiated, you can call its `PageSection` met
393
398
 
394
399
  ## UIElements
395
400
 
396
- `PageObjects` and `PageSections` are typically made up of **UI Element** like text fields, check boxes, select lists (combo boxes),
397
- radio buttons, tables, ordered and unordered lists, buttons, images, HTML5 video objects, HTML5 audio objects, etc. **UI Elements** are declared
398
- and instantiated within the class definition of the `PageObject` or `PageSection` in which they are contained. With TestCentricity Web,
399
- all UI elements are based on the `UIElement` class.
401
+ `PageObjects` and `PageSections` are typically made up of **UI Element** like text fields, check boxes, select lists (combo
402
+ boxes), radio buttons, tables, ordered and unordered lists, buttons, images, HTML5 video objects, HTML5 audio objects, etc.
403
+ **UI Elements** are declared and instantiated within the class definition of the `PageObject` or `PageSection` in which they
404
+ are contained. With TestCentricity Web, all UI elements are based on the `UIElement` class.
400
405
 
401
406
 
402
407
  ### Declaring and Instantiating UIElements
@@ -408,8 +413,8 @@ Single `UIElement` declarations have the following format:
408
413
  * The `elementName` is the unique name that you will use to refer to the UI element and is specified as a `Symbol`.
409
414
  * The `locator` is the CSS or XPath attribute that uniquely and unambiguously identifies the `UIElement`.
410
415
 
411
- Multiple `UIElement` declarations for a collection of elements of the same type can be performed by passing a hash table containing the
412
- names and locators of each individual element.
416
+ Multiple `UIElement` declarations for a collection of elements of the same type can be performed by passing a hash table
417
+ containing the names and locators of each individual element.
413
418
 
414
419
  ### Example UIElement Declarations
415
420
 
@@ -475,8 +480,9 @@ Supported `UIElement` elementTypes and their declarations have the following for
475
480
  end
476
481
 
477
482
 
478
- Refer to the Class List documentation for the `PageObject` and `PageSection` classes for details on the class methods used for declaring
479
- and instantiating `UIElements`. Examples of UI element declarations can be found in the ***Adding UI Elements to your PageObject*** and
483
+ Refer to the Class List documentation for the `PageObject` and `PageSection` classes for details on the class methods used
484
+ for declaring and instantiating `UIElements`. Examples of UI element declarations can be found in the ***Adding UI Elements
485
+ to your PageObject*** and
480
486
  ***Adding UI Elements to your PageSection*** sections above.
481
487
 
482
488
 
@@ -570,24 +576,26 @@ With TestCentricity, all UI elements are based on the `UIElement` class, and inh
570
576
 
571
577
  ### Populating your PageObject or PageSection with data
572
578
 
573
- A typical automated test may be required to perform the entry of test data by interacting with various `UIElements` on your `PageObject` or
574
- `PageSection`. This data entry can be performed using the various object action methods (listed above) for each `UIElement` that needs to be
575
- interacted with.
579
+ A typical automated test may be required to perform the entry of test data by interacting with various `UIElements` on your
580
+ `PageObject` or `PageSection`. This data entry can be performed using the various object action methods (listed above) for
581
+ each `UIElement` that needs to be interacted with.
576
582
 
577
- The `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods support the entry of test data into a collection of
578
- `UIElements`. The `populate_data_fields` method accepts a hash containing key/hash pairs of `UIElements` and their associated data to be
579
- entered. Data values must be in the form of a `String` for `textfield`, `selectlist`, and `filefield` controls. For `checkbox` and `radio`
580
- controls, data must either be a `Boolean` or a `String` that evaluates to a `Boolean` value (Yes, No, 1, 0, true, false). For `range` controls,
581
- data must be an `Integer`. For `input(type='color')` color picker controls, which are specified as a `textfield`, data must be in the form
582
- of a hex color `String`. For `section` objects, data values must be a `String`, and the `section` object must have a `set` method defined.
583
+ The `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods support the entry of test data into a
584
+ collection of `UIElements`. The `populate_data_fields` method accepts a hash containing key/hash pairs of `UIElements` and
585
+ their associated data to be entered. Data values must be in the form of a `String` for `textfield`, `selectlist`, and `filefield`
586
+ controls. For `checkbox` and `radio` controls, data must either be a `Boolean` or a `String` that evaluates to a `Boolean`
587
+ value (Yes, No, 1, 0, true, false). For `range` controls, data must be an `Integer`. For `input(type='color')` color picker
588
+ controls, which are specified as a `textfield`, data must be in the form of a hex color `String`. For `section` objects, data
589
+ values must be a `String`, and the `section` object must have a `set` method defined.
583
590
 
584
- The `populate_data_fields` method verifies that data attributes associated with each `UIElement` is not `nil` or `empty` before attempting to
585
- enter data into the `UIElement`.
591
+ The `populate_data_fields` method verifies that data attributes associated with each `UIElement` is not `nil` or `empty`
592
+ before attempting to enter data into the `UIElement`.
586
593
 
587
- The optional `wait_time` parameter is used to specify the time (in seconds) to wait for each `UIElement` to become viable for data entry
588
- (the `UIElement` must be visible and enabled) before entering the associated data value. This option is useful in situations where entering data,
589
- or setting the state of a `UIElement` might cause other `UIElements` to become visible or active. Specifying a wait_time value ensures that the
590
- subsequent `UIElements` will be ready to be interacted with as states are changed. If the wait time is `nil`, then the wait time will be 5 seconds.
594
+ The optional `wait_time` parameter is used to specify the time (in seconds) to wait for each `UIElement` to become viable
595
+ for data entry (the `UIElement` must be visible and enabled) before entering the associated data value. This option is useful
596
+ in situations where entering data, or setting the state of a `UIElement` might cause other `UIElements` to become visible
597
+ or active. Specifying a wait_time value ensures that the subsequent `UIElements` will be ready to be interacted with as
598
+ states are changed. If the wait time is `nil`, then the wait time will be 5 seconds.
591
599
 
592
600
  def enter_data(user_data)
593
601
  fields = {
@@ -605,14 +613,14 @@ subsequent `UIElements` will be ready to be interacted with as states are change
605
613
 
606
614
  ### Verifying UIElements on your PageObject or PageSection
607
615
 
608
- A typical automated test executes one or more interactions with the user interface, and then performs a validation to verify whether
609
- the expected state of the UI has been achieved. This verification can be performed using the various object state methods (listed above)
610
- for each `UIElement` that requires verification. Depending on the complexity and number of `UIElements` to be verified, the code required to
611
- verify the presence of `UIElements` and their correct states can become cumbersome.
616
+ A typical automated test executes one or more interactions with the user interface, and then performs a validation to verify
617
+ whether the expected state of the UI has been achieved. This verification can be performed using the various object state
618
+ methods (listed above) for each `UIElement` that requires verification. Depending on the complexity and number of `UIElements`
619
+ to be verified, the code required to verify the presence of `UIElements` and their correct states can become cumbersome.
612
620
 
613
- The `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods support the verification of multiple properties of multiple
614
- UI elements on a `PageObject` or `PageSection`. The `verify_ui_states` method accepts a hash containing key/hash pairs of UI
615
- elements and their properties or attributes to be verified.
621
+ The `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods support the verification of multiple properties
622
+ of multiple UI elements on a `PageObject` or `PageSection`. The `verify_ui_states` method accepts a hash containing key/hash
623
+ pairs of UI elements and their properties or attributes to be verified.
616
624
 
617
625
  ui = {
618
626
  object1 => { property: state },
@@ -621,9 +629,9 @@ elements and their properties or attributes to be verified.
621
629
  }
622
630
  verify_ui_states(ui)
623
631
 
624
- The `verify_ui_states` method queues up any exceptions that occur while verifying each object's properties until all `UIElements` and their
625
- properties have been checked, and then posts any exceptions encountered upon completion. Posted exceptions include a screenshot with a red
626
- dashed highlight around the UI element that did not match the expected results.
632
+ The `verify_ui_states` method queues up any exceptions that occur while verifying each object's properties until all `UIElements`
633
+ and their properties have been checked, and then posts any exceptions encountered upon completion. Posted exceptions include
634
+ a screenshot with a red dashed highlight around the UI element that did not match the expected results.
627
635
 
628
636
  The `verify_ui_states` method supports the following property/state pairs:
629
637
 
@@ -893,18 +901,18 @@ Baseline translation strings are stored in `.yml` files in the `config/locales/`
893
901
 
894
902
  ### Working with custom UIElements
895
903
 
896
- Many responsive and touch-enabled web based user interfaces are implemented using front-end JavaScript libraries for building user
897
- interfaces based on UI components. Popular JS libraries include React, Angular, and Ember.js. These stylized and adorned controls can
898
- present a challenge when attempting to interact with them using Capybara and Selenium based automated tests.
904
+ Many responsive and touch-enabled web based user interfaces are implemented using front-end JavaScript libraries for building
905
+ user interfaces based on UI components. Popular JS libraries include React, Angular, and Ember.js. These stylized and adorned
906
+ controls can present a challenge when attempting to interact with them using Capybara and Selenium based automated tests.
899
907
 
900
908
  #### Radio and Checkbox UIElements
901
909
 
902
- Sometimes, radio buttons and checkboxes implemented using JS component libraries cannot be interacted with due to other UI elements
903
- being overlaid on top of them and the base `input(type='radio')` or `input(type='checkbox')` element not being visible.
910
+ Sometimes, radio buttons and checkboxes implemented using JS component libraries cannot be interacted with due to other UI
911
+ elements being overlaid on top of them and the base `input(type='radio')` or `input(type='checkbox')` element not being visible.
904
912
 
905
- In the screenshots below of an airline flight search and booking page, the **Roundtrip** and **One-way** radio buttons are adorned by
906
- `label` elements that also acts as proxies for their associated `input(type='radio')` elements, and they intercept the `click` actions
907
- that would normally be handled by the `input(type='radio')` elements.
913
+ In the screenshots below of an airline flight search and booking page, the **Roundtrip** and **One-way** radio buttons are
914
+ adorned by `label` elements that also acts as proxies for their associated `input(type='radio')` elements, and they intercept
915
+ the `click` actions that would normally be handled by the `input(type='radio')` elements.
908
916
 
909
917
  <img src="https://i.imgur.com/7bW5u4c.jpg" alt="Roundtrip Radio button Input" title="Roundtrip Radio button Input">
910
918
 
@@ -1003,19 +1011,19 @@ as element locators.
1003
1011
  #### List UIElements
1004
1012
 
1005
1013
  The basic HTML list is typically composed of the parent `ul` object, and one or more `li` elements representing the items
1006
- in the list. However, list controls implemented using JS component libraries can be composed of multiple elements representing the
1007
- components of a list implementation.
1014
+ in the list. However, list controls implemented using JS component libraries can be composed of multiple elements representing
1015
+ the components of a list implementation.
1008
1016
 
1009
- The `List.define_list_elements` method provides a means of specifying the elements that make up the key components of a `list` control.
1010
- The method accepts a hash of element designators (key) and a CSS or Xpath expression (value) that expression that uniquely identifies
1011
- the element. Valid element designators are `list_item:`and `selected_item:`.
1017
+ The `List.define_list_elements` method provides a means of specifying the elements that make up the key components of a `list`
1018
+ control. The method accepts a hash of element designators (key) and a CSS or Xpath expression (value) that expression that
1019
+ uniquely identifies the element. Valid element designators are `list_item:`and `selected_item:`.
1012
1020
 
1013
1021
 
1014
1022
  ## Instantiating your PageObjects
1015
1023
 
1016
1024
  Before you can call the methods in your `PageObjects` and `PageSections`, you must instantiate the `PageObjects` of your web
1017
- application, as well as create instance variables which can be used when calling a `PageObject`'s methods from your step definitions.
1018
- There are several ways to instantiate your `PageObjects`.
1025
+ application, as well as create instance variables which can be used when calling a `PageObject`'s methods from your step
1026
+ definitions. There are several ways to instantiate your `PageObjects`.
1019
1027
 
1020
1028
  One common implementation is shown below:
1021
1029
 
@@ -1039,17 +1047,17 @@ One common implementation is shown below:
1039
1047
 
1040
1048
  World(WorldPages)
1041
1049
 
1042
- 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
1043
- `features/support` folder.
1050
+ The `WorldPages` module above can be defined in your `env.rb` file, or you can define it in a separate `world_pages.rb` file
1051
+ in the `features/support` folder.
1044
1052
 
1045
- While this approach is effective for small web applications with only a few pages (and hence few `PageObjects`), it quickly becomes
1046
- cumbersome to manage if your web application has dozens of `PageObjects` that need to be instantiated and managed.
1053
+ While this approach is effective for small web applications with only a few pages (and hence few `PageObjects`), it quickly
1054
+ becomes cumbersome to manage if your web application has dozens of `PageObjects` that need to be instantiated and managed.
1047
1055
 
1048
1056
  ### Using the PageManager
1049
1057
 
1050
- The `PageManager` class provides methods for supporting the instantiation and management of `PageObjects`. In the code example below,
1051
- the `page_objects` method contains a hash table of your `PageObject` instances and their associated `PageObject` classes to be
1052
- instantiated by `PageManager`:
1058
+ The `PageManager` class provides methods for supporting the instantiation and management of `PageObjects`. In the code example
1059
+ below, the `page_objects` method contains a hash table of your `PageObject` instances and their associated `PageObject` classes
1060
+ to be instantiated by `PageManager`:
1053
1061
 
1054
1062
  module WorldPages
1055
1063
  def page_objects
@@ -1079,8 +1087,8 @@ instantiated by `PageManager`:
1079
1087
 
1080
1088
  The `WorldPages` module above should be defined in the `world_pages.rb` file in the `features/support` folder.
1081
1089
 
1082
- Include the code below in your `env.rb` file to ensure that your `PageObjects` are instantiated before your Cucumber scenarios are
1083
- executed:
1090
+ Include the code below in your `env.rb` file to ensure that your `PageObjects` are instantiated before your Cucumber scenarios
1091
+ are executed:
1084
1092
 
1085
1093
  include WorldPages
1086
1094
  WorldPages.instantiate_page_objects
@@ -1090,8 +1098,8 @@ executed:
1090
1098
 
1091
1099
  ### Leveraging the PageManager in your Cucumber tests
1092
1100
 
1093
- Many Cucumber based automated tests suites include scenarios that verify that web pages are correctly loaded, displayed, or can be
1094
- navigated to by clicking associated links. One such Cucumber navigation scenario is displayed below:
1101
+ Many Cucumber based automated tests suites include scenarios that verify that web pages are correctly loaded, displayed, or
1102
+ can be navigated to by clicking associated links. One such Cucumber navigation scenario is displayed below:
1095
1103
 
1096
1104
  Scenario Outline: Verify Home page navigation links
1097
1105
  Given I am on the Home page
@@ -1107,8 +1115,8 @@ navigated to by clicking associated links. One such Cucumber navigation scenario
1107
1115
  |FAQs |
1108
1116
  |Contact Us |
1109
1117
 
1110
- In the above example, the step definitions associated with the 3 steps might be implemented using a `page_dispatcher` method using a
1111
- `case` statement to parse the `page` parameter as in the example below:
1118
+ In the above example, the step definitions associated with the 3 steps might be implemented using a `page_dispatcher` method
1119
+ using a `case` statement to parse the `page` parameter as in the example below:
1112
1120
 
1113
1121
  Given(/^I am on the (.*) page$/) do |page_name|
1114
1122
  target_page = page_dispatcher(page_name)
@@ -1147,14 +1155,15 @@ In the above example, the step definitions associated with the 3 steps might be
1147
1155
  end
1148
1156
 
1149
1157
 
1150
- While this approach may be effective for small web applications with only a few pages (and hence few `PageObjects`), it quickly becomes
1151
- cumbersome to manage if your web application has dozens of `PageObjects` that need to be managed.
1158
+ While this approach may be effective for small web applications with only a few pages (and hence few `PageObjects`), it quickly
1159
+ becomes cumbersome to manage if your web application has dozens of `PageObjects` that need to be managed.
1152
1160
 
1153
- The `PageManager` class provides a `find_page` method that replaces the cumbersome and difficult to maintain `case` statement used in the
1154
- above example. The `PageManager.current_page` method allows you to set or get an instance of the currently active Page Object.
1161
+ The `PageManager` class provides a `find_page` method that replaces the cumbersome and difficult to maintain `case` statement
1162
+ used in the above example. The `PageManager.current_page` method allows you to set or get an instance of the currently active
1163
+ Page Object.
1155
1164
 
1156
- To use these `PageManager` methods, include the step definitions and code below in a `page_steps.rb` or `generic_steps.rb` file in the
1157
- `features/step_definitions` folder:
1165
+ To use these `PageManager` methods, include the step definitions and code below in a `page_steps.rb` or `generic_steps.rb` file
1166
+ in the `features/step_definitions` folder:
1158
1167
 
1159
1168
  include TestCentricity
1160
1169
 
@@ -1183,18 +1192,19 @@ To use these `PageManager` methods, include the step definitions and code below
1183
1192
 
1184
1193
  ## Connecting to a Web Browser
1185
1194
 
1186
- The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures the appropriate Selenium-Webdriver capabilities required to
1187
- establish a connection with a target web browser, and sets the base host URL of the web site you are running your tests against.
1195
+ The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures the appropriate Selenium-Webdriver capabilities
1196
+ required to establish a connection with a target web browser, and sets the base host URL of the web site you are running your
1197
+ tests against.
1188
1198
 
1189
- The `TestCentricity::WebDriverConnect.initialize_web_driver` method accepts a single optional parameter - the base host URL. Cucumber
1190
- **Environment Variables** are used to specify the target local or remote web browser, and the various webdriver capability parameters required
1191
- to configure the connection.
1199
+ The `TestCentricity::WebDriverConnect.initialize_web_driver` method accepts a single optional parameter - the base host URL.
1200
+ Cucumber **Environment Variables** are used to specify the target local or remote web browser, and the various webdriver
1201
+ capability parameters required to configure the connection.
1192
1202
 
1193
1203
 
1194
1204
  ### Locally hosted desktop web browser
1195
1205
 
1196
- For locally hosted desktop web browsers running on macOS or Windows platforms, the `WEB_BROWSER` Environment Variable must be set to one of the
1197
- values from the table below:
1206
+ For locally hosted desktop web browsers running on macOS or Windows platforms, the `WEB_BROWSER` Environment Variable must
1207
+ be set to one of the values from the table below:
1198
1208
 
1199
1209
  | `WEB_BROWSER` | **Desktop Platform** |
1200
1210
  |--------------------|------------------------------------------------|
@@ -1212,7 +1222,8 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1212
1222
 
1213
1223
  #### Setting desktop browser window size
1214
1224
 
1215
- 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:
1225
+ To set the size of a desktop browser window, you set the `BROWSER_SIZE` Environment Variable to the desired width and height
1226
+ in pixels as shown below:
1216
1227
 
1217
1228
  BROWSER_SIZE=1600,1000
1218
1229
 
@@ -1223,8 +1234,9 @@ To maximize a desktop browser window, you set the `BROWSER_SIZE` Environment Var
1223
1234
 
1224
1235
  #### Testing file downloads with desktop browsers
1225
1236
 
1226
- File download functionality can be tested with locally hosted instances of Chrome, Edge, or Firefox desktop browsers. Your automation project must include
1227
- a `/downloads` folder at the same level as the `/config` and `/features` folders, as depicted below:
1237
+ File download functionality can be tested with locally hosted instances of Chrome, Edge, or Firefox desktop browsers. Your
1238
+ automation project must include a `/downloads` folder at the same level as the `/config` and `/features` folders, as depicted
1239
+ below:
1228
1240
 
1229
1241
  my_automation_project
1230
1242
  ├── config
@@ -1234,9 +1246,9 @@ a `/downloads` folder at the same level as the `/config` and `/features` folders
1234
1246
  └── README.md
1235
1247
 
1236
1248
 
1237
- When running tests in multiple concurrent threads using the `parallel_tests` gem, a new folder will be created within the `/downloads` folder for each
1238
- test thread. This is to ensure that files downloaded in each test thread are isolated from tests running in other parallel threads. An example of the
1239
- `/downloads` folder structure for 4 parallel threads is depicted below:
1249
+ When running tests in multiple concurrent threads using the `parallel_tests` gem, a new folder will be created within the
1250
+ `/downloads` folder for each test thread. This is to ensure that files downloaded in each test thread are isolated from tests
1251
+ running in other parallel threads. An example of the`/downloads` folder structure for 4 parallel threads is depicted below:
1240
1252
 
1241
1253
  my_automation_project
1242
1254
  ├── config
@@ -1250,10 +1262,10 @@ test thread. This is to ensure that files downloaded in each test thread are iso
1250
1262
  └── README.md
1251
1263
 
1252
1264
 
1253
- When testing file downloads using a local instance of Firefox, you will need to specify the MIME types of the various file types that your tests will
1254
- be downloading. This is accomplished by setting the `MIME_TYPES` Environment Variable to a comma-delimited string containing the list of MIME types to
1255
- be accepted. This list is required as it will prevent Firefox from displaying the File Download modal dialog, which will halt your automated tests. An
1256
- example of a list of MIME types is depicted below:
1265
+ When testing file downloads using a local instance of Firefox, you will need to specify the MIME types of the various file types
1266
+ that your tests will be downloading. This is accomplished by setting the `MIME_TYPES` Environment Variable to a comma-delimited
1267
+ string containing the list of MIME types to be accepted. This list is required as it will prevent Firefox from displaying the
1268
+ File Download modal dialog, which will halt your automated tests. An example of a list of MIME types is depicted below:
1257
1269
 
1258
1270
  MIME_TYPES='images/jpeg, application/pdf, application/octet-stream'
1259
1271
 
@@ -1262,10 +1274,11 @@ A detailed list of file MIME types can be found [here](https://www.freeformatter
1262
1274
 
1263
1275
  ### Locally hosted emulated mobile web browser
1264
1276
 
1265
- You can run your tests against mobile device browsers that are emulated within a locally hosted instance of a Chrome desktop browser on macOS or
1266
- Windows. The specified mobile browser's user agent, CSS screen dimensions, and default screen orientation will be automatically set within the
1267
- local Chrome browser instance. You may even specify the emulated device's screen orientation. For locally hosted emulated mobile web browsers,
1268
- the `WEB_BROWSER` Environment Variable must be set to one of the values from the table below:
1277
+ You can run your tests against mobile device browsers that are emulated within a locally hosted instance of a Chrome desktop
1278
+ browser on macOS or Windows. The specified mobile browser's user agent, CSS screen dimensions, and default screen orientation
1279
+ will be automatically set within the local Chrome browser instance. You may even specify the emulated device's screen orientation.
1280
+ For locally hosted emulated mobile web browsers, the `WEB_BROWSER` Environment Variable must be set to one of the values from
1281
+ the table below:
1269
1282
 
1270
1283
  | `WEB_BROWSER` | `HOST_BROWSER` | **CSS Screen Dimensions** | **Default Orientation** | **OS Version** |
1271
1284
  |-----------------------|----------------|---------------------------|-------------------------|-------------------------------------------|
@@ -1317,18 +1330,20 @@ the `WEB_BROWSER` Environment Variable must be set to one of the values from the
1317
1330
  | `blackberry_leap` | `chrome` | 360 x 640 | portrait | BlackBerry 10 OS |
1318
1331
  | `blackberry_passport` | `chrome` | 504 x 504 | square | BlackBerry 10 OS |
1319
1332
 
1320
- To change the emulated device's screen orientation from the default setting, set the `ORIENTATION` Environment Variable to either `portrait` or `landscape`.
1333
+ To change the emulated device's screen orientation from the default setting, set the `ORIENTATION` Environment Variable to
1334
+ either `portrait` or `landscape`.
1321
1335
 
1322
- 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
1323
- to `chrome`.
1336
+ To use a local instance of the Chrome desktop browser to host the emulated mobile web browser, you must set the `HOST_BROWSER`
1337
+ Environment Variable to `chrome`.
1324
1338
 
1325
1339
  Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below.
1326
1340
 
1327
1341
 
1328
1342
  #### User defined mobile device profiles
1329
1343
 
1330
- User defined mobile device profiles can be specified in a `device.yml` file for testing locally hosted emulated mobile web browsers running in an instance
1331
- of the Chrome desktop browser. The user specified device profiles must be located at `config/data/devices/devices.yml` as depicted below:
1344
+ User defined mobile device profiles can be specified in a `device.yml` file for testing locally hosted emulated mobile web
1345
+ browsers running in an instance of the Chrome desktop browser. The user specified device profiles must be located at
1346
+ `config/data/devices/devices.yml` as depicted below:
1332
1347
 
1333
1348
  my_automation_project
1334
1349
  ├── config
@@ -1357,7 +1372,8 @@ The format for a new device profile is:
1357
1372
 
1358
1373
  ### Selenium Grid 4 and Dockerized Selenium Grid 4 hosted desktop and emulated mobile web browsers
1359
1374
 
1360
- For remote desktop and emulated mobile web browsers running on Selenium Grid 4 or Dockerized Selenium Grid 4 environments as described in the table below.
1375
+ For remote desktop and emulated mobile web browsers running on Selenium Grid 4 or Dockerized Selenium Grid 4 environments
1376
+ as described in the table below.
1361
1377
 
1362
1378
  | **Environment Variable** | **Description** |
1363
1379
  |--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -1372,12 +1388,13 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1372
1388
 
1373
1389
  #### Mobile Safari browser on iOS Simulators or iOS Physical Devices
1374
1390
 
1375
- You can run your mobile web tests against the mobile Safari browser on simulated iOS devices or physically connected iOS devices using Appium and XCode on
1376
- macOS. You must install Appium, XCode, and the iOS version-specific device simulators for XCode. You must also ensure that the `appium_capybara` gem is
1377
- installed and required as described in **section 3.3 (Setup - Using Appium)** above.
1391
+ You can run your mobile web tests against the mobile Safari browser on simulated iOS devices or physically connected iOS devices
1392
+ using Appium and XCode on macOS. You must install Appium, XCode, and the iOS version-specific device simulators for XCode. You
1393
+ must also ensure that the `appium_capybara` gem is installed and required as described in **section 3.3 (Setup - Using Appium)** above.
1378
1394
 
1379
- Information about Appium setup and configuration requirements for testing on physically connected iOS devices can be found on [this page](https://github.com/appium/appium/blob/master/docs/en/drivers/ios-xcuitest-real-devices.md).
1380
- The Appium server must be running prior to invoking Cucumber to run your features/scenarios.
1395
+ Information about Appium setup and configuration requirements for testing on physically connected iOS devices can be found
1396
+ on [this page](https://github.com/appium/appium/blob/master/docs/en/drivers/ios-xcuitest-real-devices.md). The Appium server
1397
+ must be running prior to invoking Cucumber to run your features/scenarios.
1381
1398
 
1382
1399
  Once your test environment is properly configured, the following **Environment Variables** must be set as described in the table below.
1383
1400
 
@@ -1414,13 +1431,15 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1414
1431
 
1415
1432
  #### Mobile Chrome or Android browsers on Android Studio Virtual Device emulators
1416
1433
 
1417
- You can run your mobile web tests against the mobile Chrome or Android browser on emulated Android devices using Appium and Android Studio on macOS. You
1418
- must install Android Studio, the desired Android version-specific virtual device emulators, and Appium. Refer to [this page](http://appium.io/docs/en/drivers/android-uiautomator2/index.html)
1419
- for information on configuring Appium to work with the Android SDK. You must also ensure that the `appium_capybara` gem is installed and required as
1420
- described in **section 3.3 (Setup - Using Appium)** above.
1434
+ You can run your mobile web tests against the mobile Chrome or Android browser on emulated Android devices using Appium and
1435
+ Android Studio on macOS. You must install Android Studio, the desired Android version-specific virtual device emulators, and
1436
+ Appium. Refer to [this page](http://appium.io/docs/en/drivers/android-uiautomator2/index.html) for information on configuring
1437
+ Appium to work with the Android SDK. You must also ensure that the `appium_capybara` gem is installed and required as described
1438
+ in **section 3.3 (Setup - Using Appium)** above.
1421
1439
 
1422
1440
  The Appium server must be running prior to invoking Cucumber to run your features/scenarios. Refer to [this page](https://appium.io/docs/en/writing-running-appium/web/chromedriver/index.html)
1423
- for information on configuring Appium to use the correct version of Chromedriver required to work with the web browser supported by each Android OS version.
1441
+ for information on configuring Appium to use the correct version of Chromedriver required to work with the web browser supported
1442
+ by each Android OS version.
1424
1443
 
1425
1444
  Once your test environment is properly configured, the following **Environment Variables** must be set as described in the table below.
1426
1445
 
@@ -1447,8 +1466,8 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1447
1466
  #### Starting and stopping Appium Server
1448
1467
 
1449
1468
  The Appium server must be running prior to invoking Cucumber to run your features/scenarios on mobile simulators or physical
1450
- device. To programmatically control the starting and stopping of Appium server with the execution of your automated tests, place
1451
- the code shown below in your `hooks.rb` file.
1469
+ device. To programmatically control the starting and stopping of Appium server with the execution of your automated tests,
1470
+ place the code shown below in your `hooks.rb` file.
1452
1471
 
1453
1472
  BeforeAll do
1454
1473
  # start Appium Server if APPIUM_SERVER = 'run' and target browser is a mobile simulator or device
@@ -1468,9 +1487,9 @@ the code shown below in your `hooks.rb` file.
1468
1487
  end
1469
1488
 
1470
1489
 
1471
- The `APPIUM_SERVER` environment variable must be set to `run` in order to programmatically start and stop Appium server. This can be
1472
- set by adding the following to your `cucumber.yml` file and including `-p run_appium` in your command line when starting your Cucumber
1473
- test suite(s):
1490
+ The `APPIUM_SERVER` environment variable must be set to `run` in order to programmatically start and stop Appium server. This
1491
+ can be set by adding the following to your `cucumber.yml` file and including `-p run_appium` in your command line when starting
1492
+ your Cucumber test suite(s):
1474
1493
 
1475
1494
  run_appium: APPIUM_SERVER=run
1476
1495
 
@@ -1480,21 +1499,21 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1480
1499
 
1481
1500
  ### Remote cloud hosted desktop and mobile web browsers
1482
1501
 
1483
- You can run your automated tests against remote cloud hosted desktop and mobile web browsers using the BrowserStack, SauceLabs, TestingBot, or
1484
- LambdaTest services. If your tests are running against a web site hosted on your local computer (`localhost`), or on a staging server inside
1485
- your LAN, you must set the `TUNNELING` Environment Variable to `true`.
1502
+ You can run your automated tests against remote cloud hosted desktop and mobile web browsers using the BrowserStack, SauceLabs,
1503
+ TestingBot, or LambdaTest services. If your tests are running against a web site hosted on your local computer (`localhost`),
1504
+ or on a staging server inside your LAN, you must set the `TUNNELING` Environment Variable to `true`.
1486
1505
 
1487
- Due to lack of support for Selenium 4.x and the W3C browser capabilities protocol, support for CrossBrowserTesting and Gridlastic cloud hosted
1488
- Selenium grid services was removed as of version 4.1 of this gem. If your testing requires access to either of those services, or support for
1489
- Selenium version 3.x, you should use earlier versions of this gem.
1506
+ Due to lack of support for Selenium 4.x and the W3C browser capabilities protocol, support for CrossBrowserTesting and Gridlastic
1507
+ cloud hosted Selenium grid services was removed as of version 4.1 of this gem. If your testing requires access to either of those
1508
+ services, or support for Selenium version 3.x, you should use earlier versions of this gem.
1490
1509
 
1491
1510
  Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below.
1492
1511
 
1493
1512
 
1494
1513
  #### Remote desktop browsers on the BrowserStack service
1495
1514
 
1496
- For remotely hosted desktop web browsers on the BrowserStack service, the following **Environment Variables** must be set as described in
1497
- the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities?tag=selenium-4)
1515
+ For remotely hosted desktop web browsers on the BrowserStack service, the following **Environment Variables** must be set as
1516
+ described in the table below. Refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/automate/capabilities?tag=selenium-4)
1498
1517
  for information regarding the specific capabilities.
1499
1518
 
1500
1519
  | **Environment Variable** | **Description** |
@@ -1590,6 +1609,26 @@ regarding the specific capabilities.
1590
1609
  | `BROWSER_SIZE` | [Optional] Specify width, height of browser window |
1591
1610
 
1592
1611
 
1612
+ #### Remote mobile browsers on the TestingBot service
1613
+
1614
+ For remotely hosted mobile web browsers iOS simulators and Android emulators on the TestingBot service, the following Environment
1615
+ Variables must be set as described in the table below.
1616
+
1617
+ | **Environment Variable** | **Description** |
1618
+ |--------------------------|-------------------------------------------------------------------------------------------------|
1619
+ | `DRIVER` | Must be set to `testingbot` |
1620
+ | `TB_USERNAME` | Must be set to your TestingBot account user name |
1621
+ | `TB_AUTHKEY` | Must be set to your TestingBot account access key |
1622
+ | `TB_PLATFORM` | Must be set to `iOS` or `ANDROID` |
1623
+ | `TB_OS` | Must be set to `iOS` or `ANDROID` |
1624
+ | `TB_BROWSER` | Must be set to `safari` (for iOS) or `chrome` (for Android) |
1625
+ | `TB_VERSION` | Refer to `version` capability in chart |
1626
+ | `TB_DEVICE` | Refer to `deviceName` capability in chart |
1627
+ | `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
1628
+ | `TUNNELING` | [Optional] Must be `true` if you are testing against internal/local servers (`true` or `false`) |
1629
+ | `ORIENTATION` | [Optional] Set to `portrait` or `landscape` |
1630
+
1631
+
1593
1632
  #### Remote desktop browsers on the LambdaTest service
1594
1633
 
1595
1634
  For remotely hosted desktop web browsers on the LambdaTest service, the following **Environment Variables** must be set as described in the table
@@ -1614,14 +1653,15 @@ to obtain information regarding the specific capabilities.
1614
1653
 
1615
1654
  ### Using Browser specific Profiles in cucumber.yml
1616
1655
 
1617
- While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and managing
1618
- target web browsers is to create browser specific **Profiles** that set the appropriate **Environment Variables** for each target browser
1619
- in your `cucumber.yml` file.
1656
+ While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and
1657
+ managing target web browsers is to create browser specific **Profiles** that set the appropriate **Environment Variables** for
1658
+ each target browser in your `cucumber.yml` file.
1620
1659
 
1621
- Below is a list of Cucumber **Profiles** for supported locally and remotely hosted desktop and mobile web browsers (put these in in your
1622
- `cucumber.yml` file). Before you can use the BrowserStack, SauceLabs, TestingBot or LambdaTest services, you will need to replace the
1623
- *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization code for the cloud service(s)
1624
- that you intend to connect with.
1660
+ Below is a list of Cucumber **Profiles** for supported locally and remotely hosted desktop and mobile web browsers (put these
1661
+ in in your`cucumber.yml` file). Before you can use the BrowserStack, SauceLabs, TestingBot or LambdaTest services, you will
1662
+ need to replace the*INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization
1663
+ code for the cloud service(s) that you intend to connect with. However, cloud service credentials should not be stored as text
1664
+ in your `cucumber.yml` file where it can be exposed by anyone with access to your version control system
1625
1665
 
1626
1666
 
1627
1667
  <% desktop = "--tags @desktop --require features BROWSER_TILE=true BROWSER_SIZE=1500,1000" %>
@@ -1850,27 +1890,27 @@ that you intend to connect with.
1850
1890
  lt_i0_win11: --profile lt_win10 LT_BROWSER="Internet Explorer" LT_VERSION="11.0"
1851
1891
 
1852
1892
 
1853
- 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
1854
- invoking Cucumber in the command line. For instance, the following command invokes Cucumber and specifies that a local instance of Firefox
1855
- will be used as the target web browser:
1893
+ To specify a locally hosted target browser using a profile at runtime, you use the flag `--profile` or `-p` followed by the
1894
+ profile name when invoking Cucumber in the command line. For instance, the following command invokes Cucumber and specifies
1895
+ that a local instance of Firefox will be used as the target web browser:
1856
1896
 
1857
1897
  cucumber -p firefox
1858
1898
 
1859
1899
 
1860
- The following command specifies that Cucumber will run tests against an instance of Chrome hosted within a Dockerized Selenium Grid 4
1861
- environment:
1900
+ The following command specifies that Cucumber will run tests against an instance of Chrome hosted within a Dockerized Selenium
1901
+ Grid 4 environment:
1862
1902
 
1863
1903
  cucumber -p chrome -p grid
1864
1904
 
1865
1905
 
1866
- The following command specifies that Cucumber will run tests against a local instance of Chrome, which will be used to emulate an iPad Pro
1867
- in landscape orientation:
1906
+ The following command specifies that Cucumber will run tests against a local instance of Chrome, which will be used to emulate
1907
+ an iPad Pro in landscape orientation:
1868
1908
 
1869
1909
  cucumber -p ipad_pro -p landscape
1870
1910
 
1871
1911
 
1872
- The following command specifies that Cucumber will run tests against an iPad Pro (12.9-inch) (5th generation) with iOS version 15.4 in an
1873
- XCode Simulator in landscape orientation:
1912
+ The following command specifies that Cucumber will run tests against an iPad Pro (12.9-inch) (5th generation) with iOS version
1913
+ 15.4 in an XCode Simulator in landscape orientation:
1874
1914
 
1875
1915
  cucumber -p ipad_pro_12_15_sim -p landscape
1876
1916
 
@@ -1881,8 +1921,8 @@ You can ensure that Appium Server is running by including `-p run_appium` in you
1881
1921
  cucumber -p ipad_pro_12_15_sim -p landscape -p run_appium
1882
1922
 
1883
1923
 
1884
- The following command specifies that Cucumber will run tests against a remotely hosted Safari web browser running on a macOS Monterey
1885
- virtual machine on the BrowserStack service:
1924
+ The following command specifies that Cucumber will run tests against a remotely hosted Safari web browser running on a macOS
1925
+ Monterey virtual machine on the BrowserStack service:
1886
1926
 
1887
1927
  cucumber -p bs_safari_monterey
1888
1928
 
@@ -1924,27 +1964,20 @@ area sub-folders as needed. Likewise, `PageSection` class definitions should be
1924
1964
  TestCentricity™ Framework is Copyright (c) 2014-2022, Tony Mrozinski.
1925
1965
  All rights reserved.
1926
1966
 
1927
- Redistribution and use in source and binary forms, with or without
1928
- modification, are permitted provided that the following conditions are met:
1929
-
1930
- 1. Redistributions of source code must retain the above copyright notice,
1931
- this list of conditions and the following disclaimer.
1932
-
1933
- 2. Redistributions in binary form must reproduce the above copyright
1934
- notice, this list of conditions and the following disclaimer in the
1935
- documentation and/or other materials provided with the distribution.
1936
-
1937
- 3. Neither the name of the copyright holder nor the names of its contributors
1938
- may be used to endorse or promote products derived from this software without
1939
- specific prior written permission.
1940
-
1941
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1942
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1943
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1944
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
1945
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1946
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
1947
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
1948
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1949
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1950
- POSSIBILITY OF SUCH DAMAGE.
1967
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
1968
+ conditions are met:
1969
+
1970
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
1971
+
1972
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
1973
+ in the documentation and/or other materials provided with the distribution.
1974
+
1975
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived
1976
+ from this software without specific prior written permission.
1977
+
1978
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
1979
+ BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
1980
+ SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1981
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1982
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1983
+ OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -396,7 +396,6 @@ module TestCentricity
396
396
  @screen_shots = []
397
397
  end
398
398
 
399
- # :nocov:
400
399
  def self.report_header
401
400
  report_header = "\n<b><u>TEST ENVIRONMENT</u>:</b> #{ENV['TEST_ENVIRONMENT']}\n"\
402
401
  " <b>Browser:</b>\t #{Environ.browser.capitalize}\n"
@@ -412,6 +411,5 @@ module TestCentricity
412
411
  report_header = "#{report_header} <b>WCAG Accessibility Standard:</b>\t #{ENV['ACCESSIBILITY_STANDARD']}\n" if ENV['ACCESSIBILITY_STANDARD']
413
412
  "#{report_header}\n\n"
414
413
  end
415
- # :nocov:
416
414
  end
417
415
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '4.3.0'
2
+ VERSION = '4.3.1'
3
3
  end
@@ -34,14 +34,12 @@ module TestCentricity
34
34
  # set downloads folder path
35
35
  @downloads_path = "#{Dir.pwd}/downloads"
36
36
  if ENV['PARALLEL']
37
- # :nocov:
38
37
  Environ.parallel = true
39
38
  Environ.process_num = ENV['TEST_ENV_NUMBER']
40
39
  if Dir.exist?(@downloads_path)
41
40
  @downloads_path = "#{@downloads_path}/#{ENV['TEST_ENV_NUMBER']}"
42
41
  Dir.mkdir(@downloads_path) unless Dir.exist?(@downloads_path)
43
42
  end
44
- # :nocov:
45
43
  else
46
44
  Environ.parallel = false
47
45
  end
@@ -57,27 +55,28 @@ module TestCentricity
57
55
  when :appium
58
56
  initialize_appium
59
57
  'Appium'
60
- # :nocov:
58
+ when :webdriver
59
+ if ENV['SELENIUM'] == 'remote'
60
+ initialize_remote
61
+ 'Selenium Grid'
62
+ else
63
+ initialize_local_browser
64
+ 'local browser instance'
65
+ end
61
66
  when :browserstack
62
67
  initialize_browserstack
63
68
  'Browserstack cloud service'
69
+ when :testingbot
70
+ initialize_testingbot
71
+ 'TestingBot cloud service'
72
+ # :nocov:
64
73
  when :lambdatest
65
74
  initialize_lambdatest
66
75
  'LambdaTest cloud service'
67
76
  when :saucelabs
68
77
  initialize_saucelabs
69
78
  'Sauce Labs cloud service'
70
- when :testingbot
71
- initialize_testingbot
72
- 'TestingBot cloud service'
73
- when :webdriver
74
- if ENV['SELENIUM'] == 'remote'
75
- initialize_remote
76
- 'Selenium Grid'
77
- else
78
- initialize_local_browser
79
- 'local browser instance'
80
- end
79
+ # :nocov:
81
80
  end
82
81
 
83
82
  # set browser window size only if testing with a desktop web browser
@@ -227,12 +226,14 @@ module TestCentricity
227
226
  Environ.os = case
228
227
  when OS.osx?
229
228
  'OS X'
229
+ # :nocov:
230
230
  when OS.windows?
231
231
  'Windows'
232
232
  when OS.linux?
233
233
  'Linux'
234
234
  else
235
235
  'unknown'
236
+ # :nocov:
236
237
  end
237
238
  browser = Environ.browser.downcase.to_sym
238
239
 
@@ -282,10 +283,12 @@ module TestCentricity
282
283
  @endpoint = ENV['REMOTE_ENDPOINT'] || 'http://127.0.0.1:4444/wd/hub' if @endpoint.nil?
283
284
 
284
285
  case browser
286
+ # :nocov:
285
287
  when :safari
286
288
  options = Selenium::WebDriver::Safari::Options.new
287
289
  when :ie
288
290
  options = Selenium::WebDriver::IE::Options.new
291
+ # :nocov:
289
292
  when :firefox, :firefox_headless
290
293
  options = firefox_options(browser)
291
294
  when :chrome, :chrome_headless, :edge, :edge_headless
@@ -320,11 +323,10 @@ module TestCentricity
320
323
  Capybara.default_driver = :remote_browser
321
324
  end
322
325
 
323
- # :nocov:
324
326
  def self.initialize_browserstack
325
327
  browser = ENV['BS_BROWSER']
326
328
  Environ.grid = :browserstack
327
-
329
+ Environ.os = "#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}"
328
330
  if ENV['BS_REAL_MOBILE'] || ENV['BS_DEVICE']
329
331
  Environ.platform = :mobile
330
332
  Environ.device_name = ENV['BS_DEVICE']
@@ -335,11 +337,10 @@ module TestCentricity
335
337
  else
336
338
  :simulator
337
339
  end
338
- elsif ENV['BS_OS']
339
- Environ.os = "#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}"
340
340
  end
341
341
  # specify endpoint url
342
342
  @endpoint = "http://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@hub-cloud.browserstack.com/wd/hub" if @endpoint.nil?
343
+ # :nocov:
343
344
  # enable tunneling if specified
344
345
  if ENV['TUNNELING']
345
346
  @bs_local = BrowserStack::Local.new
@@ -351,6 +352,7 @@ module TestCentricity
351
352
  puts 'BrowserStack Local instance failed to start'
352
353
  end
353
354
  end
355
+ # :nocov:
354
356
  # define BrowserStack options
355
357
  options = if @capabilities.nil?
356
358
  browser_options = {}
@@ -416,6 +418,61 @@ module TestCentricity
416
418
  Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
417
419
  end
418
420
 
421
+ def self.initialize_testingbot
422
+ browser = ENV['TB_BROWSER']
423
+ Environ.grid = :testingbot
424
+
425
+ Environ.os = ENV['TB_OS']
426
+ if ENV['TB_PLATFORM']
427
+ Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
428
+ Environ.device_os = ENV['TB_PLATFORM']
429
+ Environ.device_name = ENV['TB_DEVICE']
430
+ Environ.device = :device
431
+ Environ.platform = :mobile
432
+ Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
433
+ else
434
+ Environ.platform = :desktop
435
+ end
436
+ # specify endpoint url
437
+ if @endpoint.nil?
438
+ url = ENV['TUNNELING'] ? '@localhost:4445/wd/hub' : '@hub.testingbot.com/wd/hub'
439
+ @endpoint = "http://#{ENV['TB_USERNAME']}:#{ENV['TB_AUTHKEY']}#{url}"
440
+ end
441
+ # define TestingBot options
442
+ options = if @capabilities.nil?
443
+ # define the required set of TestingBot options
444
+ tb_options = { build: test_context_message }
445
+ # define the optional TestingBot options
446
+ tb_options[:name] = ENV['AUTOMATE_PROJECT'] if ENV['AUTOMATE_PROJECT']
447
+ tb_options['timeZone'] = ENV['TIME_ZONE'] if ENV['TIME_ZONE']
448
+ tb_options['testingbot.geoCountryCode'] = ENV['GEO_LOCATION'] if ENV['GEO_LOCATION']
449
+ tb_options[:screenrecorder] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
450
+ tb_options[:screenshot] = ENV['SCREENSHOTS'] if ENV['SCREENSHOTS']
451
+ # define mobile device options
452
+ if ENV['TB_PLATFORM']
453
+ tb_options[:platform] = ENV['TB_PLATFORM']
454
+ tb_options[:orientation] = ENV['ORIENTATION'].upcase if ENV['ORIENTATION']
455
+ tb_options[:deviceName] = ENV['TB_DEVICE'] if ENV['TB_DEVICE']
456
+ else
457
+ # define desktop browser options
458
+ tb_options['screen-resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
459
+ tb_options['selenium-version'] = '4.3.0'
460
+ end
461
+ {
462
+ browserName: browser,
463
+ browserVersion: ENV['TB_VERSION'],
464
+ platformName: ENV['TB_OS'],
465
+ 'tb:options': tb_options
466
+ }
467
+ else
468
+ @capabilities
469
+ end
470
+ register_remote_driver(:testingbot, browser, options)
471
+ # configure file_detector for remote uploads if target is desktop web browser
472
+ config_file_uploads unless ENV['TB_PLATFORM']
473
+ end
474
+
475
+ # :nocov:
419
476
  def self.initialize_lambdatest
420
477
  browser = ENV['LT_BROWSER']
421
478
  Environ.grid = :lambdatest
@@ -522,60 +579,6 @@ module TestCentricity
522
579
  # configure file_detector for remote uploads
523
580
  config_file_uploads
524
581
  end
525
-
526
- def self.initialize_testingbot
527
- browser = ENV['TB_BROWSER']
528
- Environ.grid = :testingbot
529
-
530
- Environ.os = ENV['TB_OS']
531
- if ENV['TB_PLATFORM']
532
- Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
533
- Environ.device_os = ENV['TB_PLATFORM']
534
- Environ.device_name = ENV['TB_DEVICE']
535
- Environ.device = :device
536
- Environ.platform = :mobile
537
- Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
538
- else
539
- Environ.platform = :desktop
540
- end
541
- # specify endpoint url
542
- if @endpoint.nil?
543
- url = ENV['TUNNELING'] ? '@localhost:4445/wd/hub' : '@hub.testingbot.com/wd/hub'
544
- @endpoint = "http://#{ENV['TB_USERNAME']}:#{ENV['TB_AUTHKEY']}#{url}"
545
- end
546
- # define TestingBot options
547
- options = if @capabilities.nil?
548
- # define the required set of TestingBot options
549
- tb_options = { build: test_context_message }
550
- # define the optional TestingBot options
551
- tb_options[:name] = ENV['AUTOMATE_PROJECT'] if ENV['AUTOMATE_PROJECT']
552
- tb_options[:timeZone] = ENV['TIME_ZONE'] if ENV['TIME_ZONE']
553
- tb_options['testingbot.geoCountryCode'] = ENV['GEO_LOCATION'] if ENV['GEO_LOCATION']
554
- tb_options[:screenrecorder] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
555
- tb_options[:screenshot] = ENV['SCREENSHOTS'] if ENV['SCREENSHOTS']
556
- # define mobile device options
557
- if ENV['TB_PLATFORM']
558
- tb_options[:platform] = ENV['TB_PLATFORM']
559
- tb_options[:orientation] = ENV['ORIENTATION'].upcase if ENV['ORIENTATION']
560
- tb_options[:deviceName] = ENV['TB_DEVICE'] if ENV['TB_DEVICE']
561
- else
562
- # define desktop browser options
563
- tb_options['screen-resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
564
- tb_options['selenium-version'] = '4.1.0'
565
- end
566
- {
567
- browserName: browser,
568
- browserVersion: ENV['TB_VERSION'],
569
- platformName: ENV['TB_OS'],
570
- 'tb:options': tb_options
571
- }
572
- else
573
- @capabilities
574
- end
575
- register_remote_driver(:testingbot, browser, options)
576
- # configure file_detector for remote uploads if target is desktop web browser
577
- config_file_uploads unless ENV['TB_PLATFORM']
578
- end
579
582
  # :nocov:
580
583
 
581
584
  def self.chrome_edge_options(browser)
@@ -622,7 +625,6 @@ module TestCentricity
622
625
  options
623
626
  end
624
627
 
625
- # :nocov:
626
628
  def self.test_context_message
627
629
  context_message = if ENV['TEST_CONTEXT']
628
630
  "#{Environ.test_environment.to_s.upcase} - #{ENV['TEST_CONTEXT']}"
@@ -660,6 +662,5 @@ module TestCentricity
660
662
  str if File.exist?(str)
661
663
  end
662
664
  end
663
- # :nocov:
664
665
  end
665
666
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.1
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: 2022-08-02 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appium_capybara