testcentricity_web 4.5.3 → 4.5.4
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +141 -142
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d652328a11ab7fbe472b45ddf6a1cd1076d84e1d79b2c94df4ebf96e4298aab9
|
4
|
+
data.tar.gz: 90090a047692e7cbd9f8f9ca2f7a024dbe9d96731f317de3a41486e2380fd4d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d707e97a372e12396c12186ade43db6ca754dc939462cc0304ec05d6c7706f6bba388e711834f95c23ee9ca008d911ca8f5514a57948de7178cab4b4da5e68f3
|
7
|
+
data.tar.gz: 1ae3f3f4b196ccd58cd5089027d745a61d2378c50f4f91d3d0badc1322d257524ef2f44568c0680e51719273e9ce1ef41071a7188972948115940086c67dba0b
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [4.5.4] - 04-MAR-2024
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
* Updated `selenium-webdriver` gem to version 4.18.1.
|
10
|
+
* Updated `rack` gem to version 3.0.9.1.
|
11
|
+
* Updated `nokogiri` gem to version 1.16.2.
|
12
|
+
|
13
|
+
|
5
14
|
## [4.5.3] - 27-JAN-2024
|
6
15
|
|
7
16
|
### Changed
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
The TestCentricity™ Web core framework for desktop and mobile web browser-based app testing implements a Page Object Model
|
11
|
-
DSL for use with Cucumber (version 7.x or greater) or RSpec, and Selenium-Webdriver (version 4.
|
11
|
+
DSL for use with Cucumber (version 7.x or greater) or RSpec, and Selenium-Webdriver (version 4.18). It also facilitates the
|
12
12
|
configuration of the appropriate Selenium-Webdriver capabilities required to establish connections with one or more local
|
13
13
|
or cloud hosted desktop or mobile web browsers.
|
14
14
|
|
@@ -71,18 +71,18 @@ Or install it yourself using:
|
|
71
71
|
### Using Cucumber
|
72
72
|
|
73
73
|
If you are using Cucumber, you need to require the following in your `env.rb` file:
|
74
|
-
|
74
|
+
```ruby
|
75
75
|
require 'capybara/cucumber'
|
76
76
|
require 'testcentricity_web'
|
77
|
-
|
77
|
+
```
|
78
78
|
|
79
79
|
### Using RSpec
|
80
80
|
|
81
81
|
If you are using RSpec instead, you need to require the following in your `spec_helper.rb` file:
|
82
|
-
|
82
|
+
```ruby
|
83
83
|
require 'capybara/rspec'
|
84
84
|
require 'testcentricity_web'
|
85
|
-
|
85
|
+
```
|
86
86
|
|
87
87
|
---
|
88
88
|
## PageObjects
|
@@ -104,7 +104,7 @@ files, scenarios, or step definitions.
|
|
104
104
|
|
105
105
|
Your `PageObject` class definitions should be contained within individual `.rb` files in the `features/support/pages` folder
|
106
106
|
of your test automation project. You define new `PageObjects` as shown below:
|
107
|
-
|
107
|
+
```ruby
|
108
108
|
class LoginPage < TestCentricity::PageObject
|
109
109
|
end
|
110
110
|
|
@@ -119,7 +119,7 @@ of your test automation project. You define new `PageObjects` as shown below:
|
|
119
119
|
|
120
120
|
class UserAccountPage < TestCentricity::PageObject
|
121
121
|
end
|
122
|
-
|
122
|
+
```
|
123
123
|
|
124
124
|
### Adding Traits to a PageObject
|
125
125
|
|
@@ -145,7 +145,7 @@ relative URL slug that will be appended to the base URL specified in `app_host`.
|
|
145
145
|
as not all web pages can be directly loaded via a URL.
|
146
146
|
|
147
147
|
You define your page's **Traits** as shown below:
|
148
|
-
|
148
|
+
```ruby
|
149
149
|
class LoginPage < TestCentricity::PageObject
|
150
150
|
trait(:page_name) { 'Login' }
|
151
151
|
trait(:page_url) { '/sign_in' }
|
@@ -173,13 +173,13 @@ You define your page's **Traits** as shown below:
|
|
173
173
|
trait(:page_url) { "/user_account/#{User.current.id}" }
|
174
174
|
trait(:page_locator) { 'body.useraccount' }
|
175
175
|
end
|
176
|
-
|
176
|
+
```
|
177
177
|
|
178
178
|
### Adding UI Elements to a PageObject
|
179
179
|
|
180
180
|
Web pages are made up of UI elements like text fields, check boxes, combo boxes, radio buttons, tables, lists, buttons, etc.
|
181
181
|
**UI Elements** are added to your `PageObject` class definition as shown below:
|
182
|
-
|
182
|
+
```ruby
|
183
183
|
class LoginPage < TestCentricity::PageObject
|
184
184
|
trait(:page_name) { 'Login' }
|
185
185
|
trait(:page_url) { '/sign_in' }
|
@@ -215,14 +215,14 @@ Web pages are made up of UI elements like text fields, check boxes, combo boxes,
|
|
215
215
|
checkbox :email_opt_in_check, 'input#marketingEmailsOptIn'
|
216
216
|
button :sign_up_button, 'button#registrationSignUp'
|
217
217
|
end
|
218
|
-
|
218
|
+
```
|
219
219
|
|
220
220
|
### Adding Methods to a PageObject
|
221
221
|
|
222
222
|
It is good practice for your Cucumber step definitions to call high level methods in your your `PageObject` instead of
|
223
223
|
directly accessing and interacting with a page object's UI elements. You can add high level methods to your `PageObject`
|
224
224
|
class definition for interacting with the UI to hide implementation details, as shown below:
|
225
|
-
|
225
|
+
```ruby
|
226
226
|
class LoginPage < TestCentricity::PageObject
|
227
227
|
trait(:page_name) { 'Login' }
|
228
228
|
trait(:page_url) { '/sign_in' }
|
@@ -326,14 +326,14 @@ class definition for interacting with the UI to hide implementation details, as
|
|
326
326
|
sign_up_button.click
|
327
327
|
end
|
328
328
|
end
|
329
|
-
|
329
|
+
```
|
330
330
|
|
331
331
|
|
332
332
|
Once your `PageObjects` have been instantiated, you can call your methods as shown below:
|
333
|
-
|
333
|
+
```ruby
|
334
334
|
login_page.remember_me(true)
|
335
335
|
login_page.login(user_id = 'snicklefritz', password = 'Pa55w0rd')
|
336
|
-
|
336
|
+
```
|
337
337
|
|
338
338
|
---
|
339
339
|
## PageSections
|
@@ -362,10 +362,10 @@ A `PageSection` may contain other `PageSection` objects.
|
|
362
362
|
|
363
363
|
Your `PageSection` class definitions should be contained within individual `.rb` files in the `features/support/sections`
|
364
364
|
folder of your test automation project. You define new `PageSection` as shown below:
|
365
|
-
|
365
|
+
```ruby
|
366
366
|
class BagViewPopup < TestCentricity::PageSection
|
367
367
|
end
|
368
|
-
|
368
|
+
```
|
369
369
|
|
370
370
|
### Adding Traits to a PageSection
|
371
371
|
|
@@ -373,18 +373,18 @@ A `PageSection` typically has a root node object that encapsulates a collection
|
|
373
373
|
specifies the CSS or Xpath expression that uniquely identifies that root node object.
|
374
374
|
|
375
375
|
You define your section's **Traits** as shown below:
|
376
|
-
|
376
|
+
```ruby
|
377
377
|
class BagViewPopup < TestCentricity::PageSection
|
378
378
|
trait(:section_locator) { 'aside.ac-gn-bagview' }
|
379
379
|
trait(:section_name) { 'Shopping Bag Popup' }
|
380
380
|
end
|
381
|
-
|
381
|
+
```
|
382
382
|
|
383
383
|
### Adding UI Elements to a PageSection
|
384
384
|
|
385
385
|
`PageSections` are typically made up of UI elements like text fields, check boxes, combo boxes, radio buttons, tables, lists,
|
386
386
|
buttons, etc. **UI Elements** are added to your `PageSection` class definition as shown below:
|
387
|
-
|
387
|
+
```ruby
|
388
388
|
class BagViewPopup < TestCentricity::PageSection
|
389
389
|
trait(:section_locator) { 'aside.ac-gn-bagview' }
|
390
390
|
trait(:section_name) { 'Shopping Bag Popup' }
|
@@ -395,12 +395,12 @@ buttons, etc. **UI Elements** are added to your `PageSection` class definition a
|
|
395
395
|
bag_nav_list: 'ul.ac-gn-bagview-nav-list '
|
396
396
|
button :checkout_button, 'a[class*="ac-gn-bagview-button-checkout"]'
|
397
397
|
end
|
398
|
-
|
398
|
+
```
|
399
399
|
|
400
400
|
### Adding Methods to a PageSection
|
401
401
|
|
402
402
|
You can add high level methods to your `PageSection` class definition, as shown below:
|
403
|
-
|
403
|
+
```ruby
|
404
404
|
class BagViewPopup < TestCentricity::PageSection
|
405
405
|
trait(:section_locator) { 'aside.ac-gn-bagview' }
|
406
406
|
trait(:section_name) { 'Shopping Bag Popup' }
|
@@ -434,12 +434,12 @@ You can add high level methods to your `PageSection` class definition, as shown
|
|
434
434
|
end
|
435
435
|
end
|
436
436
|
end
|
437
|
-
|
437
|
+
```
|
438
438
|
|
439
439
|
### Adding PageSections to your PageObject
|
440
440
|
|
441
441
|
You add a `PageSection` to its associated `PageObject` as shown below:
|
442
|
-
|
442
|
+
```ruby
|
443
443
|
class HomePage < TestCentricity::PageObject
|
444
444
|
trait(:page_name) { 'Home' }
|
445
445
|
trait(:page_url) { '/dashboard' }
|
@@ -448,11 +448,11 @@ You add a `PageSection` to its associated `PageObject` as shown below:
|
|
448
448
|
# Home page Section Objects
|
449
449
|
section :search_form, SearchForm
|
450
450
|
end
|
451
|
-
|
451
|
+
```
|
452
452
|
Once your `PageObject` has been instantiated, you can call its `PageSection` methods as shown below:
|
453
|
-
|
453
|
+
```ruby
|
454
454
|
home_page.search_form.search_for('ocarina')
|
455
|
-
|
455
|
+
```
|
456
456
|
|
457
457
|
---
|
458
458
|
## UIElements
|
@@ -480,7 +480,7 @@ containing the names and locators of each individual element.
|
|
480
480
|
Supported `UIElement` elementTypes and their declarations have the following format:
|
481
481
|
|
482
482
|
*Single element declarations:*
|
483
|
-
|
483
|
+
```ruby
|
484
484
|
class SamplePage < TestCentricity::PageObject
|
485
485
|
|
486
486
|
button :button_name, locator
|
@@ -499,9 +499,9 @@ Supported `UIElement` elementTypes and their declarations have the following for
|
|
499
499
|
filefield :filefield_name, locator
|
500
500
|
|
501
501
|
end
|
502
|
-
|
502
|
+
```
|
503
503
|
*Multiple element declarations:*
|
504
|
-
|
504
|
+
```ruby
|
505
505
|
class SamplePage < TestCentricity::PageObject
|
506
506
|
|
507
507
|
buttons button_1_name: locator,
|
@@ -537,12 +537,11 @@ Supported `UIElement` elementTypes and their declarations have the following for
|
|
537
537
|
filefield_X_name: locator
|
538
538
|
|
539
539
|
end
|
540
|
-
|
540
|
+
```
|
541
541
|
|
542
542
|
Refer to the Class List documentation for the `PageObject` and `PageSection` classes for details on the class methods used
|
543
|
-
for declaring and instantiating `UIElements`. Examples of UI element declarations can be found in the
|
544
|
-
to your
|
545
|
-
***Adding UI Elements to your PageSection*** sections above.
|
543
|
+
for declaring and instantiating `UIElements`. Examples of UI element declarations can be found in the [**section 4.3 (Adding UI Elements to your PageObject)**](#adding-ui-elements-to-a-pageobject)
|
544
|
+
and [**section 5.3 (Adding UI Elements to your PageSection)**](#adding-ui-elements-to-a-pagesection) sections above.
|
546
545
|
|
547
546
|
|
548
547
|
### UIElement Inherited Methods
|
@@ -654,7 +653,7 @@ for data entry (the `UIElement` must be visible and enabled) before entering the
|
|
654
653
|
in situations where entering data, or setting the state of a `UIElement` might cause other `UIElements` to become visible
|
655
654
|
or active. Specifying a wait_time value ensures that the subsequent `UIElements` will be ready to be interacted with as
|
656
655
|
states are changed. If the wait time is `nil`, then the wait time will be 5 seconds.
|
657
|
-
|
656
|
+
```ruby
|
658
657
|
def enter_data(user_data)
|
659
658
|
fields = {
|
660
659
|
first_name_field => user_data.first_name,
|
@@ -667,7 +666,7 @@ states are changed. If the wait time is `nil`, then the wait time will be 5 seco
|
|
667
666
|
}
|
668
667
|
populate_data_fields(fields, wait_time = 2)
|
669
668
|
end
|
670
|
-
|
669
|
+
```
|
671
670
|
|
672
671
|
### Verifying UIElements on a PageObject or PageSection
|
673
672
|
|
@@ -679,14 +678,14 @@ to be verified, the code required to verify the presence of `UIElements` and the
|
|
679
678
|
The `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods support the verification of multiple properties
|
680
679
|
of multiple UI elements on a `PageObject` or `PageSection`. The `verify_ui_states` method accepts a hash containing key/hash
|
681
680
|
pairs of UI elements and their properties or attributes to be verified.
|
682
|
-
|
681
|
+
```ruby
|
683
682
|
ui = {
|
684
683
|
object1 => { property: state },
|
685
684
|
object2 => { property: state, property: state },
|
686
685
|
object3 => { property: state }
|
687
686
|
}
|
688
687
|
verify_ui_states(ui)
|
689
|
-
|
688
|
+
```
|
690
689
|
The `verify_ui_states` method queues up any exceptions that occur while verifying each object's properties until all `UIElements`
|
691
690
|
and their properties have been checked, and then posts any exceptions encountered upon completion. Posted exceptions include
|
692
691
|
a screenshot with a red dashed highlight around the UI element that did not match the expected results.
|
@@ -854,9 +853,9 @@ The `verify_ui_states` method supports the following ARIA accessibility property
|
|
854
853
|
#### Comparison States
|
855
854
|
|
856
855
|
The `verify_ui_states` method supports comparison states using property/comparison state pairs:
|
857
|
-
|
856
|
+
```ruby
|
858
857
|
object => { property: { comparison_state: value } }
|
859
|
-
|
858
|
+
```
|
860
859
|
Comparison States:
|
861
860
|
|
862
861
|
:lt or :less_than Integer or String
|
@@ -871,7 +870,7 @@ Comparison States:
|
|
871
870
|
|
872
871
|
The example below depicts a `verify_changes_saved` method that uses the `verify_ui_states` method to verify that all expected
|
873
872
|
values appear in the associated text fields after entering data and performing a save operation.
|
874
|
-
|
873
|
+
```ruby
|
875
874
|
def verify_changes_saved
|
876
875
|
# verify saved user data is correctly displayed
|
877
876
|
ui = {
|
@@ -920,14 +919,14 @@ values appear in the associated text fields after entering data and performing a
|
|
920
919
|
# verify avatar src url does not contain /null/ institution id
|
921
920
|
verify_ui_states(avatar_image => { src: { does_not_contain: "/null/" } })
|
922
921
|
end
|
923
|
-
|
922
|
+
```
|
924
923
|
|
925
924
|
#### I18n Translation Validation
|
926
925
|
|
927
926
|
The `verify_ui_states` method also supports I18n string translations using property/I18n key name pairs:
|
928
|
-
|
927
|
+
```ruby
|
929
928
|
object => { property: { translate_key: 'name of key in I18n compatible .yml file' } }
|
930
|
-
|
929
|
+
```
|
931
930
|
**I18n Translation Keys:**
|
932
931
|
|
933
932
|
:translate String
|
@@ -940,7 +939,7 @@ The example below depicts the usage of the `verify_ui_states` method to verify t
|
|
940
939
|
panel are correctly translated.
|
941
940
|
|
942
941
|

|
943
|
-
|
942
|
+
```ruby
|
944
943
|
class BagViewPopup < TestCentricity::PageSection
|
945
944
|
trait(:section_locator) { 'aside.ac-gn-bagview' }
|
946
945
|
trait(:section_name) { 'Shopping Bag Popup' }
|
@@ -975,12 +974,12 @@ panel are correctly translated.
|
|
975
974
|
verify_ui_states(ui)
|
976
975
|
end
|
977
976
|
end
|
978
|
-
|
977
|
+
```
|
979
978
|
I18n `.yml` files contain key/value pairs representing the name of a translated string (key) and the string value. For the
|
980
979
|
popup Shopping Bag panel example above, the translated strings for English, Spanish, and French are represented in below:
|
981
980
|
|
982
981
|
**English** - `en.yml`
|
983
|
-
|
982
|
+
```yaml
|
984
983
|
en:
|
985
984
|
BagViewPopup:
|
986
985
|
bag_is_empty: 'Your Bag is empty.'
|
@@ -990,9 +989,9 @@ popup Shopping Bag panel example above, the translated strings for English, Span
|
|
990
989
|
account: 'Account'
|
991
990
|
sign_in: 'Sign in'
|
992
991
|
sign_out: 'Sign out'
|
993
|
-
|
992
|
+
```
|
994
993
|
**Spanish** - `es.yml`
|
995
|
-
|
994
|
+
```yaml
|
996
995
|
es:
|
997
996
|
BagViewPopup:
|
998
997
|
bag_is_empty: 'Tu bolsa está vacía.'
|
@@ -1002,9 +1001,9 @@ popup Shopping Bag panel example above, the translated strings for English, Span
|
|
1002
1001
|
account: 'Cuenta'
|
1003
1002
|
sign_in: 'Iniciar sesión'
|
1004
1003
|
sign_out: 'Cerrar sesión'
|
1005
|
-
|
1004
|
+
```
|
1006
1005
|
**French** - `fr.yml`
|
1007
|
-
|
1006
|
+
```yaml
|
1008
1007
|
fr:
|
1009
1008
|
BagViewPopup:
|
1010
1009
|
bag_is_empty: 'Votre sac est vide.'
|
@@ -1014,7 +1013,7 @@ popup Shopping Bag panel example above, the translated strings for English, Span
|
|
1014
1013
|
account: 'Compte'
|
1015
1014
|
sign_in: 'Ouvrir une session'
|
1016
1015
|
sign_out: 'Fermer la session'
|
1017
|
-
|
1016
|
+
```
|
1018
1017
|
|
1019
1018
|
Each supported language/locale combination has a corresponding `.yml` file. I18n `.yml` file naming convention uses
|
1020
1019
|
[ISO-639 language codes](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html#wp1252447) and
|
@@ -1084,7 +1083,7 @@ the `radio` or `checkbox` elements are instantiated.
|
|
1084
1083
|
|
1085
1084
|
The code snippet below demonstrates the use of the `Radio.define_custom_elements` and `CheckBox.define_custom_elements`
|
1086
1085
|
methods to define the multiple UI elements that comprise each radio button and checkbox.
|
1087
|
-
|
1086
|
+
```ruby
|
1088
1087
|
class FlightBookingPage < TestCentricity::PageObject
|
1089
1088
|
trait(:page_name) { 'Flight Booking Home' }
|
1090
1089
|
trait(:page_locator) { 'div[class*="bookerContainer"]' }
|
@@ -1119,7 +1118,7 @@ methods to define the multiple UI elements that comprise each radio button and c
|
|
1119
1118
|
near_to_check.define_custom_elements(check_spec)
|
1120
1119
|
end
|
1121
1120
|
end
|
1122
|
-
|
1121
|
+
```
|
1123
1122
|
#### List UIElements
|
1124
1123
|
|
1125
1124
|
The basic HTML `list` element is typically composed of the parent `ul` or `ol` object, and one or more `li` elements
|
@@ -1138,7 +1137,7 @@ that uniquely identifies the element. Valid element designators are `:list_item`
|
|
1138
1137
|
|
1139
1138
|
The `RestaurantPage` page object's `initialize` method in the code snippet below demonstrates the use of the `List.define_list_elements`
|
1140
1139
|
method to define the common components that make up the **Menu Groups** horizontal scrolling list.
|
1141
|
-
|
1140
|
+
```ruby
|
1142
1141
|
class RestaurantPage < TestCentricity::PageObject
|
1143
1142
|
trait(:page_name) { 'Restaurant Detail' }
|
1144
1143
|
trait(:page_locator) { 'div.restaurant-menus-container' }
|
@@ -1153,7 +1152,7 @@ method to define the common components that make up the **Menu Groups** horizont
|
|
1153
1152
|
menu_groups_list.define_list_elements(list_spec)
|
1154
1153
|
end
|
1155
1154
|
end
|
1156
|
-
|
1155
|
+
```
|
1157
1156
|
|
1158
1157
|
#### SelectList UIElements
|
1159
1158
|
|
@@ -1181,7 +1180,7 @@ components of a `selectlist` control. The method accepts a hash of element desig
|
|
1181
1180
|
|
1182
1181
|
The `CustomControlsPage` page object's `initialize` method in the code snippet below demonstrates the use of the
|
1183
1182
|
`SelectList.define_list_elements` method to define the common components that make up the **Teams** drop-down style selector.
|
1184
|
-
|
1183
|
+
```ruby
|
1185
1184
|
class CustomControlsPage < TestCentricity::PageObject
|
1186
1185
|
trait(:page_name) { 'Custom Controls' }
|
1187
1186
|
trait(:page_locator) { 'div.custom-controls-page-body' }
|
@@ -1205,7 +1204,7 @@ The `CustomControlsPage` page object's `initialize` method in the code snippet b
|
|
1205
1204
|
team_select.define_list_elements(list_spec)
|
1206
1205
|
end
|
1207
1206
|
end
|
1208
|
-
|
1207
|
+
```
|
1209
1208
|
|
1210
1209
|
#### Table UIElements
|
1211
1210
|
|
@@ -1226,7 +1225,7 @@ that uniquely identifies the element. Valid element designators are `:table_head
|
|
1226
1225
|
|
1227
1226
|
The `CustomControlsPage` page object's `initialize` method in the code snippet below demonstrates the use of the
|
1228
1227
|
`Table.define_table_elements` method to define the components that make up the responsive `table`.
|
1229
|
-
|
1228
|
+
```ruby
|
1230
1229
|
class CustomControlsPage < TestCentricity::PageObject
|
1231
1230
|
trait(:page_name) { 'Custom Controls' }
|
1232
1231
|
trait(:page_locator) { 'div.custom-controls-page-body' }
|
@@ -1248,7 +1247,7 @@ The `CustomControlsPage` page object's `initialize` method in the code snippet b
|
|
1248
1247
|
custom_table.define_table_elements(table_spec)
|
1249
1248
|
end
|
1250
1249
|
end
|
1251
|
-
|
1250
|
+
```
|
1252
1251
|
|
1253
1252
|
---
|
1254
1253
|
## Instantiating Your PageObjects
|
@@ -1258,7 +1257,7 @@ web application, as well as create instance variables which can be used when cal
|
|
1258
1257
|
step definitions. There are several ways to instantiate your `PageObjects`.
|
1259
1258
|
|
1260
1259
|
One common implementation is shown below:
|
1261
|
-
|
1260
|
+
```ruby
|
1262
1261
|
module WorldPages
|
1263
1262
|
def login_page
|
1264
1263
|
@login_page ||= LoginPage.new
|
@@ -1278,7 +1277,7 @@ One common implementation is shown below:
|
|
1278
1277
|
end
|
1279
1278
|
|
1280
1279
|
World(WorldPages)
|
1281
|
-
|
1280
|
+
```
|
1282
1281
|
The `WorldPages` module above can be defined in your `env.rb` file, or you can define it in a separate `world_pages.rb`
|
1283
1282
|
file in the `features/support` folder.
|
1284
1283
|
|
@@ -1290,7 +1289,7 @@ becomes cumbersome to manage if your web application has dozens of `PageObjects`
|
|
1290
1289
|
The `PageManager` class provides methods for supporting the instantiation and management of `PageObjects`. In the code
|
1291
1290
|
example below, the `page_objects` method contains a hash table of your `PageObject` instances and their associated
|
1292
1291
|
`PageObject` classes to be instantiated by `PageManager`:
|
1293
|
-
|
1292
|
+
```ruby
|
1294
1293
|
module WorldPages
|
1295
1294
|
def page_objects
|
1296
1295
|
{
|
@@ -1315,16 +1314,16 @@ example below, the `page_objects` method contains a hash table of your `PageObje
|
|
1315
1314
|
end
|
1316
1315
|
|
1317
1316
|
World(WorldPages)
|
1318
|
-
|
1317
|
+
```
|
1319
1318
|
|
1320
1319
|
The `WorldPages` module above should be defined in the `world_pages.rb` file in the `features/support` folder.
|
1321
1320
|
|
1322
1321
|
Include the code below in your `env.rb` file to ensure that your `PageObjects` are instantiated before your Cucumber
|
1323
1322
|
scenarios are executed:
|
1324
|
-
|
1323
|
+
```ruby
|
1325
1324
|
include WorldPages
|
1326
1325
|
WorldPages.instantiate_page_objects
|
1327
|
-
|
1326
|
+
```
|
1328
1327
|
**NOTE:** If you intend to use the `PageManager`, you must define a `page_name` trait for each of the `PageObjects` to
|
1329
1328
|
be registered.
|
1330
1329
|
|
@@ -1333,7 +1332,7 @@ be registered.
|
|
1333
1332
|
|
1334
1333
|
Many Cucumber based automated tests suites include scenarios that verify that web pages are correctly loaded, displayed,
|
1335
1334
|
or can be navigated to by clicking associated links. One such Cucumber navigation scenario is displayed below:
|
1336
|
-
|
1335
|
+
```gherkin
|
1337
1336
|
Scenario Outline: Verify Home page navigation links
|
1338
1337
|
Given I am on the Home page
|
1339
1338
|
When I click the <page name> navigation link
|
@@ -1347,10 +1346,10 @@ or can be navigated to by clicking associated links. One such Cucumber navigatio
|
|
1347
1346
|
|Privacy Policy |
|
1348
1347
|
|FAQs |
|
1349
1348
|
|Contact Us |
|
1350
|
-
|
1349
|
+
```
|
1351
1350
|
In the above example, the step definitions associated with the 3 steps might be implemented using a `page_dispatcher`
|
1352
1351
|
method using a `case` statement to parse the `page` parameter as in the example below:
|
1353
|
-
|
1352
|
+
```ruby
|
1354
1353
|
Given(/^I am on the (.*) page$/) do |page_name|
|
1355
1354
|
target_page = page_dispatcher(page_name)
|
1356
1355
|
target_page.load_page
|
@@ -1386,7 +1385,7 @@ method using a `case` statement to parse the `page` parameter as in the example
|
|
1386
1385
|
raise "No page object defined for page named '#{page_name}'" unless page
|
1387
1386
|
page
|
1388
1387
|
end
|
1389
|
-
|
1388
|
+
````
|
1390
1389
|
|
1391
1390
|
While this approach may be effective for small web applications with only a few pages (and hence few `PageObjects`), it
|
1392
1391
|
quickly becomes cumbersome to manage if your web application has dozens of `PageObjects` that need to be managed.
|
@@ -1397,7 +1396,7 @@ currently active Page Object.
|
|
1397
1396
|
|
1398
1397
|
To use these `PageManager` methods, include the step definitions and code below in a `page_steps.rb` or `generic_steps.rb`
|
1399
1398
|
file in the `features/step_definitions` folder:
|
1400
|
-
|
1399
|
+
```ruby
|
1401
1400
|
include TestCentricity
|
1402
1401
|
|
1403
1402
|
Given(/^I am on the (.*) page$/) do |page_name|
|
@@ -1420,7 +1419,7 @@ file in the `features/step_definitions` folder:
|
|
1420
1419
|
target_page.verify_page_exists
|
1421
1420
|
target_page.verify_page_ui
|
1422
1421
|
end
|
1423
|
-
|
1422
|
+
```
|
1424
1423
|
|
1425
1424
|
---
|
1426
1425
|
## Connecting to Web Browsers
|
@@ -1460,13 +1459,13 @@ capability parameters required to establish a connection with a single target we
|
|
1460
1459
|
For those test scenarios requiring the instantiation of multiple WebDriver objects, or where cumbersome **Environment
|
1461
1460
|
Variables** are less than ideal, call the `TestCentricity::WebDriverConnect.initialize_web_driver` method with an `options`
|
1462
1461
|
hash that specifies the WebDriver desired capabilities and the driver type, as depicted in the example below:
|
1463
|
-
|
1462
|
+
```ruby
|
1464
1463
|
options = {
|
1465
1464
|
capabilities: { browserName: :firefox },
|
1466
1465
|
driver: :webdriver
|
1467
1466
|
}
|
1468
1467
|
WebDriverConnect.initialize_web_driver(options)
|
1469
|
-
|
1468
|
+
```
|
1470
1469
|
Additional options that can be specified in an `options` hash include the following:
|
1471
1470
|
|
1472
1471
|
| Option | Purpose |
|
@@ -1523,23 +1522,23 @@ browser, which is determined by the mobile device's screen size.
|
|
1523
1522
|
|
1524
1523
|
To set the size of a desktop browser window in the `options` hash, you specify a `:browser_size` with the desired width and
|
1525
1524
|
height in pixels as shown below:
|
1526
|
-
|
1525
|
+
```ruby
|
1527
1526
|
options = {
|
1528
1527
|
browser_size: [1100, 900],
|
1529
1528
|
capabilities: { browserName: :edge },
|
1530
1529
|
driver: :webdriver
|
1531
1530
|
}
|
1532
1531
|
WebDriverConnect.initialize_web_driver(options)
|
1533
|
-
|
1532
|
+
```
|
1534
1533
|
To maximize a desktop browser window, you specify a `:browser_size` of 'max' as shown below:
|
1535
|
-
|
1534
|
+
```ruby
|
1536
1535
|
options = {
|
1537
1536
|
browser_size: 'max',
|
1538
1537
|
capabilities: { browserName: :chrome },
|
1539
1538
|
driver: :webdriver
|
1540
1539
|
}
|
1541
1540
|
WebDriverConnect.initialize_web_driver(options)
|
1542
|
-
|
1541
|
+
```
|
1543
1542
|
If a `:browser_size` is not specified, then the default size of a desktop browser window will be set to the size specified
|
1544
1543
|
in the `BROWSER_SIZE` Environment Variable (if it has been specified) or to a default width and height of 1650 by 1000 pixels.
|
1545
1544
|
|
@@ -1595,7 +1594,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
1595
1594
|
- `driver:` must be set to `:webdriver`
|
1596
1595
|
- `browserName:` in the `capabilities:` hash must be set to one of the values from the table above
|
1597
1596
|
|
1598
|
-
```
|
1597
|
+
```ruby
|
1599
1598
|
options = {
|
1600
1599
|
capabilities: { browserName: value_from_table_above },
|
1601
1600
|
driver: :webdriver
|
@@ -1607,7 +1606,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
1607
1606
|
|
1608
1607
|
Below is an example of an `options` hash for specifying a connection to a locally hosted Firefox desktop web browser. The
|
1609
1608
|
`options` hash includes options for specifying the driver name and setting the browser window size.
|
1610
|
-
|
1609
|
+
```ruby
|
1611
1610
|
options = {
|
1612
1611
|
driver: :webdriver,
|
1613
1612
|
driver_name: :customer_context,
|
@@ -1615,7 +1614,7 @@ Below is an example of an `options` hash for specifying a connection to a locall
|
|
1615
1614
|
capabilities: { browserName: :firefox }
|
1616
1615
|
}
|
1617
1616
|
WebDriverConnect.initialize_web_driver(options)
|
1618
|
-
|
1617
|
+
```
|
1619
1618
|
|
1620
1619
|
#### Testing File Downloads With Desktop Browsers
|
1621
1620
|
|
@@ -1653,7 +1652,7 @@ types that your tests will be downloading. This is accomplished by setting the `
|
|
1653
1652
|
comma-delimited string containing the list of MIME types to be accepted. The `MIME_TYPES` Environment Variable should be
|
1654
1653
|
set before initializing the Firefox web driver. This list of file types is required as it will prevent Firefox from displaying
|
1655
1654
|
the File Download modal dialog, which will halt your automated tests. An example of a list of MIME types is depicted below:
|
1656
|
-
|
1655
|
+
```ruby
|
1657
1656
|
# set list of all supported MIME types for testing file downloads with Firefox
|
1658
1657
|
mime_types = [
|
1659
1658
|
'application/pdf',
|
@@ -1664,7 +1663,7 @@ the File Download modal dialog, which will halt your automated tests. An example
|
|
1664
1663
|
'text/plain'
|
1665
1664
|
]
|
1666
1665
|
ENV['MIME_TYPES'] = mime_types.join(',')
|
1667
|
-
|
1666
|
+
```
|
1668
1667
|
|
1669
1668
|
A detailed list of file MIME types can be found [here](https://www.freeformatter.com/mime-types-list.html).
|
1670
1669
|
|
@@ -1743,7 +1742,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
1743
1742
|
- `driver:` must be set to `:webdriver`
|
1744
1743
|
- `browserName:` in the `capabilities:` hash must be set to one of the values from the table above
|
1745
1744
|
|
1746
|
-
```
|
1745
|
+
```ruby
|
1747
1746
|
options = {
|
1748
1747
|
capabilities: { browserName: value_from_table_above },
|
1749
1748
|
driver: :webdriver
|
@@ -1752,7 +1751,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
1752
1751
|
```
|
1753
1752
|
To change the emulated device's screen orientation from the default setting, set the optional `orientation:` to either
|
1754
1753
|
`:portrait` or `:landscape` in the `capabilities:` hash as shown in the example below:
|
1755
|
-
|
1754
|
+
```ruby
|
1756
1755
|
options = {
|
1757
1756
|
capabilities: {
|
1758
1757
|
browserName: :ipad_pro_12_9,
|
@@ -1761,14 +1760,14 @@ To change the emulated device's screen orientation from the default setting, set
|
|
1761
1760
|
driver: :webdriver
|
1762
1761
|
}
|
1763
1762
|
WebDriverConnect.initialize_web_driver(options)
|
1764
|
-
|
1763
|
+
```
|
1765
1764
|
> ℹ️ If an optional user defined `driver_name:` is not specified in the `options` hash, the default driver name will be set to
|
1766
1765
|
`:local_<browserName>` - e.g. `:local_ipad_pro_12_9` or `:local_pixel_6`.
|
1767
1766
|
|
1768
1767
|
Below is an example of an `options` hash for specifying a connection to a locally hosted emulated mobile Safari web browser
|
1769
1768
|
running on an iPhone. The`options` hash includes options for specifying the driver name and setting the browser orientation
|
1770
1769
|
to landscape mode.
|
1771
|
-
|
1770
|
+
```ruby
|
1772
1771
|
options = {
|
1773
1772
|
driver: :webdriver,
|
1774
1773
|
driver_name: :user1,
|
@@ -1778,7 +1777,7 @@ to landscape mode.
|
|
1778
1777
|
}
|
1779
1778
|
}
|
1780
1779
|
WebDriverConnect.initialize_web_driver(options)
|
1781
|
-
|
1780
|
+
```
|
1782
1781
|
|
1783
1782
|
#### User Defined Emulated Mobile Browser Profiles
|
1784
1783
|
|
@@ -1800,7 +1799,7 @@ at `config/data/devices/devices.yml` as depicted below:
|
|
1800
1799
|
└── 📄 README.md
|
1801
1800
|
|
1802
1801
|
The format for a new mobile browser profile is:
|
1803
|
-
```
|
1802
|
+
```yaml
|
1804
1803
|
:my_device_profile:
|
1805
1804
|
:name: "My New Device Name"
|
1806
1805
|
:os: (ios, android, kindle, or blackberry)
|
@@ -1851,7 +1850,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
1851
1850
|
- `driver:` must be set to `:grid`
|
1852
1851
|
- `browserName:` in the `capabilities:` hash must be set to one of the values from the table above
|
1853
1852
|
|
1854
|
-
```
|
1853
|
+
```ruby
|
1855
1854
|
options = {
|
1856
1855
|
capabilities: { browserName: value_from_table_above },
|
1857
1856
|
driver: :grid,
|
@@ -1867,7 +1866,7 @@ will be used.
|
|
1867
1866
|
|
1868
1867
|
Below is an example of an `options` hash for specifying a connection to a grid hosted Chrome desktop web browser. The
|
1869
1868
|
`options` hash includes options for specifying the driver name and setting the browser window size.
|
1870
|
-
|
1869
|
+
```ruby
|
1871
1870
|
options = {
|
1872
1871
|
driver: :grid,
|
1873
1872
|
driver_name: :admin_user,
|
@@ -1875,7 +1874,7 @@ Below is an example of an `options` hash for specifying a connection to a grid h
|
|
1875
1874
|
capabilities: { browserName: :chrome }
|
1876
1875
|
}
|
1877
1876
|
WebDriverConnect.initialize_web_driver(options)
|
1878
|
-
|
1877
|
+
```
|
1879
1878
|
|
1880
1879
|
### Locally Hosted Mobile Browsers on Simulators or Physical Devices
|
1881
1880
|
|
@@ -1938,7 +1937,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
1938
1937
|
- `'appium:platformVersion':` must be set to the version of iOS on the simulator or physical device
|
1939
1938
|
- `'appium:deviceName':` must be set to the name of the iOS simulator or physical device
|
1940
1939
|
|
1941
|
-
```
|
1940
|
+
```ruby
|
1942
1941
|
options = {
|
1943
1942
|
driver: :appium,
|
1944
1943
|
device_type: phone_or_tablet,
|
@@ -1962,7 +1961,7 @@ will be used.
|
|
1962
1961
|
Below is an example of an `options` hash for specifying a connection to a locally hosted mobile Safari web browser running
|
1963
1962
|
on an iPad simulator. The `options` hash includes options for specifying the driver name and setting the simulated device
|
1964
1963
|
orientation to portrait mode.
|
1965
|
-
|
1964
|
+
```ruby
|
1966
1965
|
options = {
|
1967
1966
|
driver: :appium,
|
1968
1967
|
device_type: :tablet,
|
@@ -1977,7 +1976,7 @@ orientation to portrait mode.
|
|
1977
1976
|
}
|
1978
1977
|
}
|
1979
1978
|
WebDriverConnect.initialize_web_driver(options)
|
1980
|
-
|
1979
|
+
```
|
1981
1980
|
|
1982
1981
|
#### Mobile Chrome or Android Browsers on Android Studio Virtual Device Emulators
|
1983
1982
|
|
@@ -2024,7 +2023,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2024
2023
|
- `'appium:platformVersion':` must be set to the version of Android on the simulator or physical device
|
2025
2024
|
- `'appium:deviceName':` must be set to the Android Virtual Device ID
|
2026
2025
|
|
2027
|
-
```
|
2026
|
+
```ruby
|
2028
2027
|
options = {
|
2029
2028
|
driver: :appium,
|
2030
2029
|
device_type: phone_or_tablet,
|
@@ -2049,7 +2048,7 @@ will be used.
|
|
2049
2048
|
Below is an example of an `options` hash for specifying a connection to a locally hosted mobile Chrome web browser running
|
2050
2049
|
on an Android phone simulator. The `options` hash includes options for specifying the driver name, setting the simulated
|
2051
2050
|
device orientation to landscape mode, and specifying the path to the ChromeDriver executable.
|
2052
|
-
|
2051
|
+
```ruby
|
2053
2052
|
options = {
|
2054
2053
|
driver: :appium,
|
2055
2054
|
device_type: :phone,
|
@@ -2066,7 +2065,7 @@ device orientation to landscape mode, and specifying the path to the ChromeDrive
|
|
2066
2065
|
}
|
2067
2066
|
}
|
2068
2067
|
WebDriverConnect.initialize_web_driver(options)
|
2069
|
-
|
2068
|
+
```
|
2070
2069
|
|
2071
2070
|
#### Starting and Stopping Appium Server
|
2072
2071
|
|
@@ -2075,7 +2074,7 @@ device orientation to landscape mode, and specifying the path to the ChromeDrive
|
|
2075
2074
|
The Appium server must be running prior to invoking Cucumber to run your features/scenarios on locally hosted mobile simulators
|
2076
2075
|
or physical devices. To programmatically control the starting and stopping of Appium server with the execution of your automated
|
2077
2076
|
tests, place the code shown below in your `hooks.rb` file.
|
2078
|
-
|
2077
|
+
```ruby
|
2079
2078
|
BeforeAll do
|
2080
2079
|
# start Appium Server if APPIUM_SERVER = 'run' and target browser is a mobile simulator or device
|
2081
2080
|
if ENV['APPIUM_SERVER'] == 'run' && Environ.driver == :appium
|
@@ -2090,7 +2089,7 @@ tests, place the code shown below in your `hooks.rb` file.
|
|
2090
2089
|
# terminate Appium Server if APPIUM_SERVER = 'run' and target browser is a mobile simulator or device
|
2091
2090
|
$server.stop if ENV['APPIUM_SERVER'] == 'run' && Environ.driver == :appium && $server.running?
|
2092
2091
|
end
|
2093
|
-
|
2092
|
+
```
|
2094
2093
|
The `APPIUM_SERVER` environment variable must be set to `run` in order to programmatically start and stop the Appium server.
|
2095
2094
|
This can be set by adding the following to your `cucumber.yml` file and including `-p run_appium` in your command line when
|
2096
2095
|
starting your Cucumber test suite(s):
|
@@ -2105,7 +2104,7 @@ Refer to [**section 8.9 (Using Browser Specific Profiles in `cucumber.yml`)**](#
|
|
2105
2104
|
The Appium server must be running prior to executing test specs on locally hosted mobile simulators or physical device. To
|
2106
2105
|
control the starting and stopping of the Appium server with the execution of your specs, place the code shown below in the
|
2107
2106
|
body of an example group:
|
2108
|
-
|
2107
|
+
```ruby
|
2109
2108
|
before(:context) do
|
2110
2109
|
# start Appium server before all of the examples in this group
|
2111
2110
|
$server = TestCentricity::AppiumServer.new
|
@@ -2116,7 +2115,7 @@ body of an example group:
|
|
2116
2115
|
# terminate Appium Server after all of the examples in this group
|
2117
2116
|
$server.stop if Environ.driver == :appium && $server.running?
|
2118
2117
|
end
|
2119
|
-
|
2118
|
+
```
|
2120
2119
|
|
2121
2120
|
### Remote Cloud Hosted Desktop and Mobile Web Browsers
|
2122
2121
|
|
@@ -2127,12 +2126,12 @@ or on a staging server inside your LAN, you must set the `TUNNELING` Environment
|
|
2127
2126
|
If the BrowserStack Local instance is running (`TUNNELING` Environment Variable is `true`), call the`TestCentricity::WebDriverConnect.close_tunnel`
|
2128
2127
|
method upon completion of your test suite to stop the Local instance. Place the code shown below in your `env.rb` or
|
2129
2128
|
`hooks.rb` file:
|
2130
|
-
|
2129
|
+
```ruby
|
2131
2130
|
# code to stop BrowserStack Local instance after end of test (if tunneling is enabled)
|
2132
2131
|
at_exit do
|
2133
2132
|
TestCentricity::WebDriverConnect.close_tunnel if Environ.tunneling
|
2134
2133
|
end
|
2135
|
-
|
2134
|
+
```
|
2136
2135
|
#### Remote Desktop Browsers on the BrowserStack Service
|
2137
2136
|
|
2138
2137
|
For remotely hosted desktop web browsers on the BrowserStack service, refer to the [Browserstack-specific capabilities chart page](https://www.browserstack.com/docs/automate/capabilities)
|
@@ -2171,7 +2170,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2171
2170
|
- `browserName:` in the `capabilities:` hash must be set to name from capability in chart
|
2172
2171
|
- `browserVersion:` in the `capabilities:` hash must be set to browser version from capability in chart
|
2173
2172
|
|
2174
|
-
```
|
2173
|
+
```ruby
|
2175
2174
|
options = {
|
2176
2175
|
driver: :browserstack,
|
2177
2176
|
capabilities: {
|
@@ -2201,7 +2200,7 @@ Below is an example of an `options` hash for specifying a connection to the late
|
|
2201
2200
|
running on macOS Sonoma hosted on BrowserStack. The `options` hash includes options for specifying the driver name, setting
|
2202
2201
|
the browser window size, and capabilities for setting screen resolution, geoLocation, time zone, Selenium version, and various
|
2203
2202
|
test configuration options.
|
2204
|
-
|
2203
|
+
```ruby
|
2205
2204
|
options = {
|
2206
2205
|
driver: :browserstack,
|
2207
2206
|
driver_name: :admin_user,
|
@@ -2213,7 +2212,7 @@ test configuration options.
|
|
2213
2212
|
userName: ENV['BS_USERNAME'],
|
2214
2213
|
accessKey: ENV['BS_AUTHKEY'],
|
2215
2214
|
projectName: 'ALP AP',
|
2216
|
-
buildName: "Test Build {ENV['BUILD_NUM']}",
|
2215
|
+
buildName: "Test Build #{ENV['BUILD_NUM']}",
|
2217
2216
|
sessionName: 'AU Regression Suite',
|
2218
2217
|
os: 'OS X',
|
2219
2218
|
osVersion: 'Sonoma',
|
@@ -2227,7 +2226,7 @@ test configuration options.
|
|
2227
2226
|
}
|
2228
2227
|
}
|
2229
2228
|
WebDriverConnect.initialize_web_driver(options)
|
2230
|
-
|
2229
|
+
```
|
2231
2230
|
|
2232
2231
|
#### Remote Mobile Browsers on the BrowserStack Service
|
2233
2232
|
|
@@ -2268,7 +2267,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2268
2267
|
- `device_type:` must be set to `:tablet` or `:phone`
|
2269
2268
|
- `browserName:` in the `capabilities:` hash must be set to name from capability in chart
|
2270
2269
|
|
2271
|
-
```
|
2270
|
+
```ruby
|
2272
2271
|
options = {
|
2273
2272
|
driver: :browserstack,
|
2274
2273
|
device_type: phone_or_tablet,
|
@@ -2297,7 +2296,7 @@ the `BS_AUTHKEY` Environment Variable is set to your BrowserStack access key.
|
|
2297
2296
|
Below is an example of an `options` hash for specifying a connection to a mobile Samsung web browser running on an Android
|
2298
2297
|
tablet hosted on BrowserStack. The `options` hash includes options for specifying the driver name, and capabilities for setting
|
2299
2298
|
geoLocation, time zone, Appium version, and various test configuration options.
|
2300
|
-
|
2299
|
+
```ruby
|
2301
2300
|
options = {
|
2302
2301
|
driver: :browserstack,
|
2303
2302
|
driver_name: :admin_tablet,
|
@@ -2308,7 +2307,7 @@ geoLocation, time zone, Appium version, and various test configuration options.
|
|
2308
2307
|
userName: ENV['BS_USERNAME'],
|
2309
2308
|
accessKey: ENV['BS_AUTHKEY'],
|
2310
2309
|
projectName: 'ALP AP',
|
2311
|
-
buildName: "Test Build {ENV['BUILD_NUM']}",
|
2310
|
+
buildName: "Test Build #{ENV['BUILD_NUM']}",
|
2312
2311
|
sessionName: 'AU Regression Suite',
|
2313
2312
|
os: 'android',
|
2314
2313
|
osVersion: '13.0',
|
@@ -2324,7 +2323,7 @@ geoLocation, time zone, Appium version, and various test configuration options.
|
|
2324
2323
|
}
|
2325
2324
|
}
|
2326
2325
|
WebDriverConnect.initialize_web_driver(options)
|
2327
|
-
|
2326
|
+
```
|
2328
2327
|
|
2329
2328
|
#### Remote Desktop Browsers on the Sauce Labs Service
|
2330
2329
|
|
@@ -2358,7 +2357,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2358
2357
|
- `browserName:` in the `capabilities:` hash must be set to name from capability in chart
|
2359
2358
|
- `browser_version:` in the `capabilities:` hash must be set to browser version from capability in chart
|
2360
2359
|
|
2361
|
-
```
|
2360
|
+
```ruby
|
2362
2361
|
options = {
|
2363
2362
|
driver: :saucelabs,
|
2364
2363
|
capabilities: {
|
@@ -2387,7 +2386,7 @@ set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-
|
|
2387
2386
|
Below is an example of an `options` hash for specifying a connection to the latest version of an Edge desktop web browser
|
2388
2387
|
running on macOS Ventura hosted on Sauce Labs. The `options` hash includes options for specifying the driver name, setting
|
2389
2388
|
the browser window size, and capabilities for setting screen resolution, time zone, and various test configuration options.
|
2390
|
-
|
2389
|
+
```ruby
|
2391
2390
|
options = {
|
2392
2391
|
driver: :saucelabs,
|
2393
2392
|
driver_name: :admin_user,
|
@@ -2400,7 +2399,7 @@ the browser window size, and capabilities for setting screen resolution, time zo
|
|
2400
2399
|
username: ENV['SL_USERNAME'],
|
2401
2400
|
access_key: ENV['SL_AUTHKEY'],
|
2402
2401
|
name: 'ALP AP',
|
2403
|
-
build: "Test Build {ENV['BUILD_NUM']}",
|
2402
|
+
build: "Test Build #{ENV['BUILD_NUM']}",
|
2404
2403
|
screenResolution: '2048x1536',
|
2405
2404
|
timeZone: 'Perth',
|
2406
2405
|
maxDuration: 2400,
|
@@ -2409,7 +2408,7 @@ the browser window size, and capabilities for setting screen resolution, time zo
|
|
2409
2408
|
}
|
2410
2409
|
}
|
2411
2410
|
WebDriverConnect.initialize_web_driver(options)
|
2412
|
-
|
2411
|
+
```
|
2413
2412
|
|
2414
2413
|
#### Remote Mobile Browsers on the Sauce Labs Service
|
2415
2414
|
|
@@ -2448,7 +2447,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2448
2447
|
- `'appium:platformVersion':` must be set to `platformVersion` from capability in chart
|
2449
2448
|
- `'appium:deviceName':` must be set to `deviceName` from capability in chart
|
2450
2449
|
|
2451
|
-
```
|
2450
|
+
```ruby
|
2452
2451
|
options = {
|
2453
2452
|
driver: :saucelabs,
|
2454
2453
|
device_type: phone_or_tablet,
|
@@ -2480,7 +2479,7 @@ set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-
|
|
2480
2479
|
Below is an example of an `options` hash for specifying a connection to a mobile Safari web browser running on an iPad
|
2481
2480
|
tablet hosted on Sauce Labs. The `options` hash includes options for specifying the driver name, and capabilities for setting
|
2482
2481
|
device orientation, Appium version, and various test configuration options.
|
2483
|
-
|
2482
|
+
```ruby
|
2484
2483
|
options = {
|
2485
2484
|
driver: :saucelabs,
|
2486
2485
|
device_type: :tablet,
|
@@ -2495,14 +2494,14 @@ device orientation, Appium version, and various test configuration options.
|
|
2495
2494
|
username: ENV['SL_USERNAME'],
|
2496
2495
|
access_key: ENV['SL_AUTHKEY'],
|
2497
2496
|
name: 'ALP AP',
|
2498
|
-
build: "Test Build {ENV['BUILD_NUM']}",
|
2497
|
+
build: "Test Build #{ENV['BUILD_NUM']}",
|
2499
2498
|
deviceOrientation: 'PORTRAIT',
|
2500
2499
|
appiumVersion: '1.22.3'
|
2501
2500
|
}
|
2502
2501
|
}
|
2503
2502
|
}
|
2504
2503
|
WebDriverConnect.initialize_web_driver(options)
|
2505
|
-
|
2504
|
+
```
|
2506
2505
|
|
2507
2506
|
#### Remote Desktop Browsers on the TestingBot Service
|
2508
2507
|
|
@@ -2536,7 +2535,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2536
2535
|
- `browser_version:` in the `capabilities:` hash must be set to browser version from capability in chart
|
2537
2536
|
- `platform_name:` in the `capabilities:` hash must be set to platform name from capability in chart
|
2538
2537
|
|
2539
|
-
```
|
2538
|
+
```ruby
|
2540
2539
|
options = {
|
2541
2540
|
driver: :testingbot,
|
2542
2541
|
capabilities: {
|
@@ -2560,7 +2559,7 @@ the `TB_AUTHKEY` Environment Variable is set to your TestingBot access key.
|
|
2560
2559
|
Below is an example of an `options` hash for specifying a connection to the latest version of an Edge desktop web browser
|
2561
2560
|
running on macOS Sonoma hosted on TestingBot. The `options` hash includes options for specifying the driver name, setting
|
2562
2561
|
the browser window size, and capabilities for setting screen resolution, time zone, and various test configuration options.
|
2563
|
-
|
2562
|
+
```ruby
|
2564
2563
|
options = {
|
2565
2564
|
driver: :testingbot,
|
2566
2565
|
driver_name: :admin_user,
|
@@ -2571,7 +2570,7 @@ the browser window size, and capabilities for setting screen resolution, time zo
|
|
2571
2570
|
platform_name: 'SONOMA',
|
2572
2571
|
'tb:options': {
|
2573
2572
|
name: 'ALP AP',
|
2574
|
-
build: "Test Build {ENV['BUILD_NUM']}",
|
2573
|
+
build: "Test Build #{ENV['BUILD_NUM']}",
|
2575
2574
|
timeZone: 'Australia/Adelaide',
|
2576
2575
|
'testingbot.geoCountryCode': 'AU',
|
2577
2576
|
'screen-resolution': '2048x1536',
|
@@ -2580,7 +2579,7 @@ the browser window size, and capabilities for setting screen resolution, time zo
|
|
2580
2579
|
}
|
2581
2580
|
}
|
2582
2581
|
WebDriverConnect.initialize_web_driver(options)
|
2583
|
-
|
2582
|
+
```
|
2584
2583
|
|
2585
2584
|
#### Remote Mobile Browsers on the TestingBot Service
|
2586
2585
|
|
@@ -2616,7 +2615,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2616
2615
|
- `browserName:` in the `capabilities:` hash must be set to `browserName` from capability in chart
|
2617
2616
|
- `platform_name:` in the `capabilities:` hash must be set to `platform_name` from capability in chart
|
2618
2617
|
|
2619
|
-
```
|
2618
|
+
```ruby
|
2620
2619
|
options = {
|
2621
2620
|
driver: :testingbot,
|
2622
2621
|
device_type: phone_or_tablet,
|
@@ -2644,7 +2643,7 @@ the `TB_AUTHKEY` Environment Variable is set to your TestingBot access key.
|
|
2644
2643
|
Below is an example of an `options` hash for specifying a connection to a mobile Safari web browser running on an iPad
|
2645
2644
|
tablet hosted on TestingBot. The `options` hash includes options for specifying the driver name, and capabilities for setting
|
2646
2645
|
device orientation, Appium version, and various test configuration options.
|
2647
|
-
|
2646
|
+
```ruby
|
2648
2647
|
options = {
|
2649
2648
|
driver: :testingbot,
|
2650
2649
|
device_type: :tablet,
|
@@ -2656,13 +2655,13 @@ device orientation, Appium version, and various test configuration options.
|
|
2656
2655
|
'tb:options': {
|
2657
2656
|
deviceName: 'iPad Pro (12.9-inch) (5th generation)',
|
2658
2657
|
name: 'ALP AP',
|
2659
|
-
build: "Test Build {ENV['BUILD_NUM']}",
|
2658
|
+
build: "Test Build #{ENV['BUILD_NUM']}",
|
2660
2659
|
orientation: 'LANDSCAPE'
|
2661
2660
|
}
|
2662
2661
|
}
|
2663
2662
|
}
|
2664
2663
|
WebDriverConnect.initialize_web_driver(options)
|
2665
|
-
|
2664
|
+
```
|
2666
2665
|
|
2667
2666
|
#### Remote Desktop Browsers on the LambdaTest Service
|
2668
2667
|
|
@@ -2698,7 +2697,7 @@ When using the `options` hash, the following options and capabilities must be sp
|
|
2698
2697
|
- `browserName:` in the `capabilities:` hash must be set to name from capability in chart
|
2699
2698
|
- `browserVersion:` in the `capabilities:` hash must be set to browser version from capability in chart
|
2700
2699
|
|
2701
|
-
```
|
2700
|
+
```ruby
|
2702
2701
|
options = {
|
2703
2702
|
driver: :lambdatest,
|
2704
2703
|
capabilities: {
|
@@ -2727,7 +2726,7 @@ Below is an example of an `options` hash for specifying a connection to the late
|
|
2727
2726
|
running on macOS Sonoma hosted on LambdaTest. The `options` hash includes options for specifying the driver name, setting
|
2728
2727
|
the browser window size, and capabilities for setting screen resolution, geoLocation, time zone, Selenium version, and various
|
2729
2728
|
test configuration options.
|
2730
|
-
|
2729
|
+
```ruby
|
2731
2730
|
options = {
|
2732
2731
|
driver: :lambdatest,
|
2733
2732
|
driver_name: :admin_user,
|
@@ -2740,7 +2739,7 @@ test configuration options.
|
|
2740
2739
|
username: ENV['LT_USERNAME'],
|
2741
2740
|
accessKey: ENV['LT_AUTHKEY'],
|
2742
2741
|
project: 'ALP AP',
|
2743
|
-
build: "Test Build {ENV['BUILD_NUM']}",
|
2742
|
+
build: "Test Build #{ENV['BUILD_NUM']}",
|
2744
2743
|
resolution: '2560x1440',
|
2745
2744
|
selenium_version: '4.13.0',
|
2746
2745
|
networkLogs: 'true',
|
@@ -2752,7 +2751,7 @@ test configuration options.
|
|
2752
2751
|
}
|
2753
2752
|
}
|
2754
2753
|
WebDriverConnect.initialize_web_driver(options)
|
2755
|
-
|
2754
|
+
```
|
2756
2755
|
|
2757
2756
|
#### Remote Browsers on Unsupported Cloud Hosting Services
|
2758
2757
|
|
@@ -2767,14 +2766,14 @@ The following options and capabilities must be specified:
|
|
2767
2766
|
|
2768
2767
|
All other required capabilities specified by the hosting service configuration documentation should be included in the
|
2769
2768
|
`capabilities:` hash.
|
2770
|
-
|
2769
|
+
```ruby
|
2771
2770
|
options = {
|
2772
2771
|
driver: :custom,
|
2773
2772
|
endpoint: endpoint_url,
|
2774
2773
|
capabilities: { browserName: browser_name_from_chart }
|
2775
2774
|
}
|
2776
2775
|
WebDriverConnect.initialize_web_driver(options)
|
2777
|
-
|
2776
|
+
```
|
2778
2777
|
> ℹ️ If an optional user defined `driver_name:` is not specified in the `options` hash, the default driver name will be set to
|
2779
2778
|
`:custom_<browserName>` - e.g. `:custom_chrome` or `:custom_safari`.
|
2780
2779
|
|
@@ -2783,7 +2782,7 @@ either `:desktop` or `:mobile`, and `Environ.device` to either `:web` or `:devic
|
|
2783
2782
|
is a desktop browser or a mobile browser running on a mobile device or simulator.
|
2784
2783
|
|
2785
2784
|
Below is an example for specifying a connection to a Firefox desktop web browser on an unsupported hosting service:
|
2786
|
-
|
2785
|
+
```ruby
|
2787
2786
|
# specify desktop platform
|
2788
2787
|
Environ.platform = :desktop
|
2789
2788
|
Environ.device = :web
|
@@ -2800,10 +2799,10 @@ Below is an example for specifying a connection to a Firefox desktop web browser
|
|
2800
2799
|
}
|
2801
2800
|
}
|
2802
2801
|
WebDriverConnect.initialize_web_driver(options)
|
2803
|
-
|
2802
|
+
```
|
2804
2803
|
Below is an example for specifying a connection to a mobile Safari web browser running on an iPad on an unsupported hosting
|
2805
2804
|
service:
|
2806
|
-
|
2805
|
+
```ruby
|
2807
2806
|
# specify mobile platform, device type, and device name
|
2808
2807
|
Environ.platform = :mobile
|
2809
2808
|
Environ.device = :device
|
@@ -2820,7 +2819,7 @@ service:
|
|
2820
2819
|
}
|
2821
2820
|
}
|
2822
2821
|
WebDriverConnect.initialize_web_driver(options)
|
2823
|
-
|
2822
|
+
```
|
2824
2823
|
|
2825
2824
|
### Closing Browser and Driver Instances
|
2826
2825
|
|
@@ -2828,23 +2827,23 @@ service:
|
|
2828
2827
|
|
2829
2828
|
To close all browser and driver instances upon completion of your automated Cucumber features, place the code shown below
|
2830
2829
|
in your `hooks.rb` file:
|
2831
|
-
|
2830
|
+
```ruby
|
2832
2831
|
AfterAll do
|
2833
2832
|
# terminate all driver instances
|
2834
2833
|
WebDriverConnect.close_all_drivers
|
2835
2834
|
end
|
2836
|
-
|
2835
|
+
```
|
2837
2836
|
|
2838
2837
|
#### Closing Instances Using RSpec
|
2839
2838
|
|
2840
2839
|
To close all browser and driver instances upon completion of an automated spec, place the code shown below in the body
|
2841
2840
|
of an example group:
|
2842
|
-
|
2841
|
+
```ruby
|
2843
2842
|
after(:each) do
|
2844
2843
|
# terminate all driver instances
|
2845
2844
|
WebDriverConnect.close_all_drivers
|
2846
2845
|
end
|
2847
|
-
|
2846
|
+
```
|
2848
2847
|
|
2849
2848
|
### Using Browser Specific Profiles in `cucumber.yml`
|
2850
2849
|
|
@@ -551,7 +551,7 @@ module TestCentricity
|
|
551
551
|
else
|
552
552
|
# define desktop browser options
|
553
553
|
tb_options['screen-resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
|
554
|
-
tb_options['selenium-version'] = '4.
|
554
|
+
tb_options['selenium-version'] = '4.18.1'
|
555
555
|
end
|
556
556
|
{
|
557
557
|
browserName: browser,
|
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.5.
|
4
|
+
version: 4.5.4
|
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: 2024-
|
11
|
+
date: 2024-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -268,14 +268,14 @@ dependencies:
|
|
268
268
|
requirements:
|
269
269
|
- - '='
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version: 4.
|
271
|
+
version: 4.18.1
|
272
272
|
type: :runtime
|
273
273
|
prerelease: false
|
274
274
|
version_requirements: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
276
|
- - '='
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version: 4.
|
278
|
+
version: 4.18.1
|
279
279
|
- !ruby/object:Gem::Dependency
|
280
280
|
name: test-unit
|
281
281
|
requirement: !ruby/object:Gem::Requirement
|
@@ -307,7 +307,7 @@ dependencies:
|
|
307
307
|
description: |2-
|
308
308
|
|
309
309
|
The TestCentricity™ Web core framework for desktop and mobile web browser-based app testing implements a Page Object
|
310
|
-
Model DSL for use with Cucumber or RSpec, and Selenium-Webdriver v4.
|
310
|
+
Model DSL for use with Cucumber or RSpec, and Selenium-Webdriver v4.18. The gem also facilitates the configuration of
|
311
311
|
the appropriate Selenium-Webdriver capabilities required to establish connections to locally hosted desktop browsers,
|
312
312
|
locally hosted emulated mobile browsers (iOS, Android, etc.) running within a local instance of Chrome, mobile Safari
|
313
313
|
browsers on iOS device simulators or physical iOS devices, mobile Chrome browsers on Android Studio virtual device
|