testcentricity_web 4.1.5 → 4.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +18 -0
- data/.simplecov +5 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +59 -1
- data/README.md +14 -6
- data/Rakefile +37 -1
- data/config/cucumber.yml +150 -0
- data/docker-compose-v3.yml +48 -0
- data/features/basic_test_page_css.feature +24 -0
- data/features/basic_test_page_xpath.feature +24 -0
- data/features/step_definitions/generic_steps.rb.rb +37 -0
- data/features/support/env.rb +43 -0
- data/features/support/hooks.rb +245 -0
- data/features/support/pages/basic_css_test_page.rb +49 -0
- data/features/support/pages/basic_test_page.rb +238 -0
- data/features/support/pages/basic_xpath_test_page.rb +49 -0
- data/features/support/pages/media_page.rb +11 -0
- data/features/support/world_pages.rb +15 -0
- data/lib/testcentricity_web/data_objects/environment.rb +4 -0
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_object.rb +13 -6
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +41 -8
- data/lib/testcentricity_web/web_core/page_section.rb +1 -16
- data/lib/testcentricity_web/web_elements/select_list.rb +11 -3
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +13 -0
- data/reports/.keep +1 -0
- data/test_site/basic_test_page.html +240 -0
- data/test_site/images/Granny.jpg +0 -0
- data/test_site/images/Wilder.jpg +0 -0
- data/test_site/images/You_Betcha.jpg +0 -0
- data/test_site/media/MP4_small.mp4 +0 -0
- data/test_site/media/MPS_sample.mp3 +0 -0
- data/test_site/media_page.html +33 -0
- data/testcentricity_web.gemspec +5 -0
- metadata +104 -4
- data/test_site/test_page.html +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ea25aaf7cff4f07b966b6cac829a2cd6ad3234403e3a01257ff6dd07beaf38
|
4
|
+
data.tar.gz: 20082c59c2d9f7c5e69959500b4bc97e10f1dc93309f1ec601acdf7b0cf8d29c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40ccfaa119abc07f1bb3254cf05e2c3b5d28548b92c65da43faabc3b524af4b074973767e79da7901de09a609ee95af65e3525ea60b49dd3676b88a6956e7478
|
7
|
+
data.tar.gz: 1959d24e265fdbb21e088f4192b0de5a86f227d22b0b73870a0ab2ed12430d2b898718d2fcbb4b4330f8ec689bef770d09b3cefa39ec0a0cb75b8ab624078abb
|
data/.gitignore
CHANGED
@@ -18,3 +18,21 @@ Thumbs.db
|
|
18
18
|
|
19
19
|
# rspec failure tracking
|
20
20
|
.rspec_status
|
21
|
+
|
22
|
+
# Ignore test-reports
|
23
|
+
reports/*.html
|
24
|
+
reports/*.xml
|
25
|
+
reports/*.json
|
26
|
+
reports/screenshots/
|
27
|
+
test-reports
|
28
|
+
capybara-*.html
|
29
|
+
debug.log
|
30
|
+
|
31
|
+
BrowserStackLocal
|
32
|
+
cbttunnel.jar
|
33
|
+
|
34
|
+
/.yardoc/
|
35
|
+
/local.log
|
36
|
+
.run/*.xml
|
37
|
+
|
38
|
+
echo coverage >> .gitignore
|
data/.simplecov
ADDED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [4.1.6] - 21-MAR-2022
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* `PageObject.verify_page_exists` now works with `page_locator` traits expressed in Xpath format, and no longer fails with a
|
9
|
+
`invalid selector: An invalid or illegal selector was specified - Selenium::WebDriver::Error::InvalidSelectorError` error.
|
10
|
+
|
11
|
+
### Added
|
12
|
+
* `UIElement.required?` method added.
|
13
|
+
* `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods now work with the following:
|
14
|
+
* `input(type='color')` color picker controls if they are specified as a `textfield` type element.
|
15
|
+
* `input(type='range')` slider controls if they are specified as a `range` type element.
|
16
|
+
* `input(type='file')` file upload controls if they are specified as a `filefield` type element.
|
17
|
+
|
18
|
+
|
5
19
|
## [4.1.5] - 15-MAR-2022
|
6
20
|
|
7
21
|
### Fixed
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
testcentricity_web (4.1.
|
4
|
+
testcentricity_web (4.1.6)
|
5
5
|
appium_lib
|
6
6
|
browserstack-local
|
7
7
|
capybara (>= 3.1, < 4)
|
@@ -21,6 +21,9 @@ GEM
|
|
21
21
|
specs:
|
22
22
|
addressable (2.8.0)
|
23
23
|
public_suffix (>= 2.0.2, < 5.0)
|
24
|
+
appium_capybara (2.0.0)
|
25
|
+
appium_lib (~> 12.0.0)
|
26
|
+
capybara (~> 3.36)
|
24
27
|
appium_lib (12.0.0)
|
25
28
|
appium_lib_core (~> 5.0.0)
|
26
29
|
nokogiri (~> 1.8, >= 1.8.1)
|
@@ -33,6 +36,7 @@ GEM
|
|
33
36
|
ice_nine (~> 0.11.0)
|
34
37
|
thread_safe (~> 0.3, >= 0.3.1)
|
35
38
|
browserstack-local (1.3.0)
|
39
|
+
builder (3.2.4)
|
36
40
|
capybara (3.36.0)
|
37
41
|
addressable
|
38
42
|
matrix
|
@@ -47,22 +51,62 @@ GEM
|
|
47
51
|
coercible (1.0.0)
|
48
52
|
descendants_tracker (~> 0.0.1)
|
49
53
|
concurrent-ruby (1.1.9)
|
54
|
+
cucumber (7.1.0)
|
55
|
+
builder (~> 3.2, >= 3.2.4)
|
56
|
+
cucumber-core (~> 10.1, >= 10.1.0)
|
57
|
+
cucumber-create-meta (~> 6.0, >= 6.0.1)
|
58
|
+
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
|
59
|
+
cucumber-gherkin (~> 22.0, >= 22.0.0)
|
60
|
+
cucumber-html-formatter (~> 17.0, >= 17.0.0)
|
61
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
62
|
+
cucumber-wire (~> 6.2, >= 6.2.0)
|
63
|
+
diff-lcs (~> 1.4, >= 1.4.4)
|
64
|
+
mime-types (~> 3.3, >= 3.3.1)
|
65
|
+
multi_test (~> 0.1, >= 0.1.2)
|
66
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
67
|
+
cucumber-core (10.1.1)
|
68
|
+
cucumber-gherkin (~> 22.0, >= 22.0.0)
|
69
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
70
|
+
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
|
71
|
+
cucumber-create-meta (6.0.4)
|
72
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
73
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
74
|
+
cucumber-cucumber-expressions (14.0.0)
|
75
|
+
cucumber-gherkin (22.0.0)
|
76
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
77
|
+
cucumber-html-formatter (17.0.0)
|
78
|
+
cucumber-messages (~> 17.1, >= 17.1.0)
|
79
|
+
cucumber-messages (17.1.1)
|
80
|
+
cucumber-tag-expressions (4.1.0)
|
81
|
+
cucumber-wire (6.2.1)
|
82
|
+
cucumber-core (~> 10.1, >= 10.1.0)
|
83
|
+
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
|
50
84
|
descendants_tracker (0.0.4)
|
51
85
|
thread_safe (~> 0.3, >= 0.3.1)
|
86
|
+
diff-lcs (1.5.0)
|
87
|
+
docile (1.4.0)
|
52
88
|
eventmachine (1.2.7)
|
53
89
|
faker (2.20.0)
|
54
90
|
i18n (>= 1.8.11, < 2)
|
55
91
|
faye-websocket (0.11.1)
|
56
92
|
eventmachine (>= 0.12.0)
|
57
93
|
websocket-driver (>= 0.5.1)
|
94
|
+
ffi (1.15.5)
|
58
95
|
i18n (1.10.0)
|
59
96
|
concurrent-ruby (~> 1.0)
|
60
97
|
ice_nine (0.11.2)
|
61
98
|
matrix (0.4.2)
|
99
|
+
mime-types (3.4.1)
|
100
|
+
mime-types-data (~> 3.2015)
|
101
|
+
mime-types-data (3.2022.0105)
|
62
102
|
mini_mime (1.1.2)
|
103
|
+
multi_test (0.1.2)
|
63
104
|
nokogiri (1.13.3-x86_64-darwin)
|
64
105
|
racc (~> 1.4)
|
65
106
|
os (1.1.4)
|
107
|
+
parallel (1.21.0)
|
108
|
+
parallel_tests (3.7.3)
|
109
|
+
parallel
|
66
110
|
power_assert (2.0.1)
|
67
111
|
public_suffix (4.0.6)
|
68
112
|
racc (1.6.0)
|
@@ -72,6 +116,7 @@ GEM
|
|
72
116
|
rake (13.0.6)
|
73
117
|
redcarpet (3.5.1)
|
74
118
|
regexp_parser (2.2.1)
|
119
|
+
require_all (1.5.0)
|
75
120
|
rexml (3.2.5)
|
76
121
|
ruby-ole (1.2.12.2)
|
77
122
|
rubyzip (2.3.2)
|
@@ -79,8 +124,16 @@ GEM
|
|
79
124
|
childprocess (>= 0.5, < 5.0)
|
80
125
|
rexml (~> 3.2, >= 3.2.5)
|
81
126
|
rubyzip (>= 1.2.2)
|
127
|
+
simplecov (0.21.2)
|
128
|
+
docile (~> 1.1)
|
129
|
+
simplecov-html (~> 0.11)
|
130
|
+
simplecov_json_formatter (~> 0.1)
|
131
|
+
simplecov-html (0.12.3)
|
132
|
+
simplecov_json_formatter (0.1.4)
|
82
133
|
spreadsheet (1.1.7)
|
83
134
|
ruby-ole (>= 1.0)
|
135
|
+
sys-uname (1.2.2)
|
136
|
+
ffi (~> 1.1)
|
84
137
|
test-unit (3.5.3)
|
85
138
|
power_assert
|
86
139
|
thread_safe (0.3.6)
|
@@ -103,9 +156,14 @@ PLATFORMS
|
|
103
156
|
x86_64-darwin-21
|
104
157
|
|
105
158
|
DEPENDENCIES
|
159
|
+
appium_capybara
|
106
160
|
bundler
|
161
|
+
cucumber
|
162
|
+
parallel_tests
|
107
163
|
rake
|
108
164
|
redcarpet
|
165
|
+
require_all
|
166
|
+
simplecov (~> 0.18)
|
109
167
|
testcentricity_web!
|
110
168
|
|
111
169
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -239,7 +239,7 @@ the UI to hide implementation details, as shown below:
|
|
239
239
|
remember_checkbox => { exists: true, enabled: true, checked: false },
|
240
240
|
forgot_password_link => { visible: true, caption: 'Forgot your password?' },
|
241
241
|
error_message_label => { visible: false }
|
242
|
-
|
242
|
+
}
|
243
243
|
verify_ui_states(ui)
|
244
244
|
end
|
245
245
|
end
|
@@ -282,7 +282,7 @@ the UI to hide implementation details, as shown below:
|
|
282
282
|
password_field => profile.password,
|
283
283
|
pword_confirm_field => profile.confirm_password,
|
284
284
|
email_opt_in_check => profile.email_opt_in
|
285
|
-
|
285
|
+
}
|
286
286
|
populate_data_fields(fields)
|
287
287
|
sign_up_button.click
|
288
288
|
end
|
@@ -503,6 +503,7 @@ With TestCentricity, all UI elements are based on the `UIElement` class, and inh
|
|
503
503
|
element.displayed?
|
504
504
|
element.obscured?
|
505
505
|
element.focused?
|
506
|
+
element.required?
|
506
507
|
element.content_editable?
|
507
508
|
element.get_value
|
508
509
|
element.count
|
@@ -569,9 +570,10 @@ interacted with.
|
|
569
570
|
|
570
571
|
The `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods support the entry of test data into a collection of
|
571
572
|
`UIElements`. The `populate_data_fields` method accepts a hash containing key/hash pairs of `UIElements` and their associated data to be
|
572
|
-
entered. Data values must be in the form of a `String` for `textfield` and `
|
573
|
-
must either be a `Boolean` or a `String` that evaluates to a `Boolean` value (Yes, No, 1, 0, true, false). For `
|
574
|
-
must be
|
573
|
+
entered. Data values must be in the form of a `String` for `textfield`, `selectlist`, and `filefield` controls. For `checkbox` and `radio`
|
574
|
+
controls, data must either be a `Boolean` or a `String` that evaluates to a `Boolean` value (Yes, No, 1, 0, true, false). For `range` controls,
|
575
|
+
data must be an `Integer`. For `input(type='color')` color picker controls, which are specified as a `textfield`, data must be in the form
|
576
|
+
of a hex color `String`. For `section` objects, data values must be a `String`, and the `section` object must have a `set` method defined.
|
575
577
|
|
576
578
|
The `populate_data_fields` method verifies that data attributes associated with each `UIElement` is not `nil` or `empty` before attempting to
|
577
579
|
enter data into the `UIElement`.
|
@@ -636,6 +638,12 @@ The `verify_ui_states` method supports the following property/state pairs:
|
|
636
638
|
:attribute Hash
|
637
639
|
:style String
|
638
640
|
:tabindex Integer
|
641
|
+
:required Boolean
|
642
|
+
|
643
|
+
**Pages:**
|
644
|
+
|
645
|
+
:secure Boolean
|
646
|
+
:title String
|
639
647
|
|
640
648
|
**Text Fields:**
|
641
649
|
|
@@ -1820,7 +1828,7 @@ in landscape orientation:
|
|
1820
1828
|
cucumber -p ipad_pro -p landscape
|
1821
1829
|
|
1822
1830
|
|
1823
|
-
The following command specifies that Cucumber will run tests against an iPad Pro (12.9-inch) (5th generation) with iOS version 15.
|
1831
|
+
The following command specifies that Cucumber will run tests against an iPad Pro (12.9-inch) (5th generation) with iOS version 15.4 in an
|
1824
1832
|
XCode Simulator in landscape orientation:
|
1825
1833
|
|
1826
1834
|
cucumber -p ipad_pro_12_15_sim -p landscape
|
data/Rakefile
CHANGED
@@ -1 +1,37 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems'
|
2
|
+
require 'cucumber'
|
3
|
+
require 'cucumber/rake/task'
|
4
|
+
require 'rake'
|
5
|
+
|
6
|
+
|
7
|
+
namespace :features do
|
8
|
+
Cucumber::Rake::Task.new(:edge) do |t|
|
9
|
+
t.profile = 'edge'
|
10
|
+
end
|
11
|
+
|
12
|
+
Cucumber::Rake::Task.new(:chrome) do |t|
|
13
|
+
t.profile = 'chrome'
|
14
|
+
end
|
15
|
+
|
16
|
+
Cucumber::Rake::Task.new(:edge_headless) do |t|
|
17
|
+
t.profile = 'edge_headless'
|
18
|
+
end
|
19
|
+
|
20
|
+
Cucumber::Rake::Task.new(:chrome_headless) do |t|
|
21
|
+
t.profile = 'chrome_headless'
|
22
|
+
end
|
23
|
+
|
24
|
+
Cucumber::Rake::Task.new(:safari) do |t|
|
25
|
+
t.profile = 'safari'
|
26
|
+
end
|
27
|
+
|
28
|
+
Cucumber::Rake::Task.new(:firefox) do |t|
|
29
|
+
t.profile = 'firefox'
|
30
|
+
end
|
31
|
+
|
32
|
+
Cucumber::Rake::Task.new(:firefox_headless) do |t|
|
33
|
+
t.profile = 'firefox_headless'
|
34
|
+
end
|
35
|
+
|
36
|
+
task :all => [:edge, :edge_headless, :chrome, :chrome_headless, :safari]
|
37
|
+
end
|
data/config/cucumber.yml
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
<% desktop = "--require features BROWSER_TILE=true BROWSER_SIZE=1300,1000 --publish-quiet" %>
|
2
|
+
<% tablet = "--tags @desktop --require features BROWSER_TILE=true --publish-quiet" %>
|
3
|
+
<% mobile = "--tags @mobile --require features BROWSER_TILE=true --publish-quiet" %>
|
4
|
+
<% reports = "--require features --format pretty --format html --out reports/test_results.html --format junit --out reports --format json --out reports/test_results.json" %>
|
5
|
+
|
6
|
+
|
7
|
+
#==============
|
8
|
+
# generic test context profiles
|
9
|
+
#==============
|
10
|
+
|
11
|
+
failing: --tags '@failing and not @wip'
|
12
|
+
wip: --tags '@wip and not @failing'
|
13
|
+
dev: --tags '@dev and (not @wip and not @failing)'
|
14
|
+
|
15
|
+
|
16
|
+
#==============
|
17
|
+
# test reporting profiles
|
18
|
+
#==============
|
19
|
+
|
20
|
+
report: <%= reports %> REPORTING=true
|
21
|
+
parallel: PARALLEL=true REPORTING=true --require features --format pretty --format html --out reports/test_results<%= ENV['TEST_ENV_NUMBER'] %>.html --format junit --out reports --format json --out reports/test_results<%= ENV['TEST_ENV_NUMBER'] %>.json
|
22
|
+
|
23
|
+
|
24
|
+
#==============
|
25
|
+
# profiles for locally hosted desktop web browsers
|
26
|
+
#==============
|
27
|
+
|
28
|
+
chrome: WEB_BROWSER=chrome <%= desktop %>
|
29
|
+
firefox: WEB_BROWSER=firefox <%= desktop %>
|
30
|
+
edge: WEB_BROWSER=edge <%= desktop %>
|
31
|
+
safari: WEB_BROWSER=safari <%= desktop %>
|
32
|
+
|
33
|
+
firefox_headless: WEB_BROWSER=firefox_headless <%= desktop %>
|
34
|
+
chrome_headless: WEB_BROWSER=chrome_headless <%= desktop %>
|
35
|
+
edge_headless: WEB_BROWSER=edge_headless <%= desktop %>
|
36
|
+
|
37
|
+
|
38
|
+
#==============
|
39
|
+
# profile for Selenium Grid and Dockerized Selenium Grid hosted desktop web browsers
|
40
|
+
#==============
|
41
|
+
grid: SELENIUM=remote REMOTE_ENDPOINT="http://localhost:4444/wd/hub"
|
42
|
+
|
43
|
+
|
44
|
+
#==============
|
45
|
+
# profiles for mobile device screen orientation
|
46
|
+
#==============
|
47
|
+
|
48
|
+
landscape: ORIENTATION=landscape
|
49
|
+
portrait: ORIENTATION=portrait
|
50
|
+
|
51
|
+
|
52
|
+
#==============
|
53
|
+
# profile to start Appium Server prior to running mobile browser tests on iOS or Android simulators or physical devices
|
54
|
+
#==============
|
55
|
+
run_appium: APPIUM_SERVER=run
|
56
|
+
|
57
|
+
|
58
|
+
#==============
|
59
|
+
# profiles for mobile Safari web browsers hosted within XCode iOS simulators
|
60
|
+
# NOTE: Requires installation of XCode, iOS version specific target simulators, Appium, and the appium_capybara gem
|
61
|
+
#==============
|
62
|
+
|
63
|
+
appium_ios: WEB_BROWSER=appium AUTOMATION_ENGINE=XCUITest APP_PLATFORM_NAME="ios" APP_BROWSER="Safari" NEW_COMMAND_TIMEOUT=30 SHOW_SIM_KEYBOARD=false <%= desktop %>
|
64
|
+
app_ios_15: --profile appium_ios APP_VERSION="15.4"
|
65
|
+
|
66
|
+
ipad_pro_12_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch) (5th generation)"
|
67
|
+
ipad_air_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Air (5th generation)" <%= desktop %>
|
68
|
+
|
69
|
+
|
70
|
+
#==============
|
71
|
+
# profiles for Android mobile web browsers hosted within Android Studio Android Virtual Device emulators
|
72
|
+
# NOTE: Requires installation of Android Studio, Android version specific virtual device simulators, Appium, and the appium_capybara gem
|
73
|
+
#==============
|
74
|
+
|
75
|
+
appium_android: WEB_BROWSER=appium APP_PLATFORM_NAME="Android" <%= desktop %>
|
76
|
+
app_android_12: --profile appium_android APP_BROWSER="Chrome" APP_VERSION="12.0"
|
77
|
+
pixel_c_api31_sim: --profile app_android_12 DEVICE_TYPE=tablet APP_DEVICE="Pixel_C_API_31"
|
78
|
+
|
79
|
+
|
80
|
+
#==============
|
81
|
+
# profiles for remotely hosted web browsers on the BrowserStack service
|
82
|
+
#==============
|
83
|
+
|
84
|
+
browserstack: WEB_BROWSER=browserstack BS_USERNAME="<INSERT USER NAME HERE>" BS_AUTHKEY="<INSERT PASSWORD HERE>" AUTOMATE_PROJECT="TC_Web_Sample - BrowserStack"
|
85
|
+
bs_desktop: --profile browserstack <%= desktop %> RESOLUTION="1920x1080"
|
86
|
+
bs_mobile: --profile browserstack <%= mobile %>
|
87
|
+
|
88
|
+
# BrowserStack macOS desktop browser profiles
|
89
|
+
bs_macos_monterey: --profile bs_desktop BS_OS="OS X" BS_OS_VERSION="Monterey"
|
90
|
+
bs_chrome_monterey: --profile bs_macos_monterey BS_BROWSER="Chrome" BS_VERSION="latest"
|
91
|
+
bs_edge_monterey: --profile bs_macos_monterey BS_BROWSER="Edge" BS_VERSION="latest"
|
92
|
+
bs_safari_monterey: --profile bs_macos_monterey BS_BROWSER="Safari" BS_VERSION="latest"
|
93
|
+
|
94
|
+
# BrowserStack iOS mobile browser profiles
|
95
|
+
bs_ipad: --profile bs_mobile BS_OS=ios BS_BROWSER=Safari DEVICE_TYPE=tablet BS_REAL_MOBILE="true"
|
96
|
+
bs_ipad_pro_12: --profile bs_ipad BS_DEVICE="iPad Pro 12.9 2018" BS_OS_VERSION="15"
|
97
|
+
|
98
|
+
# BrowserStack Android mobile browser profiles
|
99
|
+
bs_android: --profile bs_mobile BS_OS=android BS_BROWSER=Chrome DEVICE_TYPE=tablet BS_REAL_MOBILE="true"
|
100
|
+
bs_android_tablet: --profile bs_android BS_DEVICE="Samsung Galaxy Tab S7" BS_OS_VERSION="10.0"
|
101
|
+
|
102
|
+
|
103
|
+
#==============
|
104
|
+
# profiles for remotely hosted web browsers on the LambdaTest service
|
105
|
+
#==============
|
106
|
+
|
107
|
+
lambdatest: WEB_BROWSER=lambdatest LT_USERNAME="<INSERT USER NAME HERE>" LT_AUTHKEY="<INSERT PASSWORD HERE>" AUTOMATE_PROJECT="TC_Web_Sample - LambdaTest"
|
108
|
+
lt_desktop: --profile lambdatest <%= desktop %> RESOLUTION="2560x1440"
|
109
|
+
|
110
|
+
# LambdaTest macOS desktop browser profiles
|
111
|
+
lt_macos_monterey: --profile lt_desktop LT_OS="MacOS Monterey"
|
112
|
+
lt_chrome_monterey: --profile lt_macos_monterey LT_BROWSER="Chrome" LT_VERSION="98.0"
|
113
|
+
lt_edge_monterey: --profile lt_macos_monterey LT_BROWSER="MicrosoftEdge" LT_VERSION="97.0"
|
114
|
+
|
115
|
+
|
116
|
+
#==============
|
117
|
+
# profiles for remotely hosted web browsers on the TestingBot service
|
118
|
+
#==============
|
119
|
+
|
120
|
+
testingbot: WEB_BROWSER=testingbot TB_USERNAME="<INSERT USER NAME HERE>" TB_AUTHKEY="<INSERT PASSWORD HERE>" AUTOMATE_PROJECT="TC_Web_Sample - TestingBot"
|
121
|
+
tb_desktop: --profile testingbot <%= desktop %> RESOLUTION="1920x1200"
|
122
|
+
|
123
|
+
# TestingBot macOS desktop browser profiles
|
124
|
+
tb_macos_monterey: --profile tb_desktop TB_OS="MONTEREY"
|
125
|
+
tb_chrome_monterey: --profile tb_macos_monterey TB_BROWSER="chrome" TB_VERSION="latest"
|
126
|
+
tb_edge_monterey: --profile tb_macos_monterey TB_BROWSER="microsoftedge" TB_VERSION="latest"
|
127
|
+
|
128
|
+
|
129
|
+
#==============
|
130
|
+
# profiles for remotely hosted web browsers on the SauceLabs service
|
131
|
+
#==============
|
132
|
+
|
133
|
+
saucelabs: WEB_BROWSER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" DATA_CENTER="us-west-1" AUTOMATE_PROJECT="TC_Web_Sample - SauceLabs"
|
134
|
+
sl_desktop: --profile saucelabs <%= desktop %>
|
135
|
+
sl_mobile: --profile saucelabs <%= mobile %>
|
136
|
+
|
137
|
+
# SauceLabs macOS desktop browser profiles
|
138
|
+
sl_macos_monterey: --profile sl_desktop SL_OS="macOS 12" RESOLUTION="1920x1440"
|
139
|
+
sl_chrome_monterey: --profile sl_macos_monterey SL_BROWSER="chrome" SL_VERSION="latest"
|
140
|
+
sl_edge_monterey: --profile sl_macos_monterey SL_BROWSER="MicrosoftEdge" SL_VERSION="latest"
|
141
|
+
sl_firefox_monterey: --profile sl_macos_monterey SL_BROWSER="Firefox" SL_VERSION="latest"
|
142
|
+
|
143
|
+
# SauceLabs Windows desktop browser profiles
|
144
|
+
sl_windows: --profile sl_desktop RESOLUTION="1920x1200"
|
145
|
+
sl_edge_win11: --profile sl_windows SL_OS="Windows 11" SL_BROWSER="MicrosoftEdge" SL_VERSION="latest"
|
146
|
+
sl_ie_win10: --profile sl_windows SL_OS="Windows 10" SL_BROWSER="internet explorer" SL_VERSION="11"
|
147
|
+
|
148
|
+
# SauceLabs iOS mobile browser profiles
|
149
|
+
sl_ipad: --profile sl_mobile DEVICE_TYPE=tablet SL_PLATFORM=iOS SL_BROWSER=Safari
|
150
|
+
sl_ipad_pro_12: --profile sl_ipad SL_DEVICE="iPad Pro (12.9 inch) (5th generation) Simulator" SL_VERSION="15.0"
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3.yml up`
|
2
|
+
# Add the `-d` flag at the end for detached execution
|
3
|
+
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3.yml down`
|
4
|
+
version: "3"
|
5
|
+
services:
|
6
|
+
chrome:
|
7
|
+
image: selenium/node-chrome:4.1.2-20220217
|
8
|
+
shm_size: 2gb
|
9
|
+
depends_on:
|
10
|
+
- selenium-hub
|
11
|
+
environment:
|
12
|
+
- SE_EVENT_BUS_HOST=selenium-hub
|
13
|
+
- SE_EVENT_BUS_PUBLISH_PORT=4442
|
14
|
+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
|
15
|
+
- SE_NODE_MAX_SESSIONS=4
|
16
|
+
- SE_NODE_OVERRIDE_MAX_SESSIONS=true
|
17
|
+
|
18
|
+
edge:
|
19
|
+
image: selenium/node-edge:4.1.2-20220217
|
20
|
+
shm_size: 2gb
|
21
|
+
depends_on:
|
22
|
+
- selenium-hub
|
23
|
+
environment:
|
24
|
+
- SE_EVENT_BUS_HOST=selenium-hub
|
25
|
+
- SE_EVENT_BUS_PUBLISH_PORT=4442
|
26
|
+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
|
27
|
+
- SE_NODE_MAX_SESSIONS=4
|
28
|
+
- SE_NODE_OVERRIDE_MAX_SESSIONS=true
|
29
|
+
|
30
|
+
firefox:
|
31
|
+
image: selenium/node-firefox:4.1.2-20220217
|
32
|
+
shm_size: 2gb
|
33
|
+
depends_on:
|
34
|
+
- selenium-hub
|
35
|
+
environment:
|
36
|
+
- SE_EVENT_BUS_HOST=selenium-hub
|
37
|
+
- SE_EVENT_BUS_PUBLISH_PORT=4442
|
38
|
+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
|
39
|
+
- SE_NODE_MAX_SESSIONS=4
|
40
|
+
- SE_NODE_OVERRIDE_MAX_SESSIONS=true
|
41
|
+
|
42
|
+
selenium-hub:
|
43
|
+
image: selenium/hub:4.1.2-20220217
|
44
|
+
container_name: selenium-hub
|
45
|
+
ports:
|
46
|
+
- "4442:4442"
|
47
|
+
- "4443:4443"
|
48
|
+
- "4444:4444"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Basic HTML Test Page using CSS locators
|
2
|
+
In order to xxx
|
3
|
+
As a xxxx
|
4
|
+
I expect to xxxx
|
5
|
+
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on the Basic CSS Test page
|
9
|
+
|
10
|
+
|
11
|
+
Scenario: xxxxx
|
12
|
+
Then I expect the Basic CSS Test page to be correctly displayed
|
13
|
+
|
14
|
+
|
15
|
+
@!mobile
|
16
|
+
Scenario: xxxxx
|
17
|
+
Then I expect the tab order to be correct
|
18
|
+
|
19
|
+
|
20
|
+
Scenario: xxxxx
|
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 Test page to be correctly displayed
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Basic HTML Test Page using Xpath locators
|
2
|
+
In order to xxx
|
3
|
+
As a xxxx
|
4
|
+
I expect to xxxx
|
5
|
+
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on the Basic Xpath Test page
|
9
|
+
|
10
|
+
|
11
|
+
Scenario: xxxxx
|
12
|
+
Then I expect the Basic Xpath Test page to be correctly displayed
|
13
|
+
|
14
|
+
|
15
|
+
@!mobile
|
16
|
+
Scenario: xxxxx
|
17
|
+
Then I expect the tab order to be correct
|
18
|
+
|
19
|
+
|
20
|
+
Scenario: xxxxx
|
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 Xpath Test page to be correctly displayed
|
@@ -0,0 +1,37 @@
|
|
1
|
+
include TestCentricity
|
2
|
+
|
3
|
+
|
4
|
+
Given(/^I am (?:on|viewing) the (.*) page$/) do |page_name|
|
5
|
+
# find and load the specified target page
|
6
|
+
target_page = PageManager.find_page(page_name)
|
7
|
+
target_page.load_page
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
Then(/^I expect the (.*) page to be correctly displayed$/) do |page_name|
|
12
|
+
# find and verify that the specified target page is loaded
|
13
|
+
target_page = PageManager.find_page(page_name)
|
14
|
+
target_page.verify_page_exists
|
15
|
+
# verify that target page is correctly displayed
|
16
|
+
target_page.verify_page_ui
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
When(/^I populate the form fields$/) do
|
21
|
+
PageManager.current_page.populate_form
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
Then(/^I expect the form fields to be correctly populated$/) do
|
26
|
+
PageManager.current_page.verify_form_data
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
When(/^I (.*) my changes$/) do | action|
|
31
|
+
PageManager.current_page.perform_action(action.downcase.to_sym)
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
Then(/^I expect the tab order to be correct$/) do
|
36
|
+
PageManager.current_page.verify_tab_order
|
37
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'capybara/cucumber'
|
2
|
+
require 'parallel_tests'
|
3
|
+
require 'appium_capybara'
|
4
|
+
require 'require_all'
|
5
|
+
require 'simplecov'
|
6
|
+
require 'testcentricity_web'
|
7
|
+
|
8
|
+
SimpleCov.command_name "features #{ENV['WEB_BROWSER']}" + (ENV['TEST_ENV_NUMBER'] || '')
|
9
|
+
|
10
|
+
# require_relative 'world_data'
|
11
|
+
require_relative 'world_pages'
|
12
|
+
|
13
|
+
# require_rel 'data'
|
14
|
+
# require_rel 'sections'
|
15
|
+
require_rel 'pages'
|
16
|
+
|
17
|
+
$LOAD_PATH << './lib'
|
18
|
+
|
19
|
+
# set Capybara's default max wait time to 20 seconds
|
20
|
+
Capybara.default_max_wait_time = 20
|
21
|
+
|
22
|
+
# set the default locale and auto load all translations from config/locales/*.rb,yml.
|
23
|
+
ENV['LOCALE'] = 'en-US' unless ENV['LOCALE']
|
24
|
+
I18n.load_path += Dir['config/locales/*.{rb,yml}']
|
25
|
+
I18n.default_locale = ENV['LOCALE']
|
26
|
+
I18n.locale = ENV['LOCALE']
|
27
|
+
Faker::Config.locale = ENV['LOCALE']
|
28
|
+
|
29
|
+
# instantiate all data objects and target test environment
|
30
|
+
# include WorldData
|
31
|
+
# environs.find_environ(ENV['TEST_ENVIRONMENT'], :yaml)
|
32
|
+
# WorldData.instantiate_data_objects
|
33
|
+
|
34
|
+
# instantiate all page objects
|
35
|
+
include WorldPages
|
36
|
+
WorldPages.instantiate_page_objects
|
37
|
+
|
38
|
+
# establish connection to WebDriver and target web browser
|
39
|
+
Webdrivers.cache_time = 86_400
|
40
|
+
|
41
|
+
options = { app_host: "file://#{File.dirname(__FILE__)}/../../test_site" }
|
42
|
+
options = { app_host: "http://192.168.1.129"}
|
43
|
+
TestCentricity::WebDriverConnect.initialize_web_driver(options)
|