testcentricity_web 4.1.7 → 4.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.simplecov +5 -1
- data/CHANGELOG.md +12 -1
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/Rakefile +29 -3
- data/config/cucumber.yml +11 -4
- data/config/test_data/LOCAL_data.json +15 -0
- data/config/test_data/LOCAL_data.xls +0 -0
- data/config/test_data/LOCAL_data.yml +11 -0
- data/config/test_data/data.json +13 -0
- data/config/test_data/data.yml +12 -4
- data/features/basic_form_page_css.feature +39 -0
- data/features/basic_form_page_xpath.feature +26 -0
- data/features/media_players.feature +4 -7
- data/features/step_definitions/generic_steps.rb.rb +65 -0
- data/features/support/data/form_data.rb +43 -0
- data/features/support/env.rb +3 -3
- data/features/support/hooks.rb +21 -1
- data/features/support/pages/base_test_page.rb +11 -0
- data/features/support/pages/{basic_css_test_page.rb → basic_css_form_page.rb} +3 -3
- data/features/support/pages/{basic_test_page.rb → basic_form_page.rb} +120 -24
- data/features/support/pages/{basic_xpath_test_page.rb → basic_xpath_form_page.rb} +3 -3
- data/features/support/pages/custom_controls_page.rb +2 -5
- data/features/support/pages/indexed_sections_page.rb +2 -5
- data/features/support/pages/media_test_page.rb +27 -14
- data/features/support/sections/header_nav.rb +11 -0
- data/features/support/world_data.rb +1 -1
- data/features/support/world_pages.rb +2 -2
- data/lib/testcentricity_web/appium_server.rb +5 -0
- data/lib/testcentricity_web/data_objects/data_objects_helper.rb +7 -0
- data/lib/testcentricity_web/data_objects/environment.rb +2 -0
- data/lib/testcentricity_web/data_objects/excel_helper.rb +60 -59
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/drag_drop_helper.rb +4 -0
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +3 -1
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +16 -0
- data/lib/testcentricity_web/web_elements/file_field.rb +9 -5
- data/lib/testcentricity_web/web_elements/image.rb +2 -1
- data/lib/testcentricity_web/web_elements/media.rb +1 -13
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +20 -7
- data/lib/testcentricity_web/web_elements/video.rb +2 -2
- data/test_site/basic_test_page.html +1 -1
- data/test_site/media/count_and_bars.mp4 +0 -0
- data/test_site/media_page.html +2 -2
- metadata +18 -12
- data/features/basic_test_page_css.feature +0 -35
- data/features/basic_test_page_xpath.feature +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec1cf64d0d0e52b5d49ce5980dc049add4befecbc830650c4c908db5b2e07ac2
|
4
|
+
data.tar.gz: 841d00666f64914cf72d0f279e060c5ba31c1eb8a056020015a1430daf9c38a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e4e6f516c68a18689ccecfa7ee52ca97db9ffb8641c63d21641061e70ca4ac0f1b53d5191b02c6335ac1403e6bdf8afe0b0133d1204f2b87d4496d00a4c4fc1
|
7
|
+
data.tar.gz: c38230893848b6145e79e131f9e6a99867fa0a1d590d2b272a00709ee107b9a8044180c037cd1182cd6aa13d58c208e3ce154c2de08b66161a7c06ce02e0a8bc
|
data/.simplecov
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,23 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [4.1.8] - 31-MAR-2022
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* `Image.loaded?` now correctly returns a `Boolean` value instead of a `String`.
|
9
|
+
* `Video.video_height` and `Video.video_width` now correctly returns an `Integer` value instead of a `String`.
|
10
|
+
* `UIElement.scroll_to` now works for all supported browsers.
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
* `UIElement.crossorigin` is no longer limited to `Audio` and `Video` objects.
|
14
|
+
|
15
|
+
|
5
16
|
## [4.1.7] - 28-MAR-2022
|
6
17
|
|
7
18
|
### Fixed
|
8
19
|
* `CheckBox.set_checkbox_state` and `Radio.set_selected_state` work on iOS simulators again.
|
9
20
|
|
10
|
-
###
|
21
|
+
### Changed
|
11
22
|
* `Audio.playback_rate` and `Video.playback_rate` now return value as a `Float` instead of a `String`.
|
12
23
|
* `Audio.default_playback_rate` and `Video.default_playback_rate` now return value as a `Float` instead of a `String`.
|
13
24
|
* `Audio.current_time` and `Video.current_time` now return value as a `Float` rounded to two decimal places.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -505,6 +505,7 @@ With TestCentricity, all UI elements are based on the `UIElement` class, and inh
|
|
505
505
|
element.focused?
|
506
506
|
element.required?
|
507
507
|
element.content_editable?
|
508
|
+
element.crossorigin
|
508
509
|
element.get_value
|
509
510
|
element.count
|
510
511
|
element.style
|
@@ -629,6 +630,7 @@ The `verify_ui_states` method supports the following property/state pairs:
|
|
629
630
|
:visible Boolean
|
630
631
|
:hidden Boolean
|
631
632
|
:displayed Boolean
|
633
|
+
:obscured Boolean
|
632
634
|
:width Integer
|
633
635
|
:height Integer
|
634
636
|
:x Integer
|
@@ -639,6 +641,7 @@ The `verify_ui_states` method supports the following property/state pairs:
|
|
639
641
|
:style String
|
640
642
|
:tabindex Integer
|
641
643
|
:required Boolean
|
644
|
+
:crossorigin String
|
642
645
|
|
643
646
|
**Pages:**
|
644
647
|
|
@@ -715,7 +718,6 @@ The `verify_ui_states` method supports the following property/state pairs:
|
|
715
718
|
:playback_rate Float
|
716
719
|
:ready_state Integer
|
717
720
|
:volume Float
|
718
|
-
:crossorigin String
|
719
721
|
:preload String
|
720
722
|
:poster String
|
721
723
|
|
data/Rakefile
CHANGED
@@ -49,12 +49,38 @@ namespace :features do
|
|
49
49
|
t.profile = 'ios_remote'
|
50
50
|
end
|
51
51
|
|
52
|
+
Cucumber::Rake::Task.new(:emulated_mobile) do |t|
|
53
|
+
t.profile = 'ipad_pro_12_local'
|
54
|
+
end
|
55
|
+
|
52
56
|
|
53
|
-
task :required => [
|
57
|
+
task :required => [
|
58
|
+
:edge_local,
|
59
|
+
:edge_headless,
|
60
|
+
:chrome_local,
|
61
|
+
:chrome_headless,
|
62
|
+
:firefox_local,
|
63
|
+
:firefox_headless,
|
64
|
+
:safari_local,
|
65
|
+
:emulated_mobile,
|
66
|
+
]
|
54
67
|
|
55
|
-
task :grid => [:edge_grid, :chrome_grid]
|
68
|
+
task :grid => [:edge_grid, :chrome_grid, :firefox_grid]
|
56
69
|
|
57
70
|
task :mobile => [:ios_remote]
|
58
71
|
|
59
|
-
task :all => [
|
72
|
+
task :all => [
|
73
|
+
:edge_local,
|
74
|
+
:edge_headless,
|
75
|
+
:chrome_local,
|
76
|
+
:chrome_headless,
|
77
|
+
:firefox_local,
|
78
|
+
:firefox_headless,
|
79
|
+
:safari_local,
|
80
|
+
:edge_grid,
|
81
|
+
:chrome_grid,
|
82
|
+
:firefox_grid,
|
83
|
+
:emulated_mobile,
|
84
|
+
:ios_remote
|
85
|
+
]
|
60
86
|
end
|
data/config/cucumber.yml
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
<% desktop = "--require features BROWSER_TILE=true BROWSER_SIZE=1300,1000 --publish-quiet" %>
|
2
|
-
<%
|
3
|
-
<% mobile = "--tags @mobile --require features BROWSER_TILE=true --publish-quiet" %>
|
2
|
+
<% mobile = "--require features BROWSER_TILE=true --publish-quiet" %>
|
4
3
|
<% reports = "--require features --format pretty --format html --out reports/test_results.html --format junit --out reports --format json --out reports/test_results.json" %>
|
5
4
|
|
6
5
|
|
@@ -58,6 +57,14 @@ landscape: ORIENTATION=landscape
|
|
58
57
|
portrait: ORIENTATION=portrait
|
59
58
|
|
60
59
|
|
60
|
+
#==============
|
61
|
+
# profiles for locally hosted mobile web browsers (emulated locally in Chrome browser)
|
62
|
+
#==============
|
63
|
+
|
64
|
+
ipad_pro_11_local: --profile local WEB_BROWSER=ipad_pro_11 HOST_BROWSER=chrome --profile portrait <%= mobile %>
|
65
|
+
ipad_pro_12_local: --profile local WEB_BROWSER=ipad_pro_12_9 HOST_BROWSER=chrome --profile portrait <%= mobile %>
|
66
|
+
|
67
|
+
|
61
68
|
#==============
|
62
69
|
# profile to start Appium Server prior to running mobile browser tests on iOS or Android simulators or physical devices
|
63
70
|
#==============
|
@@ -69,7 +76,7 @@ run_appium: APPIUM_SERVER=run
|
|
69
76
|
# NOTE: Requires installation of XCode, iOS version specific target simulators, Appium, and the appium_capybara gem
|
70
77
|
#==============
|
71
78
|
|
72
|
-
appium_ios: WEB_BROWSER=appium AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="ios" APP_BROWSER="Safari" NEW_COMMAND_TIMEOUT=30 SHOW_SIM_KEYBOARD=false <%=
|
79
|
+
appium_ios: WEB_BROWSER=appium AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="ios" APP_BROWSER="Safari" NEW_COMMAND_TIMEOUT=30 SHOW_SIM_KEYBOARD=false <%= mobile %>
|
73
80
|
app_ios_15: --profile appium_ios APP_VERSION="15.4"
|
74
81
|
|
75
82
|
ipad_pro_12_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch) (5th generation)"
|
@@ -83,7 +90,7 @@ ios_remote: --profile ipad_pro_12_15_sim --profile run_appium ORIENTATION=portra
|
|
83
90
|
# NOTE: Requires installation of Android Studio, Android version specific virtual device simulators, Appium, and the appium_capybara gem
|
84
91
|
#==============
|
85
92
|
|
86
|
-
appium_android: WEB_BROWSER=appium APP_PLATFORM_NAME="Android" <%=
|
93
|
+
appium_android: WEB_BROWSER=appium APP_PLATFORM_NAME="Android" <%= mobile %>
|
87
94
|
app_android_12: --profile appium_android APP_BROWSER="Chrome" APP_VERSION="12.0"
|
88
95
|
pixel_c_api31_sim: --profile app_android_12 DEVICE_TYPE=tablet APP_DEVICE="Pixel_C_API_31"
|
89
96
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"Form_data": {
|
3
|
+
"primary": {
|
4
|
+
"username": "Thaddeus Eumbwebwe",
|
5
|
+
"password": "Pa55w0rd",
|
6
|
+
"image_filename": "Granny.jpg",
|
7
|
+
"multi_select": "Selection Item 3",
|
8
|
+
"drop_down_item": "Drop Down Item 3",
|
9
|
+
"check1": false,
|
10
|
+
"check2": true,
|
11
|
+
"check3": true,
|
12
|
+
"radio_select": 1
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
Binary file
|
data/config/test_data/data.json
CHANGED
@@ -8,5 +8,18 @@
|
|
8
8
|
"PROTOCOL": "http",
|
9
9
|
"BASE_URL": "192.168.1.129/test_site"
|
10
10
|
}
|
11
|
+
},
|
12
|
+
"Form_data": {
|
13
|
+
"primary": {
|
14
|
+
"username": "Thaddeus Eumbwebwe",
|
15
|
+
"password": "Pa55w0rd",
|
16
|
+
"image_filename": "Granny.jpg",
|
17
|
+
"multi_select": "Selection Item 3",
|
18
|
+
"drop_down_item": "Drop Down Item 3",
|
19
|
+
"check1": false,
|
20
|
+
"check2": true,
|
21
|
+
"check3": true,
|
22
|
+
"radio_select": 1
|
23
|
+
}
|
11
24
|
}
|
12
25
|
}
|
data/config/test_data/data.yml
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
# -------------------------------------------------------------
|
2
|
-
# This is the generic test data required to run the UAL Flight Booking test suites against the QA and PROD test environments.
|
3
|
-
# -------------------------------------------------------------
|
4
|
-
|
5
1
|
# This section is populated with Environment data required to execute automated test suites on all supported environments
|
6
2
|
Environments:
|
7
3
|
LOCAL:
|
@@ -10,3 +6,15 @@ Environments:
|
|
10
6
|
REMOTE:
|
11
7
|
PROTOCOL: "http"
|
12
8
|
BASE_URL: "192.168.1.129/test_site"
|
9
|
+
|
10
|
+
Form_data:
|
11
|
+
primary:
|
12
|
+
username: "Xavier Snicklefritz"
|
13
|
+
password: "Pa55W0rd"
|
14
|
+
image_filename: "Wilder.jpg"
|
15
|
+
multi_select: "Selection Item 1"
|
16
|
+
drop_down_item: "Drop Down Item 2"
|
17
|
+
check1: true
|
18
|
+
check2: true
|
19
|
+
check3: true
|
20
|
+
radio_select: 3
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Feature: Basic HTML Form Test Page using CSS locators
|
2
|
+
In order to ensure comprehensive support for HTML UI elements and forms
|
3
|
+
As a developer of the TestCentricity web gem
|
4
|
+
I expect to validate the interaction and verification capabilities of typical HTML form UI elements
|
5
|
+
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on the Basic CSS Form page
|
9
|
+
|
10
|
+
|
11
|
+
Scenario: Validate verify_ui_states method and associated object state verification methods
|
12
|
+
Then I expect the Basic CSS Form page to be correctly displayed
|
13
|
+
|
14
|
+
|
15
|
+
@!mobile @!firefox_headless
|
16
|
+
Scenario: Validate verify_focus_order method
|
17
|
+
Then I expect the tab order to be correct
|
18
|
+
|
19
|
+
|
20
|
+
Scenario: Validate populate_data_fields method and associated object action methods
|
21
|
+
When I populate the form fields
|
22
|
+
Then I expect the form fields to be correctly populated
|
23
|
+
When I cancel my changes
|
24
|
+
Then I expect the Basic CSS Form page to be correctly displayed
|
25
|
+
|
26
|
+
|
27
|
+
Scenario Outline: Verify functionality of navigation tabs and browser back/forward
|
28
|
+
When I click the <target_page> navigation tab
|
29
|
+
Then I expect the <target_page> page to be correctly displayed
|
30
|
+
When I navigate back
|
31
|
+
Then I should be on the Basic CSS Form page
|
32
|
+
When I navigate forward
|
33
|
+
Then I should be on the <target_page> page
|
34
|
+
|
35
|
+
Examples:
|
36
|
+
|target_page |
|
37
|
+
|Media Test |
|
38
|
+
|Indexed Sections |
|
39
|
+
|Custom Controls |
|
@@ -0,0 +1,26 @@
|
|
1
|
+
@!grid @!mobile @!headless
|
2
|
+
|
3
|
+
|
4
|
+
Feature: Basic HTML Form Test Page using Xpath locators
|
5
|
+
In order to ensure comprehensive support for HTML UI elements and forms
|
6
|
+
As a developer of the TestCentricity web gem
|
7
|
+
I expect to validate the interaction and verification capabilities of typical HTML form UI elements
|
8
|
+
|
9
|
+
|
10
|
+
Background:
|
11
|
+
Given I am on the Basic Xpath Form page
|
12
|
+
|
13
|
+
|
14
|
+
Scenario: Validate verify_ui_states method and associated object state verification methods
|
15
|
+
Then I expect the Basic Xpath Form page to be correctly displayed
|
16
|
+
|
17
|
+
|
18
|
+
Scenario: Validate verify_focus_order method
|
19
|
+
Then I expect the tab order to be correct
|
20
|
+
|
21
|
+
|
22
|
+
Scenario: Validate populate_data_fields method and associated object action methods
|
23
|
+
When I populate the form fields
|
24
|
+
Then I expect the form fields to be correctly populated
|
25
|
+
When I cancel my changes
|
26
|
+
Then I expect the Basic Xpath Form page to be correctly displayed
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
In order to xxx
|
6
|
-
As a xxxx
|
7
|
-
I expect to xxxx
|
1
|
+
Feature: HTML5 Audio/Video Test Page using CSS locators
|
2
|
+
In order to ensure comprehensive support for HTML5 Audio and Video media elements
|
3
|
+
As a developer of the TestCentricity web gem
|
4
|
+
I expect to validate the interaction and verification capabilities of media UI elements
|
8
5
|
|
9
6
|
|
10
7
|
Background:
|
@@ -42,3 +42,68 @@ When(/^I click the (.*) navigation (?:tab|link)$/) do |page_name|
|
|
42
42
|
target_page = PageManager.find_page(page_name)
|
43
43
|
target_page.navigate_to
|
44
44
|
end
|
45
|
+
|
46
|
+
|
47
|
+
Then(/^I should (?:see|be on) the (.*) page$/) do |page_name|
|
48
|
+
# find and verify that the specified target page is loaded
|
49
|
+
target_page = PageManager.find_page(page_name)
|
50
|
+
target_page.verify_page_exists
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
Then(/^I expect the (.*) page to be correctly displayed in a new browser tab$/) do |page_name|
|
55
|
+
Browsers.switch_to_new_browser_instance
|
56
|
+
Environ.set_external_page(true)
|
57
|
+
TestCentricity::WebDriverConnect.initialize_browser_size if Environ.headless
|
58
|
+
# find and verify that the specified target page is loaded
|
59
|
+
target_page = PageManager.find_page(page_name)
|
60
|
+
target_page.verify_page_exists
|
61
|
+
# verify that target page is correctly displayed
|
62
|
+
target_page.verify_page_ui
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
When(/^I (?:access|switch to) the new browser tab$/) do
|
67
|
+
Browsers.switch_to_new_browser_instance
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
When(/^I close the current browser window$/) do
|
72
|
+
Browsers.close_current_browser_window
|
73
|
+
# intercept and accept any JavaScript system or browser modals that may appear
|
74
|
+
begin
|
75
|
+
page.driver.browser.switch_to.alert.accept
|
76
|
+
switch_to_new_browser_instance
|
77
|
+
rescue
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
When(/^I close the previous browser window$/) do
|
83
|
+
Browsers.close_old_browser_instance
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
When(/^I refresh the current page$/) do
|
88
|
+
Browsers.refresh_browser unless Environ.driver == :appium
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
When(/^I navigate back$/) do
|
93
|
+
Browsers.navigate_back
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
When(/^I navigate forward$/) do
|
98
|
+
Browsers.navigate_forward
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
When(/^I delete all cookies$/) do
|
103
|
+
Browsers.delete_all_cookies
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
When(/^I set device orientation to (.*)$/) do |orientation|
|
108
|
+
Browsers.set_device_orientation(orientation.downcase.to_sym)
|
109
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class FormDataSource < TestCentricity::ExcelDataSource
|
2
|
+
def read_form_data
|
3
|
+
form_data = case ENV['DATA_SOURCE'].downcase.to_sym
|
4
|
+
when :excel
|
5
|
+
read_excel_row_data('Form_data', 'primary')
|
6
|
+
when :yaml, :json
|
7
|
+
environs.read('Form_data', 'primary')
|
8
|
+
else
|
9
|
+
raise "#{ENV['DATA_SOURCE']} is not a valid data source"
|
10
|
+
end
|
11
|
+
FormData.current = FormData.new(form_data)
|
12
|
+
end
|
13
|
+
|
14
|
+
def map_form_data(form_data)
|
15
|
+
FormData.current = FormData.new(form_data)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
class FormData < TestCentricity::DataPresenter
|
21
|
+
attribute :username, String
|
22
|
+
attribute :password, String
|
23
|
+
attribute :image_filename, String
|
24
|
+
attribute :multi_select, String
|
25
|
+
attribute :drop_down_item, String
|
26
|
+
attribute :check1, Boolean, default: false
|
27
|
+
attribute :check2, Boolean, default: false
|
28
|
+
attribute :check3, Boolean, default: false
|
29
|
+
attribute :radio_select, Integer
|
30
|
+
|
31
|
+
def initialize(data)
|
32
|
+
@username = data[:username]
|
33
|
+
@password = data[:password]
|
34
|
+
@image_filename = data[:image_filename]
|
35
|
+
@multi_select = data[:multi_select]
|
36
|
+
@drop_down_item = data[:drop_down_item]
|
37
|
+
@check1 = data[:check1]
|
38
|
+
@check2 = data[:check2]
|
39
|
+
@check3 = data[:check3]
|
40
|
+
@radio_select = data[:radio_select]
|
41
|
+
super
|
42
|
+
end
|
43
|
+
end
|
data/features/support/env.rb
CHANGED
@@ -9,10 +9,10 @@ include TestCentricity
|
|
9
9
|
|
10
10
|
SimpleCov.command_name("features-#{ENV['WEB_BROWSER']}-#{ENV['SELENIUM']}" + (ENV['TEST_ENV_NUMBER'] || ''))
|
11
11
|
|
12
|
-
|
12
|
+
require_relative 'world_data'
|
13
13
|
require_relative 'world_pages'
|
14
14
|
|
15
|
-
|
15
|
+
require_rel 'data'
|
16
16
|
require_rel 'sections'
|
17
17
|
require_rel 'pages'
|
18
18
|
|
@@ -32,7 +32,7 @@ Faker::Config.locale = ENV['LOCALE']
|
|
32
32
|
include WorldData
|
33
33
|
ENV['DATA_SOURCE'] = 'yaml' unless ENV['DATA_SOURCE']
|
34
34
|
environs.find_environ(ENV['TEST_ENVIRONMENT'], ENV['DATA_SOURCE'].downcase.to_sym)
|
35
|
-
|
35
|
+
WorldData.instantiate_data_objects
|
36
36
|
|
37
37
|
# instantiate all page objects
|
38
38
|
include WorldPages
|
data/features/support/hooks.rb
CHANGED
@@ -182,7 +182,27 @@ end
|
|
182
182
|
|
183
183
|
Around('@!mobile') do |scenario, block|
|
184
184
|
if Environ.platform == :mobile
|
185
|
-
log "Scenario '#{scenario.name}'
|
185
|
+
log "Scenario '#{scenario.name}' is not executed on mobile devices or simulators."
|
186
|
+
skip_this_scenario
|
187
|
+
else
|
188
|
+
block.call
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
|
193
|
+
Around('@!headless') do |scenario, block|
|
194
|
+
if Environ.headless
|
195
|
+
log "Scenario '#{scenario.name}' is not executed on headless browsers."
|
196
|
+
skip_this_scenario
|
197
|
+
else
|
198
|
+
block.call
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
|
203
|
+
Around('@!firefox_headless') do |scenario, block|
|
204
|
+
if Environ.browser == :firefox_headless
|
205
|
+
log "Scenario '#{scenario.name}' can not be executed on headless Firefox browsers."
|
186
206
|
skip_this_scenario
|
187
207
|
else
|
188
208
|
block.call
|
@@ -8,4 +8,15 @@ class BaseTestPage < TestCentricity::PageObject
|
|
8
8
|
def navigate_to
|
9
9
|
navigator
|
10
10
|
end
|
11
|
+
|
12
|
+
def verify_page_ui
|
13
|
+
# verify page title and header
|
14
|
+
ui = {
|
15
|
+
self => { exists: true, secure: false, title: page_title },
|
16
|
+
header_label => { visible: true, caption: page_title }
|
17
|
+
}
|
18
|
+
verify_ui_states(ui)
|
19
|
+
# verify header navigation bar
|
20
|
+
header_nav.verify_nav_bar
|
21
|
+
end
|
11
22
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# Page Object class definition for Basic HTML
|
1
|
+
# Page Object class definition for Basic HTML Form page with CSS locators
|
2
2
|
|
3
|
-
class
|
4
|
-
trait(:page_name) { 'Basic CSS
|
3
|
+
class BasicCSSFormPage < BasicFormPage
|
4
|
+
trait(:page_name) { 'Basic CSS Form' }
|
5
5
|
trait(:page_locator) { 'form#HTMLFormElements' }
|
6
6
|
|
7
7
|
# Basic HTML Test page UI elements
|