testcentricity_web 4.1.9 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +96 -1
  3. data/README.md +88 -48
  4. data/lib/testcentricity_web/browser_helper.rb +2 -1
  5. data/lib/testcentricity_web/data_objects/environment.rb +0 -1
  6. data/lib/testcentricity_web/version.rb +1 -1
  7. data/lib/testcentricity_web/web_core/page_objects_helper.rb +40 -3
  8. data/lib/testcentricity_web/web_core/webdriver_helper.rb +89 -80
  9. data/lib/testcentricity_web/web_elements/media.rb +108 -0
  10. data/lib/testcentricity_web/web_elements/textfield.rb +28 -0
  11. data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +39 -1
  12. metadata +37 -181
  13. data/.gitignore +0 -39
  14. data/.idea/.name +0 -1
  15. data/.idea/encodings.xml +0 -6
  16. data/.idea/misc.xml +0 -4
  17. data/.idea/modules.xml +0 -8
  18. data/.idea/vcs.xml +0 -7
  19. data/.rspec +0 -4
  20. data/.rubocop.yml +0 -38
  21. data/.ruby-version +0 -1
  22. data/.simplecov +0 -9
  23. data/CODE_OF_CONDUCT.md +0 -13
  24. data/Gemfile +0 -6
  25. data/Rakefile +0 -115
  26. data/config/cucumber.yml +0 -171
  27. data/config/locales/en-US.yml +0 -56
  28. data/config/test_data/LOCAL_data.json +0 -15
  29. data/config/test_data/LOCAL_data.xls +0 -0
  30. data/config/test_data/LOCAL_data.yml +0 -11
  31. data/config/test_data/data.json +0 -25
  32. data/config/test_data/data.xls +0 -0
  33. data/config/test_data/data.yml +0 -20
  34. data/docker-compose.yml +0 -48
  35. data/features/basic_form_page_css.feature +0 -54
  36. data/features/basic_form_page_xpath.feature +0 -26
  37. data/features/custom_controls.feature +0 -29
  38. data/features/media_players.feature +0 -67
  39. data/features/step_definitions/generic_steps.rb.rb +0 -124
  40. data/features/step_definitions/media_steps.rb +0 -30
  41. data/features/support/data/form_data.rb +0 -43
  42. data/features/support/env.rb +0 -51
  43. data/features/support/hooks.rb +0 -270
  44. data/features/support/pages/base_test_page.rb +0 -22
  45. data/features/support/pages/basic_css_form_page.rb +0 -53
  46. data/features/support/pages/basic_form_page.rb +0 -429
  47. data/features/support/pages/basic_xpath_form_page.rb +0 -54
  48. data/features/support/pages/custom_controls_page.rb +0 -263
  49. data/features/support/pages/indexed_sections_page.rb +0 -57
  50. data/features/support/pages/media_test_page.rb +0 -207
  51. data/features/support/sections/header_nav.rb +0 -48
  52. data/features/support/sections/product_card.rb +0 -39
  53. data/features/support/world_data.rb +0 -12
  54. data/features/support/world_pages.rb +0 -18
  55. data/reports/.keep +0 -1
  56. data/spec/fixtures/page_object.rb +0 -22
  57. data/spec/fixtures/section_object.rb +0 -21
  58. data/spec/spec_helper.rb +0 -31
  59. data/spec/testcentricity_web/browser_spec.rb +0 -41
  60. data/spec/testcentricity_web/elements/audio_spec.rb +0 -68
  61. data/spec/testcentricity_web/elements/button_spec.rb +0 -18
  62. data/spec/testcentricity_web/elements/checkbox_spec.rb +0 -33
  63. data/spec/testcentricity_web/elements/file_field_spec.rb +0 -13
  64. data/spec/testcentricity_web/elements/image_spec.rb +0 -33
  65. data/spec/testcentricity_web/elements/label_spec.rb +0 -18
  66. data/spec/testcentricity_web/elements/link_spec.rb +0 -23
  67. data/spec/testcentricity_web/elements/list_spec.rb +0 -13
  68. data/spec/testcentricity_web/elements/radio_spec.rb +0 -28
  69. data/spec/testcentricity_web/elements/ui_element_spec.rb +0 -125
  70. data/spec/testcentricity_web/elements/video_spec.rb +0 -68
  71. data/spec/testcentricity_web/helper_specs/object_helpers_spec.rb +0 -39
  72. data/spec/testcentricity_web/helper_specs/string_helpers_spec.rb +0 -49
  73. data/spec/testcentricity_web/page_object_spec.rb +0 -90
  74. data/spec/testcentricity_web/section_object_spec.rb +0 -72
  75. data/spec/testcentricity_web/version_spec.rb +0 -7
  76. data/spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb +0 -72
  77. data/spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb +0 -86
  78. data/spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb +0 -65
  79. data/test_site/basic_test_page.html +0 -290
  80. data/test_site/chosen-sprite.png +0 -0
  81. data/test_site/chosen-sprite@2x.png +0 -0
  82. data/test_site/chosen.css +0 -496
  83. data/test_site/chosen.jquery.js +0 -1359
  84. data/test_site/chosen.jquery.min.js +0 -3
  85. data/test_site/chosen.min.css +0 -11
  86. data/test_site/chosen.proto.js +0 -1399
  87. data/test_site/chosen.proto.min.js +0 -3
  88. data/test_site/composer.json +0 -36
  89. data/test_site/custom_controls_page.html +0 -629
  90. data/test_site/docsupport/chosen.png +0 -0
  91. data/test_site/docsupport/init.js +0 -11
  92. data/test_site/docsupport/init.proto.js +0 -16
  93. data/test_site/docsupport/jquery-1.12.4.min.js +0 -5
  94. data/test_site/docsupport/jquery-3.2.1.min.js +0 -4
  95. data/test_site/docsupport/oss-credit.png +0 -0
  96. data/test_site/docsupport/prism.css +0 -108
  97. data/test_site/docsupport/prism.js +0 -9
  98. data/test_site/docsupport/prototype-1.7.0.0.js +0 -6082
  99. data/test_site/docsupport/style.css +0 -219
  100. data/test_site/images/Blouse_Black.jpg +0 -0
  101. data/test_site/images/Granny.jpg +0 -0
  102. data/test_site/images/Printed_Dress.jpg +0 -0
  103. data/test_site/images/T-shirt.jpg +0 -0
  104. data/test_site/images/Wilder.jpg +0 -0
  105. data/test_site/images/You_Betcha.jpg +0 -0
  106. data/test_site/images/jeans3.jpg +0 -0
  107. data/test_site/indexed_sections_page.html +0 -215
  108. data/test_site/media/MIB2-subtitles-pt-BR.vtt +0 -49
  109. data/test_site/media/MIB2.mp4 +0 -0
  110. data/test_site/media/MP4_small.mp4 +0 -0
  111. data/test_site/media/MPS_sample.mp3 +0 -0
  112. data/test_site/media/bbc_scotland_report.mp3 +0 -0
  113. data/test_site/media/count_and_bars.mp4 +0 -0
  114. data/test_site/media_page.html +0 -86
  115. data/testcentricity_web.gemspec +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c35f1c09951d1a58be2d3bac921d2d221311edf3b4464c5d4806c7a30a57c0f2
4
- data.tar.gz: bbe72af137b6808721f7a87b26032c42d78bbf4708ff88ed34c753ebcec85c46
3
+ metadata.gz: e1f34273e6126cc792065a37bdb761e8ca0f0c597e9030b3f9f58f2846a8d5c2
4
+ data.tar.gz: 43a3dbfb5c94a0ff10b161e01d4087c3973ed11b61596363b455e1f82897c403
5
5
  SHA512:
6
- metadata.gz: 0607f397cd9d6564623218d3e88f541a04f17c9b4b8cc96eb50571bc787cfa46927651dc38cfc7765129dd33303fbd3c130720dc809940cf401a336756c3d7c1
7
- data.tar.gz: 11cc150624658854f69575361345dca970a3cf567e1b29e6797450dc22df88f53b069374a63ab8e12f83e7638a28386b0edd0d96e6707720f41e1e6fa621c1f5
6
+ metadata.gz: 12b80dbd95dc924ca9b51b0ac5d7876f55642e8824b5f38e0fd19f008487a23f3a4d24418712785d93e93d1f330fbeaa03e7754c2fc8a3a9967d931cf47aab0b
7
+ data.tar.gz: a1bdb14f26c27829e71f0fb96c2ccb7183e5058dca09e46b0a515595611680ca6692f6c1a52f3c38cf60ba59c04f3ce720b29f8cd50be507a40119a13298d308
data/CHANGELOG.md CHANGED
@@ -2,6 +2,102 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [4.3.0] - 01-AUGUST-2022
6
+
7
+ ### Added
8
+ * The `DRIVER` Environment Variable is now used to specify the `appium`, `browserstack`, `saucelabs`, `testingbot`,
9
+ or `lambdatest` driver.
10
+
11
+ * ### Changed
12
+ * The `WEB_BROWSER` Environment Variable is no longer used to specify the `appium`, `browserstack`, `saucelabs`, `testingbot`,
13
+ or `lambdatest` driver.
14
+ * TestCentricity now supports and integrates with Selenium-Webdriver version 4.3.
15
+
16
+
17
+ ## [4.2.6] - 12-JUNE-2022
18
+
19
+ ### Fixed
20
+ * Fix `gemspec` to no longer include specs and cuke tests as part of deployment package for gem.
21
+
22
+
23
+ ## [4.2.5] - 10-JUNE-2022
24
+
25
+ ### Fixed
26
+ *`WebDriverConnect.initialize_web_driver` method no longer raises `No such file or directory @ dir_s_mkdir` error due to
27
+ missing `Downloads` folder when running tests in parallel.
28
+
29
+
30
+ ## [4.2.4] - 02-JUNE-2022
31
+
32
+ ### Added
33
+ * Added `UIElement.wait_until_enabled` method
34
+
35
+
36
+ ## [4.2.3] - 01-JUNE-2022
37
+
38
+ ### Added
39
+ * Added `UIElement.wait_while_busy` method
40
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `aria_busy` attribute.
41
+
42
+
43
+ ## [4.2.2] - 21-MAY-2022
44
+
45
+ ### Changed
46
+ * Update default version of Appium used when running tests on Sauce Labs service.
47
+ * Refactored capabilities definition when running with locally hosted Appium instance.
48
+
49
+
50
+ ## [4.2.1] - 23-APR-2022
51
+
52
+ ### Added
53
+ * Added the following `Audio`, `Media`, and `Video` methods to support verification of media text tracks (subtitles, captions,
54
+ chapters, descriptions, or metadata):
55
+ * `track_count`
56
+ * `active_track`
57
+ * `active_track_data`
58
+ * `all_tracks_data`
59
+ * `track_data`
60
+ * `active_track_source`
61
+ * `track_source`
62
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the following
63
+ `Media` properties:
64
+ * `:track_count`
65
+ * `:active_track`
66
+ * `:active_track_data`
67
+ * `:all_tracks_data`
68
+ * `:track_data`
69
+ * `:active_track_source`
70
+ * `:track_source`
71
+
72
+
73
+ ## [4.2.0] - 20-APR-2022
74
+
75
+ ### Added
76
+ * `TextField.validation_message` and `TextField.validity?` methods added.
77
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the following
78
+ `TextField.validity?` properties:
79
+ * `:badInput`
80
+ * `:customError`
81
+ * `:patternMismatch`
82
+ * `:rangeOverflow`
83
+ * `:rangeUnderflow`
84
+ * `:stepMismatch`
85
+ * `:tooLong`
86
+ * `:tooShort`
87
+ * `:typeMismatch`
88
+ * `:valid`
89
+ * `:valueMissing`
90
+
91
+
92
+ ## [4.1.10] - 19-APR-2022
93
+
94
+ ### Fixed
95
+ * `PageObject.set_verify_focus` and `PageSection.set_verify_focus` methods now correctly return the `id` of the UI element
96
+ that unexpectedly has focus during an exception.
97
+ * Rolled back `require_all` gem version to 1.5.0 in gemspec development dependencies due to `RequireAll::LoadError` when
98
+ running gem test specs and features.
99
+
100
+
5
101
  ## [4.1.9] - 18-APR-2022
6
102
 
7
103
  ### Fixed
@@ -10,7 +106,6 @@ All notable changes to this project will be documented in this file.
10
106
  radio buttons to the unchecked state.
11
107
 
12
108
  ### Added
13
-
14
109
  * `CheckBox.define_custom_elements` and `Radio.define_custom_elements` methods now support specifying a child `input` component
15
110
  contained by a top level `label` element.
16
111
 
data/README.md CHANGED
@@ -1,18 +1,19 @@
1
1
  # TestCentricity™ Web
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/testcentricity_web.svg)](https://badge.fury.io/rb/testcentricity_web) [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause)
4
+ ![Gem Downloads](https://img.shields.io/gem/dt/testcentricity_web) ![Maintained](https://img.shields.io/maintenance/yes/2022)
4
5
 
5
6
 
6
- The TestCentricity™ Web core generic framework for desktop and mobile web browser-based app testing implements a Page Object Model DSL
7
- for use with Cucumber, Capybara (version 3.x), and Selenium-Webdriver (version 4.x). It also facilitates the configuration of the appropriate
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
8
9
  Selenium-Webdriver capabilities required to establish a connection with a local or cloud hosted desktop or mobile web browser.
9
10
 
10
11
  The TestCentricity™ Web gem supports running automated tests against the following web test targets:
11
12
  * locally hosted desktop browsers (Chrome, Edge, Firefox, Safari, or IE)
12
13
  * locally hosted "headless" Chrome, Firefox, or Edge browsers
13
14
  * remote desktop and emulated mobile web browsers hosted on Selenium Grid 4 and Dockerized Selenium Grid 4 environments
14
- * mobile Safari browsers on iOS device simulators or physical iOS devices (using Appium and XCode on OS X)
15
- * mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on OS X)
15
+ * mobile Safari browsers on iOS device simulators or physical iOS devices (using Appium and XCode on macOS)
16
+ * mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on macOS)
16
17
  * cloud hosted desktop (Firefox, Chrome, Safari, IE, or Edge) or mobile (iOS Mobile Safari or Android) web browsers using the following service:
17
18
  * [Browserstack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate)
18
19
  * [Sauce Labs](https://saucelabs.com/open-source#automated-testing-platform)
@@ -27,13 +28,16 @@ The TestCentricity™ Web gem supports running automated tests against the follo
27
28
 
28
29
  A complete history of bug fixes and new features can be found in the {file:CHANGELOG.md CHANGELOG} file.
29
30
 
30
- An example project that demonstrates the implementation of a page object model framework using Cucumber and TestCentricity™
31
+ The RubyDocs for this gem can be found [here](https://www.rubydoc.info/gems/testcentricity_web).
32
+
33
+ An example project that demonstrates the implementation of a page object model framework using Cucumber and TestCentricity™ Web
31
34
  can be found [here](https://github.com/TestCentricity/tc_web_sample).
32
35
 
33
36
 
34
37
  ## Installation
35
38
 
36
- TestCentricity version 4.1 and above requires Ruby 2.7 or later. To install the TestCentricity gem, add this line to your automation project's Gemfile:
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:
37
41
 
38
42
  gem 'testcentricity_web'
39
43
 
@@ -57,7 +61,7 @@ If you are using Cucumber, you need to require the following in your `env.rb` fi
57
61
 
58
62
  ### Using RSpec
59
63
 
60
- If you are using RSpec instead, you need to require the following in your `env.rb` file:
64
+ If you are using RSpec instead, you need to require the following in your `spec_helper.rb` file:
61
65
 
62
66
  require 'capybara'
63
67
  require 'capybara/rspec'
@@ -67,7 +71,7 @@ If you are using RSpec instead, you need to require the following in your `env.r
67
71
  ### Using Appium
68
72
 
69
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
70
- the following in your `env.rb` file:
74
+ the following in your `env.rb` and/or `spec_helper.rb` file:
71
75
 
72
76
  require 'appium_capybara'
73
77
 
@@ -116,22 +120,22 @@ Web pages typically have names and URLs associated with them. Web pages also typ
116
120
  indicates that the page's contents have fully loaded.
117
121
 
118
122
  The `page_name` trait is registered with the `PageManager` object, which includes a `find_page` method that takes a page name as a
119
- parameter and returns an instance of the associated `Page Object`. If you intend to use the `PageManager`, you must define a `page_name`
123
+ parameter and returns an instance of the associated `PageObject`. If you intend to use the `PageManager`, you must define a `page_name`
120
124
  trait for each `PageObject` to be registered.
121
125
 
122
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.
123
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
124
128
  an `Array` of `String` values representing those page names.
125
129
 
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.
133
+
126
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
127
135
  when calling the `WebDriverConnect.initialize_web_driver` method, then your `page_url` trait can be the relative URL slug that will
128
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
129
137
  via a URL.
130
138
 
131
- 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
132
- `page_locator` trait is a CSS or Xpath expression that uniquely identifies the object or attribute. The `verify_page_exists` method waits
133
- for the `page_locator` trait to exist.
134
-
135
139
  You define your page's **Traits** as shown below:
136
140
 
137
141
  class LoginPage < TestCentricity::PageObject
@@ -385,8 +389,7 @@ You add a `PageSection` to its associated `PageObject` as shown below:
385
389
  Once your `PageObject` has been instantiated, you can call its `PageSection` methods as shown below:
386
390
 
387
391
  home_page.search_form.search_for('ocarina')
388
-
389
-
392
+
390
393
 
391
394
  ## UIElements
392
395
 
@@ -400,9 +403,9 @@ all UI elements are based on the `UIElement` class.
400
403
 
401
404
  Single `UIElement` declarations have the following format:
402
405
 
403
- elementType :element Name, locator
406
+ elementType :elementName, locator
404
407
 
405
- * The `element name` is the unique name that you will use to refer to the UI element and is specified as a `Symbol`.
408
+ * The `elementName` is the unique name that you will use to refer to the UI element and is specified as a `Symbol`.
406
409
  * The `locator` is the CSS or XPath attribute that uniquely and unambiguously identifies the `UIElement`.
407
410
 
408
411
  Multiple `UIElement` declarations for a collection of elements of the same type can be performed by passing a hash table containing the
@@ -473,8 +476,8 @@ Supported `UIElement` elementTypes and their declarations have the following for
473
476
 
474
477
 
475
478
  Refer to the Class List documentation for the `PageObject` and `PageSection` classes for details on the class methods used for declaring
476
- and instantiating `UIElements`. Examples of UI element declarations can be found in the ***Adding UI Elements to your Page Object*** and
477
- ***Adding UI Elements to your PageSection Object*** sections above.
479
+ and instantiating `UIElements`. Examples of UI element declarations can be found in the ***Adding UI Elements to your PageObject*** and
480
+ ***Adding UI Elements to your PageSection*** sections above.
478
481
 
479
482
 
480
483
  ### UIElement Inherited Methods
@@ -524,8 +527,10 @@ With TestCentricity, all UI elements are based on the `UIElement` class, and inh
524
527
  element.wait_until_gone(seconds)
525
528
  element.wait_until_visible(seconds)
526
529
  element.wait_until_hidden(seconds)
530
+ element.wait_until_enabled(seconds)
527
531
  element.wait_until_value_is(value, seconds)
528
532
  element.wait_until_value_changes(seconds)
533
+ element.wait_while_busy(seconds)
529
534
 
530
535
  **WAI-ARIA Object Accessibility (A11y) methods:**
531
536
 
@@ -579,7 +584,7 @@ of a hex color `String`. For `section` objects, data values must be a `String`,
579
584
  The `populate_data_fields` method verifies that data attributes associated with each `UIElement` is not `nil` or `empty` before attempting to
580
585
  enter data into the `UIElement`.
581
586
 
582
- The optional `wait_time` parameter is used to specify the time (in seconds) to wait for each `UIElement` to become become viable for data entry
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
583
588
  (the `UIElement` must be visible and enabled) before entering the associated data value. This option is useful in situations where entering data,
584
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
585
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.
@@ -657,6 +662,21 @@ The `verify_ui_states` method supports the following property/state pairs:
657
662
  :max Integer
658
663
  :step Integer
659
664
 
665
+ Text Field Constraint validation
666
+
667
+ :validation_message String
668
+ :badInput Boolean
669
+ :customError Boolean
670
+ :patternMismatch Boolean
671
+ :rangeOverflow Boolean
672
+ :rangeUnderflow Boolean
673
+ :stepMismatch Boolean
674
+ :tooLong Boolean
675
+ :tooShort Boolean
676
+ :typeMismatch Boolean
677
+ :valid Boolean
678
+ :valueMissing Boolean
679
+
660
680
  **Checkboxes:**
661
681
 
662
682
  :checked Boolean
@@ -720,6 +740,13 @@ The `verify_ui_states` method supports the following property/state pairs:
720
740
  :volume Float
721
741
  :preload String
722
742
  :poster String
743
+ :track_count Integer
744
+ :active_track Integer
745
+ :active_track_data Hash
746
+ :all_tracks_data Array of Hash
747
+ :track_data Hash
748
+ :active_track_source String
749
+ :track_source String
723
750
 
724
751
  #### ARIA accessibility property/state pairs
725
752
 
@@ -738,6 +765,7 @@ The `verify_ui_states` method supports the following ARIA accessibility property
738
765
  :aria_checked Boolean
739
766
  :aria_readonly Boolean
740
767
  :aria_pressed Boolean
768
+ :aria_busy Boolean
741
769
  :aria_haspopup Boolean
742
770
  :aria_sort String
743
771
  :aria_rowcount String
@@ -1020,7 +1048,7 @@ cumbersome to manage if your web application has dozens of `PageObjects` that ne
1020
1048
  ### Using the PageManager
1021
1049
 
1022
1050
  The `PageManager` class provides methods for supporting the instantiation and management of `PageObjects`. In the code example below,
1023
- the `page_objects` method contains a hash table of your `PageObject` instances and their associated `PageObject` class names to be
1051
+ the `page_objects` method contains a hash table of your `PageObject` instances and their associated `PageObject` classes to be
1024
1052
  instantiated by `PageManager`:
1025
1053
 
1026
1054
  module WorldPages
@@ -1159,24 +1187,24 @@ The `TestCentricity::WebDriverConnect.initialize_web_driver` method configures t
1159
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.
1160
1188
 
1161
1189
  The `TestCentricity::WebDriverConnect.initialize_web_driver` method accepts a single optional parameter - the base host URL. Cucumber
1162
- **Environment Variables** are used to specify the target local or remote web browser, and the various webdriver capability parameters required to configure
1163
- the connection.
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.
1164
1192
 
1165
1193
 
1166
1194
  ### Locally hosted desktop web browser
1167
1195
 
1168
- For locally hosted desktop web browsers running on macOS (OS X) or Windows platforms, the `WEB_BROWSER` Environment Variable must be set to one of the
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
1169
1197
  values from the table below:
1170
1198
 
1171
1199
  | `WEB_BROWSER` | **Desktop Platform** |
1172
1200
  |--------------------|------------------------------------------------|
1173
- | `chrome` | OS X or Windows |
1174
- | `chrome_headless` | OS X or Windows (headless - no visible UI) |
1175
- | `firefox` | OS X or Windows |
1176
- | `firefox_headless` | OS X or Windows (headless - no visible UI) |
1177
- | `edge` | OS X or Windows |
1178
- | `edge_headless` | OS X or Windows (headless - no visible UI) |
1179
- | `safari` | OS X only |
1201
+ | `chrome` | macOS or Windows |
1202
+ | `chrome_headless` | macOS or Windows (headless - no visible UI) |
1203
+ | `firefox` | macOS or Windows |
1204
+ | `firefox_headless` | macOS or Windows (headless - no visible UI) |
1205
+ | `edge` | macOS or Windows |
1206
+ | `edge_headless` | macOS or Windows (headless - no visible UI) |
1207
+ | `safari` | macOS only |
1180
1208
  | `ie` | Windows only (IE version 10.x or greater only) |
1181
1209
 
1182
1210
  Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below.
@@ -1234,7 +1262,7 @@ A detailed list of file MIME types can be found [here](https://www.freeformatter
1234
1262
 
1235
1263
  ### Locally hosted emulated mobile web browser
1236
1264
 
1237
- You can run your tests against mobile device browsers that are emulated within a locally hosted instance of a Chrome desktop browser on OS X or
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
1238
1266
  Windows. The specified mobile browser's user agent, CSS screen dimensions, and default screen orientation will be automatically set within the
1239
1267
  local Chrome browser instance. You may even specify the emulated device's screen orientation. For locally hosted emulated mobile web browsers,
1240
1268
  the `WEB_BROWSER` Environment Variable must be set to one of the values from the table below:
@@ -1345,7 +1373,7 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1345
1373
  #### Mobile Safari browser on iOS Simulators or iOS Physical Devices
1346
1374
 
1347
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
1348
- OS X. You must install Appium, XCode, and the iOS version-specific device simulators for XCode. You must also ensure that the `appium_capybara` gem is
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
1349
1377
  installed and required as described in **section 3.3 (Setup - Using Appium)** above.
1350
1378
 
1351
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).
@@ -1355,7 +1383,7 @@ Once your test environment is properly configured, the following **Environment V
1355
1383
 
1356
1384
  | **Environment Variable** | **Description** |
1357
1385
  |----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1358
- | `WEB_BROWSER` | Must be set to `appium` |
1386
+ | `DRIVER` | Must be set to `appium` |
1359
1387
  | `APP_PLATFORM_NAME` | Must be set to `iOS` |
1360
1388
  | `APP_BROWSER` | Must be set to `Safari` |
1361
1389
  | `APP_VERSION` | Must be set to `15.4`, `14.5`, or which ever iOS version you wish to run within the XCode Simulator |
@@ -1386,7 +1414,7 @@ Refer to **section 8.6 (Using Browser specific Profiles in cucumber.yml)** below
1386
1414
 
1387
1415
  #### Mobile Chrome or Android browsers on Android Studio Virtual Device emulators
1388
1416
 
1389
- You can run your mobile web tests against the mobile Chrome or Android browser on emulated Android devices using Appium and Android Studio on OS X. You
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
1390
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)
1391
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
1392
1420
  described in **section 3.3 (Setup - Using Appium)** above.
@@ -1398,7 +1426,7 @@ Once your test environment is properly configured, the following **Environment V
1398
1426
 
1399
1427
  | **Environment Variable** | **Description** |
1400
1428
  |---------------------------|--------------------------------------------------------------------------------------------------------------------------------|
1401
- | `WEB_BROWSER` | Must be set to `appium` |
1429
+ | `DRIVER` | Must be set to `appium` |
1402
1430
  | `APP_PLATFORM_NAME` | Must be set to `Android` |
1403
1431
  | `APP_BROWSER` | Must be set to `Chrome` or `Browser` |
1404
1432
  | `APP_VERSION` | Must be set to `12.0`, or which ever Android OS version you wish to run with the Android Virtual Device |
@@ -1471,7 +1499,7 @@ for information regarding the specific capabilities.
1471
1499
 
1472
1500
  | **Environment Variable** | **Description** |
1473
1501
  |--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1474
- | `WEB_BROWSER` | Must be set to `browserstack` |
1502
+ | `DRIVER` | Must be set to `browserstack` |
1475
1503
  | `BS_USERNAME` | Must be set to your BrowserStack account user name |
1476
1504
  | `BS_AUTHKEY` | Must be set to your BrowserStack account access key |
1477
1505
  | `BS_OS` | Must be set to `OS X` or `Windows` |
@@ -1505,7 +1533,7 @@ for information regarding the specific capabilities.
1505
1533
 
1506
1534
  | **Environment Variable** | **Description** |
1507
1535
  |--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1508
- | `WEB_BROWSER` | Must be set to `browserstack` |
1536
+ | `DRIVER` | Must be set to `browserstack` |
1509
1537
  | `BS_USERNAME` | Must be set to your BrowserStack account user name |
1510
1538
  | `BS_AUTHKEY` | Must be set to your BrowserStack account access key |
1511
1539
  | `BS_OS` | Must be set to `ios` or `android` |
@@ -1522,6 +1550,7 @@ for information regarding the specific capabilities.
1522
1550
  | `NETWORK_LOGS` | [Optional] Capture network logs (`true` or `false`) |
1523
1551
  | `APPIUM_LOGS` | [Optional] Generate Appium logs (`true` or `false`) |
1524
1552
 
1553
+
1525
1554
  #### Remote desktop browsers on the Sauce Labs service
1526
1555
 
1527
1556
  For remotely hosted desktop web browsers on the Sauce Labs service, the following **Environment Variables** must be set as described in the
@@ -1530,7 +1559,7 @@ to obtain information regarding the specific capabilities.
1530
1559
 
1531
1560
  | **Environment Variable** | **Description** |
1532
1561
  |--------------------------|----------------------------------------------------------------------------------------------------------------------------|
1533
- | `WEB_BROWSER` | Must be set to `saucelabs` |
1562
+ | `DRIVER` | Must be set to `saucelabs` |
1534
1563
  | `SL_USERNAME` | Must be set to your Sauce Labs account user name or email address |
1535
1564
  | `SL_AUTHKEY` | Must be set to your Sauce Labs account access key |
1536
1565
  | `DATA_CENTER` | Must be set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`) |
@@ -1541,6 +1570,7 @@ to obtain information regarding the specific capabilities.
1541
1570
  | `BROWSER_SIZE ` | [Optional] Specify width, height of browser window |
1542
1571
  | `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`) |
1543
1572
 
1573
+
1544
1574
  #### Remote desktop browsers on the TestingBot service
1545
1575
 
1546
1576
  For remotely hosted desktop web browsers on the TestingBot service, the following **Environment Variables** must be set as described in
@@ -1549,7 +1579,7 @@ regarding the specific capabilities.
1549
1579
 
1550
1580
  | **Environment Variable** | **Description** |
1551
1581
  |--------------------------|-------------------------------------------------------------------------------------------------------------------|
1552
- | `WEB_BROWSER` | Must be set to `testingbot` |
1582
+ | `DRIVER` | Must be set to `testingbot` |
1553
1583
  | `TB_USERNAME` | Must be set to your TestingBot account user name |
1554
1584
  | `TB_AUTHKEY` | Must be set to your TestingBot account access key |
1555
1585
  | `TB_OS` | Refer to `platform` capability in chart |
@@ -1559,6 +1589,7 @@ regarding the specific capabilities.
1559
1589
  | `RESOLUTION` | [Optional] Possible values: `800x600`, `1024x768`, `1280x960`, `1280x1024`, `1600x1200`, `1920x1200`, `2560x1440` |
1560
1590
  | `BROWSER_SIZE` | [Optional] Specify width, height of browser window |
1561
1591
 
1592
+
1562
1593
  #### Remote desktop browsers on the LambdaTest service
1563
1594
 
1564
1595
  For remotely hosted desktop web browsers on the LambdaTest service, the following **Environment Variables** must be set as described in the table
@@ -1567,7 +1598,7 @@ to obtain information regarding the specific capabilities.
1567
1598
 
1568
1599
  | **Environment Variable** | **Description** |
1569
1600
  |--------------------------|------------------------------------------------------------------------------------------|
1570
- | `WEB_BROWSER` | Must be set to `lambdatest` |
1601
+ | `DRIVER` | Must be set to `lambdatest` |
1571
1602
  | `LT_USERNAME` | Must be set to your LambdaTest account user name or email address |
1572
1603
  | `LT_AUTHKEY` | Must be set to your LambdaTest account access key |
1573
1604
  | `LT_OS` | Refer to `platformName` capability in the sample script of the Wizard |
@@ -1580,6 +1611,7 @@ to obtain information regarding the specific capabilities.
1580
1611
  | `ALLOW_COOKIES` | [Optional] Allow all cookies (`true` or `false`) - for Safari browsers only |
1581
1612
  | `CONSOLE_LOGS` | [Optional] Used to capture browser console logs. |
1582
1613
 
1614
+
1583
1615
  ### Using Browser specific Profiles in cucumber.yml
1584
1616
 
1585
1617
  While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and managing
@@ -1692,7 +1724,7 @@ that you intend to connect with.
1692
1724
  # NOTE: Requires installation of XCode, iOS version specific target simulators, Appium, and the appium_capybara gem
1693
1725
  #==============
1694
1726
 
1695
- appium_ios: WEB_BROWSER=appium AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="ios" APP_BROWSER="Safari" NEW_COMMAND_TIMEOUT=30 SHOW_SIM_KEYBOARD=false
1727
+ appium_ios: DRIVER=appium AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="ios" APP_BROWSER="Safari" NEW_COMMAND_TIMEOUT=30 SHOW_SIM_KEYBOARD=false
1696
1728
  app_ios_15: --profile appium_ios APP_VERSION="15.4"
1697
1729
  ipad_pro_12_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch) (5th generation)"
1698
1730
  ipad_air_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Air (5th generation)" <%= desktop %>
@@ -1713,16 +1745,18 @@ that you intend to connect with.
1713
1745
  # NOTE: Requires installation of Android Studio, Android version specific virtual device simulators, Appium, and the appium_capybara gem
1714
1746
  #==============
1715
1747
 
1716
- appium_android: WEB_BROWSER=appium APP_PLATFORM_NAME="Android" <%= mobile %>
1748
+ appium_android: DRIVER=appium APP_PLATFORM_NAME="Android" <%= mobile %>
1717
1749
  app_android_12: --profile appium_android APP_BROWSER="Chrome" APP_VERSION="12.0"
1718
1750
  pixel_c_api31_sim: --profile app_android_12 DEVICE_TYPE=tablet APP_DEVICE="Pixel_C_API_31"
1719
1751
 
1720
1752
 
1721
1753
  #==============
1722
1754
  # profiles for remotely hosted web browsers on the BrowserStack service
1755
+ # WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
1756
+ # to your version control system
1723
1757
  #==============
1724
1758
 
1725
- browserstack: WEB_BROWSER=browserstack BS_USERNAME="<INSERT USER NAME HERE>" BS_AUTHKEY="<INSERT PASSWORD HERE>"
1759
+ browserstack: DRIVER=browserstack BS_USERNAME="<INSERT USER NAME HERE>" BS_AUTHKEY="<INSERT PASSWORD HERE>"
1726
1760
  bs_desktop: --profile browserstack <%= desktop %> RESOLUTION="1920x1080"
1727
1761
  bs_mobile: --profile browserstack <%= mobile %>
1728
1762
 
@@ -1750,9 +1784,11 @@ that you intend to connect with.
1750
1784
 
1751
1785
  #==============
1752
1786
  # profiles for remotely hosted web browsers on the SauceLabs service
1787
+ # WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
1788
+ # to your version control system
1753
1789
  #==============
1754
1790
 
1755
- saucelabs: WEB_BROWSER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" DATA_CENTER="<INSERT DATA CENTER HERE"
1791
+ saucelabs: DRIVER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" DATA_CENTER="<INSERT DATA CENTER HERE"
1756
1792
  sl_desktop: --profile saucelabs <%= desktop %>
1757
1793
  sl_mobile: --profile saucelabs <%= mobile %>
1758
1794
 
@@ -1774,9 +1810,11 @@ that you intend to connect with.
1774
1810
 
1775
1811
  #==============
1776
1812
  # profiles for remotely hosted web browsers on the TestingBot service
1813
+ # WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
1814
+ # to your version control system
1777
1815
  #==============
1778
1816
 
1779
- testingbot: WEB_BROWSER=testingbot TB_USERNAME="<INSERT USER NAME HERE>" TB_AUTHKEY="<INSERT PASSWORD HERE>"
1817
+ testingbot: DRIVER=testingbot TB_USERNAME="<INSERT USER NAME HERE>" TB_AUTHKEY="<INSERT PASSWORD HERE>"
1780
1818
  tb_desktop: --profile testingbot <%= desktop %> RESOLUTION="1920x1200"
1781
1819
 
1782
1820
  # TestingBot macOS desktop browser profiles
@@ -1793,9 +1831,11 @@ that you intend to connect with.
1793
1831
 
1794
1832
  #==============
1795
1833
  # profiles for remotely hosted web browsers on the LambdaTest service
1834
+ # WARNING: Credentials should not be stored as text in your cucumber.yml file where it can be exposed by anyone with access
1835
+ # to your version control system
1796
1836
  #==============
1797
1837
 
1798
- lambdatest: WEB_BROWSER=lambdatest LT_USERNAME=<INSERT USER NAME HERE> LT_AUTHKEY=<INSERT PASSWORD HERE>
1838
+ lambdatest: DRIVER=lambdatest LT_USERNAME=<INSERT USER NAME HERE> LT_AUTHKEY=<INSERT PASSWORD HERE>
1799
1839
  lt_desktop: --profile lambdatest <%= desktop %> RESOLUTION="2560x1440"
1800
1840
 
1801
1841
  # LambdaTest macOS desktop browser profiles
@@ -1875,7 +1915,7 @@ area sub-folders as needed. Likewise, `PageSection` class definitions should be
1875
1915
 
1876
1916
  ## Web Test Automation Framework Implementation
1877
1917
 
1878
- <img src="https://i.imgur.com/eukmEan.jpg" alt="TestCentricity Web Framework Overview" title="TestCentricity Web Framework Overview">
1918
+ <img src="https://i.imgur.com/lCT9HbK.jpg" alt="TestCentricity Web Framework Overview" title="TestCentricity Web Framework Overview">
1879
1919
 
1880
1920
 
1881
1921
 
@@ -173,7 +173,8 @@ module TestCentricity
173
173
  @devices = @devices.merge(ext_devices)
174
174
  end
175
175
  end
176
- @devices[device.gsub(/\s+/, '').downcase.to_sym]
176
+ device = device.gsub(/\s+/, '').downcase.to_sym if device.is_a?(String)
177
+ @devices[device]
177
178
  end
178
179
  end
179
180
  end
@@ -415,4 +415,3 @@ module TestCentricity
415
415
  # :nocov:
416
416
  end
417
417
  end
418
-
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '4.1.9'
2
+ VERSION = '4.3.0'
3
3
  end
@@ -9,7 +9,7 @@ module TestCentricity
9
9
  attr_accessor :locator_type
10
10
 
11
11
  XPATH_SELECTORS = ['//', '[@', '[contains(']
12
- CSS_SELECTORS = ['#', ':nth-child(', ':first-child', ':last-child', ':nth-of-type(', ':first-of-type', ':last-of-type', '^=', '$=', '*=', ':contains(']
12
+ CSS_SELECTORS = %w[# :nth-child( :first-child :last-child :nth-of-type( :first-of-type :last-of-type ^= $= *= :contains(]
13
13
 
14
14
  def set_locator_type(locator = nil)
15
15
  locator = @locator if locator.nil?
@@ -139,6 +139,16 @@ module TestCentricity
139
139
  ui_object.ready_state
140
140
  when :volume
141
141
  ui_object.volume
142
+ when :track_count
143
+ ui_object.track_count
144
+ when :active_track
145
+ ui_object.active_track
146
+ when :active_track_data
147
+ ui_object.active_track_data
148
+ when :active_track_source
149
+ ui_object.active_track_source
150
+ when :all_tracks_data
151
+ ui_object.all_tracks_data
142
152
  when :crossorigin
143
153
  ui_object.crossorigin
144
154
  when :preload
@@ -181,6 +191,8 @@ module TestCentricity
181
191
  ui_object.aria_describedby
182
192
  when :aria_live
183
193
  ui_object.aria_live
194
+ when :aria_busy
195
+ ui_object.aria_busy?
184
196
  when :aria_selected
185
197
  ui_object.aria_selected?
186
198
  when :aria_hidden
@@ -231,6 +243,30 @@ module TestCentricity
231
243
  ui_object.aria_multiselectable?
232
244
  when :content_editable
233
245
  ui_object.content_editable?
246
+ when :validation_message
247
+ ui_object.validation_message
248
+ when :badInput
249
+ ui_object.validity?(:badInput)
250
+ when :customError
251
+ ui_object.validity?(:customError)
252
+ when :patternMismatch
253
+ ui_object.validity?(:patternMismatch)
254
+ when :rangeOverflow
255
+ ui_object.validity?(:rangeOverflow)
256
+ when :rangeUnderflow
257
+ ui_object.validity?(:rangeUnderflow)
258
+ when :stepMismatch
259
+ ui_object.validity?(:stepMismatch)
260
+ when :tooLong
261
+ ui_object.validity?(:tooLong)
262
+ when :tooShort
263
+ ui_object.validity?(:tooShort)
264
+ when :typeMismatch
265
+ ui_object.validity?(:typeMismatch)
266
+ when :valid
267
+ ui_object.validity?(:valid)
268
+ when :valueMissing
269
+ ui_object.validity?(:valueMissing)
234
270
  else
235
271
  if property.is_a?(Hash)
236
272
  property.map do |key, value|
@@ -353,8 +389,9 @@ module TestCentricity
353
389
  sleep(0.5)
354
390
  focused_obj = page.driver.browser.switch_to.active_element
355
391
  expected_obj, = expected_element.find_element(visible = :all)
356
- raise "Expected element '#{expected_element.get_name}' to have focus but found '#{focused_obj.id} is focused instead'" unless focused_obj == expected_obj.native
392
+ raise "Expected element '#{expected_element.get_name}' to have focus but found '#{focused_obj[:id]} is focused instead'" unless focused_obj == expected_obj.native
357
393
 
358
394
  puts "Element '#{expected_element.get_name}' is focused as expected"
359
- end end
395
+ end
396
+ end
360
397
  end