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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +96 -1
- data/README.md +88 -48
- data/lib/testcentricity_web/browser_helper.rb +2 -1
- data/lib/testcentricity_web/data_objects/environment.rb +0 -1
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +40 -3
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +89 -80
- data/lib/testcentricity_web/web_elements/media.rb +108 -0
- data/lib/testcentricity_web/web_elements/textfield.rb +28 -0
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +39 -1
- metadata +37 -181
- data/.gitignore +0 -39
- data/.idea/.name +0 -1
- data/.idea/encodings.xml +0 -6
- data/.idea/misc.xml +0 -4
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -7
- data/.rspec +0 -4
- data/.rubocop.yml +0 -38
- data/.ruby-version +0 -1
- data/.simplecov +0 -9
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -6
- data/Rakefile +0 -115
- data/config/cucumber.yml +0 -171
- data/config/locales/en-US.yml +0 -56
- data/config/test_data/LOCAL_data.json +0 -15
- data/config/test_data/LOCAL_data.xls +0 -0
- data/config/test_data/LOCAL_data.yml +0 -11
- data/config/test_data/data.json +0 -25
- data/config/test_data/data.xls +0 -0
- data/config/test_data/data.yml +0 -20
- data/docker-compose.yml +0 -48
- data/features/basic_form_page_css.feature +0 -54
- data/features/basic_form_page_xpath.feature +0 -26
- data/features/custom_controls.feature +0 -29
- data/features/media_players.feature +0 -67
- data/features/step_definitions/generic_steps.rb.rb +0 -124
- data/features/step_definitions/media_steps.rb +0 -30
- data/features/support/data/form_data.rb +0 -43
- data/features/support/env.rb +0 -51
- data/features/support/hooks.rb +0 -270
- data/features/support/pages/base_test_page.rb +0 -22
- data/features/support/pages/basic_css_form_page.rb +0 -53
- data/features/support/pages/basic_form_page.rb +0 -429
- data/features/support/pages/basic_xpath_form_page.rb +0 -54
- data/features/support/pages/custom_controls_page.rb +0 -263
- data/features/support/pages/indexed_sections_page.rb +0 -57
- data/features/support/pages/media_test_page.rb +0 -207
- data/features/support/sections/header_nav.rb +0 -48
- data/features/support/sections/product_card.rb +0 -39
- data/features/support/world_data.rb +0 -12
- data/features/support/world_pages.rb +0 -18
- data/reports/.keep +0 -1
- data/spec/fixtures/page_object.rb +0 -22
- data/spec/fixtures/section_object.rb +0 -21
- data/spec/spec_helper.rb +0 -31
- data/spec/testcentricity_web/browser_spec.rb +0 -41
- data/spec/testcentricity_web/elements/audio_spec.rb +0 -68
- data/spec/testcentricity_web/elements/button_spec.rb +0 -18
- data/spec/testcentricity_web/elements/checkbox_spec.rb +0 -33
- data/spec/testcentricity_web/elements/file_field_spec.rb +0 -13
- data/spec/testcentricity_web/elements/image_spec.rb +0 -33
- data/spec/testcentricity_web/elements/label_spec.rb +0 -18
- data/spec/testcentricity_web/elements/link_spec.rb +0 -23
- data/spec/testcentricity_web/elements/list_spec.rb +0 -13
- data/spec/testcentricity_web/elements/radio_spec.rb +0 -28
- data/spec/testcentricity_web/elements/ui_element_spec.rb +0 -125
- data/spec/testcentricity_web/elements/video_spec.rb +0 -68
- data/spec/testcentricity_web/helper_specs/object_helpers_spec.rb +0 -39
- data/spec/testcentricity_web/helper_specs/string_helpers_spec.rb +0 -49
- data/spec/testcentricity_web/page_object_spec.rb +0 -90
- data/spec/testcentricity_web/section_object_spec.rb +0 -72
- data/spec/testcentricity_web/version_spec.rb +0 -7
- data/spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb +0 -72
- data/spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb +0 -86
- data/spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb +0 -65
- data/test_site/basic_test_page.html +0 -290
- data/test_site/chosen-sprite.png +0 -0
- data/test_site/chosen-sprite@2x.png +0 -0
- data/test_site/chosen.css +0 -496
- data/test_site/chosen.jquery.js +0 -1359
- data/test_site/chosen.jquery.min.js +0 -3
- data/test_site/chosen.min.css +0 -11
- data/test_site/chosen.proto.js +0 -1399
- data/test_site/chosen.proto.min.js +0 -3
- data/test_site/composer.json +0 -36
- data/test_site/custom_controls_page.html +0 -629
- data/test_site/docsupport/chosen.png +0 -0
- data/test_site/docsupport/init.js +0 -11
- data/test_site/docsupport/init.proto.js +0 -16
- data/test_site/docsupport/jquery-1.12.4.min.js +0 -5
- data/test_site/docsupport/jquery-3.2.1.min.js +0 -4
- data/test_site/docsupport/oss-credit.png +0 -0
- data/test_site/docsupport/prism.css +0 -108
- data/test_site/docsupport/prism.js +0 -9
- data/test_site/docsupport/prototype-1.7.0.0.js +0 -6082
- data/test_site/docsupport/style.css +0 -219
- data/test_site/images/Blouse_Black.jpg +0 -0
- data/test_site/images/Granny.jpg +0 -0
- data/test_site/images/Printed_Dress.jpg +0 -0
- data/test_site/images/T-shirt.jpg +0 -0
- data/test_site/images/Wilder.jpg +0 -0
- data/test_site/images/You_Betcha.jpg +0 -0
- data/test_site/images/jeans3.jpg +0 -0
- data/test_site/indexed_sections_page.html +0 -215
- data/test_site/media/MIB2-subtitles-pt-BR.vtt +0 -49
- data/test_site/media/MIB2.mp4 +0 -0
- data/test_site/media/MP4_small.mp4 +0 -0
- data/test_site/media/MPS_sample.mp3 +0 -0
- data/test_site/media/bbc_scotland_report.mp3 +0 -0
- data/test_site/media/count_and_bars.mp4 +0 -0
- data/test_site/media_page.html +0 -86
- data/testcentricity_web.gemspec +0 -57
@@ -1,263 +0,0 @@
|
|
1
|
-
# Page Object class definition for Custom Controls page with CSS locators
|
2
|
-
|
3
|
-
class CustomControlsPage < BaseTestPage
|
4
|
-
trait(:page_name) { 'Custom Controls' }
|
5
|
-
trait(:page_locator) { 'div.custom-controls-page-body' }
|
6
|
-
trait(:page_url) { '/custom_controls_page.html' }
|
7
|
-
trait(:navigator) { header_nav.open_custom_controls_page }
|
8
|
-
trait(:page_title) { 'Custom Controls Page'}
|
9
|
-
trait(:divisions) {
|
10
|
-
['NFC EAST',
|
11
|
-
'NFC NORTH',
|
12
|
-
'NFC SOUTH',
|
13
|
-
'NFC WEST',
|
14
|
-
'AFC EAST',
|
15
|
-
'AFC NORTH',
|
16
|
-
'AFC SOUTH',
|
17
|
-
'AFC WEST']
|
18
|
-
}
|
19
|
-
trait(:teams) {
|
20
|
-
['Dallas Cowboys',
|
21
|
-
'New York Giants',
|
22
|
-
'Philadelphia Eagles',
|
23
|
-
'Washington Redskins',
|
24
|
-
'Chicago Bears',
|
25
|
-
'Detroit Lions',
|
26
|
-
'Green Bay Packers',
|
27
|
-
'Minnesota Vikings',
|
28
|
-
'Atlanta Falcons',
|
29
|
-
'Carolina Panthers',
|
30
|
-
'New Orleans Saints',
|
31
|
-
'Tampa Bay Buccaneers',
|
32
|
-
'Arizona Cardinals',
|
33
|
-
'St. Louis Rams',
|
34
|
-
'San Francisco 49ers',
|
35
|
-
'Seattle Seahawks',
|
36
|
-
'Buffalo Bills',
|
37
|
-
'Miami Dolphins',
|
38
|
-
'New England Patriots',
|
39
|
-
'New York Jets',
|
40
|
-
'Baltimore Ravens',
|
41
|
-
'Cincinnati Bengals',
|
42
|
-
'Cleveland Browns',
|
43
|
-
'Pittsburgh Steelers',
|
44
|
-
'Houston Texans',
|
45
|
-
'Indianapolis Colts',
|
46
|
-
'Jacksonville Jaguars',
|
47
|
-
'Tennessee Titans',
|
48
|
-
'Denver Broncos',
|
49
|
-
'Kansas City Chiefs',
|
50
|
-
'Oakland Raiders',
|
51
|
-
'San Diego Chargers']
|
52
|
-
}
|
53
|
-
trait(:countries) { ['United Kingdom', 'Tonga', 'Sweden', 'Peru', 'Belize', 'Mali', 'Ireland'] }
|
54
|
-
|
55
|
-
# Custom Controls page UI elements
|
56
|
-
selectlists country_select: 'div#country_chosen',
|
57
|
-
team_select: 'div#team_chosen'
|
58
|
-
checkboxes pork_check: "label[for='check1']",
|
59
|
-
beef_check: "label[for='check2']",
|
60
|
-
chicken_check: "label[for='check3']",
|
61
|
-
shrimp_check: "label[for='check4']"
|
62
|
-
radios mild_radio: "label[for='radio1']",
|
63
|
-
spicey_radio: "label[for='radio2']",
|
64
|
-
hot_radio: "label[for='radio3']",
|
65
|
-
flaming_radio: "label[for='radio4']"
|
66
|
-
tables custom_table: 'div#resp-table'
|
67
|
-
|
68
|
-
attr_accessor :selected_country
|
69
|
-
attr_accessor :selected_team
|
70
|
-
attr_accessor :selected_checks
|
71
|
-
attr_accessor :selected_radio
|
72
|
-
|
73
|
-
def initialize
|
74
|
-
super
|
75
|
-
# define the custom list element components for the Country and Team Chosen selectlists
|
76
|
-
list_spec = {
|
77
|
-
selected_item: "li[class*='result-selected']",
|
78
|
-
list_item: "li[class*='active-result']",
|
79
|
-
text_field: 'input.chosen-search-input',
|
80
|
-
options_list: 'ul.chosen-results',
|
81
|
-
group_item: 'li.group-result',
|
82
|
-
group_heading: 'li.group-result'
|
83
|
-
}
|
84
|
-
country_select.define_list_elements(list_spec)
|
85
|
-
team_select.define_list_elements(list_spec)
|
86
|
-
# define the custom element components for the checkboxes
|
87
|
-
check_spec = { input: "input[type='checkbox']" }
|
88
|
-
pork_check.define_custom_elements(check_spec)
|
89
|
-
beef_check.define_custom_elements(check_spec)
|
90
|
-
chicken_check.define_custom_elements(check_spec)
|
91
|
-
shrimp_check.define_custom_elements(check_spec)
|
92
|
-
# define the custom element components for the radios
|
93
|
-
radio_spec = { input: "input[type='radio']" }
|
94
|
-
mild_radio.define_custom_elements(radio_spec)
|
95
|
-
spicey_radio.define_custom_elements(radio_spec)
|
96
|
-
hot_radio.define_custom_elements(radio_spec)
|
97
|
-
flaming_radio.define_custom_elements(radio_spec)
|
98
|
-
# define the custom element components for the table
|
99
|
-
table_spec = {
|
100
|
-
table_body: 'div#resp-table-body',
|
101
|
-
table_row: 'div.resp-table-row',
|
102
|
-
table_column: 'div.table-body-cell',
|
103
|
-
table_header: 'div#resp-table-header',
|
104
|
-
header_column: 'div.table-header-cell'
|
105
|
-
}
|
106
|
-
custom_table.define_table_elements(table_spec)
|
107
|
-
end
|
108
|
-
|
109
|
-
def verify_page_ui
|
110
|
-
super
|
111
|
-
|
112
|
-
ui = {
|
113
|
-
country_select => {
|
114
|
-
exists: true,
|
115
|
-
visible: true,
|
116
|
-
enabled: true,
|
117
|
-
optioncount: 251
|
118
|
-
},
|
119
|
-
team_select => {
|
120
|
-
exists: true,
|
121
|
-
visible: true,
|
122
|
-
enabled: true,
|
123
|
-
optioncount: 32,
|
124
|
-
options: teams,
|
125
|
-
groupcount: 8,
|
126
|
-
group_headings: divisions
|
127
|
-
},
|
128
|
-
pork_check => {
|
129
|
-
exists: true,
|
130
|
-
visible: true,
|
131
|
-
enabled: true,
|
132
|
-
checked: true,
|
133
|
-
caption: 'Pork'
|
134
|
-
},
|
135
|
-
beef_check => {
|
136
|
-
exists: true,
|
137
|
-
visible: true,
|
138
|
-
enabled: true,
|
139
|
-
checked: false,
|
140
|
-
caption: 'Beef'
|
141
|
-
},
|
142
|
-
chicken_check => {
|
143
|
-
exists: true,
|
144
|
-
visible: true,
|
145
|
-
enabled: true,
|
146
|
-
checked: false,
|
147
|
-
caption: 'Chicken'
|
148
|
-
},
|
149
|
-
shrimp_check => {
|
150
|
-
exists: true,
|
151
|
-
visible: true,
|
152
|
-
enabled: true,
|
153
|
-
checked: false,
|
154
|
-
caption: 'Shrimp'
|
155
|
-
},
|
156
|
-
mild_radio => {
|
157
|
-
exists: true,
|
158
|
-
visible: true,
|
159
|
-
enabled: true,
|
160
|
-
selected: true,
|
161
|
-
caption: 'Mild'
|
162
|
-
},
|
163
|
-
spicey_radio => {
|
164
|
-
exists: true,
|
165
|
-
visible: true,
|
166
|
-
enabled: true,
|
167
|
-
selected: false,
|
168
|
-
caption: 'Spicey'
|
169
|
-
},
|
170
|
-
hot_radio => {
|
171
|
-
exists: true,
|
172
|
-
visible: true,
|
173
|
-
enabled: true,
|
174
|
-
selected: false,
|
175
|
-
caption: 'Hot'
|
176
|
-
},
|
177
|
-
flaming_radio => {
|
178
|
-
exists: true,
|
179
|
-
visible: true,
|
180
|
-
enabled: true,
|
181
|
-
selected: false,
|
182
|
-
caption: 'Flaming'
|
183
|
-
},
|
184
|
-
custom_table => {
|
185
|
-
visible: true,
|
186
|
-
columncount: 4,
|
187
|
-
rowcount: 3,
|
188
|
-
{ row: 1 } => [['Cell 1–1', 'Cell 1–2', 'Cell 1–3', 'Cell 1–4']],
|
189
|
-
{ row: 2 } => [['Cell 2–1', 'Cell 2–2', 'Cell 2–3', 'Cell 2–4']],
|
190
|
-
{ row: 3 } => [['Cell 3–1', 'Cell 3–2', 'Cell 3–3', 'Cell 3–4']],
|
191
|
-
{ cell: [1, 3] } => ['Cell 1–3'],
|
192
|
-
{ cell: [2, 4] } => ['Cell 2–4'],
|
193
|
-
{ column: 3 } => [['Cell 1–3', 'Cell 2–3', 'Cell 3–3']]
|
194
|
-
}
|
195
|
-
}
|
196
|
-
verify_ui_states(ui)
|
197
|
-
team_select.verify_options(teams)
|
198
|
-
end
|
199
|
-
|
200
|
-
def populate_form
|
201
|
-
@selected_country = countries.sample
|
202
|
-
@selected_team = teams.sample
|
203
|
-
@selected_checks = [:chicken, :shrimp]
|
204
|
-
@selected_radio = 3
|
205
|
-
fields = {
|
206
|
-
country_select => @selected_country,
|
207
|
-
team_select => @selected_team,
|
208
|
-
pork_check => @selected_checks.include?(:pork),
|
209
|
-
beef_check => @selected_checks.include?(:beef),
|
210
|
-
chicken_check => @selected_checks.include?(:chicken),
|
211
|
-
shrimp_check => @selected_checks.include?(:shrimp),
|
212
|
-
mild_radio => @selected_radio == 1,
|
213
|
-
spicey_radio => @selected_radio == 2,
|
214
|
-
hot_radio => @selected_radio == 3,
|
215
|
-
flaming_radio => @selected_radio == 4
|
216
|
-
}
|
217
|
-
populate_data_fields(fields)
|
218
|
-
end
|
219
|
-
|
220
|
-
def set_select_options
|
221
|
-
@selected_country = countries.sample
|
222
|
-
@selected_team = teams.sample
|
223
|
-
country_select.set(@selected_country)
|
224
|
-
team_select.set(@selected_team)
|
225
|
-
end
|
226
|
-
|
227
|
-
def verify_form_data
|
228
|
-
ui = {
|
229
|
-
country_select => { selected: @selected_country },
|
230
|
-
team_select => { selected: @selected_team },
|
231
|
-
pork_check => { checked: @selected_checks.include?(:pork) },
|
232
|
-
beef_check => { checked: @selected_checks.include?(:beef) },
|
233
|
-
chicken_check => { checked: @selected_checks.include?(:chicken) },
|
234
|
-
shrimp_check => { checked: @selected_checks.include?(:shrimp) },
|
235
|
-
mild_radio => { selected: @selected_radio == 1 },
|
236
|
-
spicey_radio => { selected: @selected_radio == 2 },
|
237
|
-
hot_radio => { selected: @selected_radio == 3 },
|
238
|
-
flaming_radio => { selected: @selected_radio == 4 }
|
239
|
-
}
|
240
|
-
verify_ui_states(ui)
|
241
|
-
end
|
242
|
-
|
243
|
-
def choose_options_by(method)
|
244
|
-
case method.downcase.to_sym
|
245
|
-
when :index
|
246
|
-
country_select.choose_option(index: 56)
|
247
|
-
team_select.choose_option(index: 20)
|
248
|
-
when :text
|
249
|
-
country_select.choose_option('Costa Rica')
|
250
|
-
team_select.choose_option('Seattle Seahawks')
|
251
|
-
else
|
252
|
-
raise "#{method} is not a valid selector"
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
def verify_chosen_options
|
257
|
-
ui = {
|
258
|
-
country_select => { selected: 'Costa Rica' },
|
259
|
-
team_select => { selected: 'Seattle Seahawks' }
|
260
|
-
}
|
261
|
-
verify_ui_states(ui)
|
262
|
-
end
|
263
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# Page Object class definition for Indexed Sections page with CSS locators
|
2
|
-
|
3
|
-
class IndexedSectionsPage < BaseTestPage
|
4
|
-
trait(:page_name) { 'Indexed Sections' }
|
5
|
-
trait(:page_locator) { 'div.indexed-sections-page-body' }
|
6
|
-
trait(:page_url) { '/indexed_sections_page.html' }
|
7
|
-
trait(:navigator) { header_nav.open_indexed_sections_page }
|
8
|
-
trait(:page_title) { 'Indexed Sections Page'}
|
9
|
-
|
10
|
-
list :product_list, 'div#product_list'
|
11
|
-
section :product_card, ProductCard
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
super
|
15
|
-
# define the list item element for the Product list object
|
16
|
-
list_elements = { list_item: 'div.column' }
|
17
|
-
product_list.define_list_elements(list_elements)
|
18
|
-
# associate the Product Card indexed section object with the Product list object
|
19
|
-
product_card.set_list_index(product_list)
|
20
|
-
end
|
21
|
-
|
22
|
-
def verify_page_ui
|
23
|
-
super
|
24
|
-
|
25
|
-
ui = {
|
26
|
-
product_list => {
|
27
|
-
exists: true,
|
28
|
-
visible: true,
|
29
|
-
itemcount: 4
|
30
|
-
},
|
31
|
-
product_card => { items: ['Tailored Jeans', 'Faded Short Sleeve T-shirts', 'Print Dress', 'Blouse'] }
|
32
|
-
}
|
33
|
-
verify_ui_states(ui)
|
34
|
-
# verify contents of first product card
|
35
|
-
product_card.set_list_index(product_list, 1)
|
36
|
-
card_data = {
|
37
|
-
product_name: 'Tailored Jeans',
|
38
|
-
price: '$59.99',
|
39
|
-
description: 'Some text about the jeans. Super slim and comfy lorem ipsum lorem jeansum. Lorem jeamsun denim lorem jeansum.',
|
40
|
-
rating: 3,
|
41
|
-
image_alt: 'Denim Jeans',
|
42
|
-
image_src: 'images/jeans3.jpg'
|
43
|
-
}
|
44
|
-
product_card.verify_card(card_data)
|
45
|
-
# verify contents of second product card
|
46
|
-
product_card.set_list_index(product_list, 2)
|
47
|
-
card_data = {
|
48
|
-
product_name: 'Faded Short Sleeve T-shirts',
|
49
|
-
price: '$19.99',
|
50
|
-
description: "Faded short sleeve t-shirt with high neckline. Soft and stretchy material for a comfortable fit. Accessorize with a straw hat and you're ready for summer!",
|
51
|
-
rating: 4,
|
52
|
-
image_alt: 'Faded Short Sleeve T-shirts',
|
53
|
-
image_src: 'images/T-shirt.jpg'
|
54
|
-
}
|
55
|
-
product_card.verify_card(card_data)
|
56
|
-
end
|
57
|
-
end
|
@@ -1,207 +0,0 @@
|
|
1
|
-
# Page Object class definition for Media Test page with CSS locators
|
2
|
-
|
3
|
-
class MediaTestPage < BaseTestPage
|
4
|
-
trait(:page_name) { 'Media Test' }
|
5
|
-
trait(:page_locator) { 'div.media-page-body' }
|
6
|
-
trait(:page_url) { '/media_page.html' }
|
7
|
-
trait(:navigator) { header_nav.open_media_page }
|
8
|
-
trait(:page_title) { 'Media Page'}
|
9
|
-
|
10
|
-
# Media Test page UI elements
|
11
|
-
videos video_player_1: 'video#video_player1'
|
12
|
-
audios audio_player: 'audio#audio_player'
|
13
|
-
|
14
|
-
def verify_page_ui
|
15
|
-
super
|
16
|
-
|
17
|
-
preload = case
|
18
|
-
when Environ.browser == :safari
|
19
|
-
'auto'
|
20
|
-
when Environ.device_os == :ios && Environ.driver != :webdriver
|
21
|
-
'auto'
|
22
|
-
when %i[firefox firefox_headless].include?(Environ.browser)
|
23
|
-
''
|
24
|
-
else
|
25
|
-
'metadata'
|
26
|
-
end
|
27
|
-
video_player_1.wait_until_ready_state_is(4, 20)
|
28
|
-
audio_player.wait_until_ready_state_is(4, 10)
|
29
|
-
ui = {
|
30
|
-
video_player_1 => {
|
31
|
-
visible: true,
|
32
|
-
paused: true,
|
33
|
-
autoplay: false,
|
34
|
-
loop: false,
|
35
|
-
ended: false,
|
36
|
-
controls: true,
|
37
|
-
current_time: 0,
|
38
|
-
ready_state: 4,
|
39
|
-
default_playback_rate: 1,
|
40
|
-
playback_rate: 1,
|
41
|
-
seeking: false,
|
42
|
-
default_muted: false,
|
43
|
-
muted: false,
|
44
|
-
volume: 1,
|
45
|
-
preload: preload,
|
46
|
-
poster: '',
|
47
|
-
src: '',
|
48
|
-
duration: 17.6
|
49
|
-
},
|
50
|
-
audio_player => {
|
51
|
-
visible: true,
|
52
|
-
paused: true,
|
53
|
-
autoplay: false,
|
54
|
-
loop: false,
|
55
|
-
ended: false,
|
56
|
-
controls: true,
|
57
|
-
current_time: 0,
|
58
|
-
ready_state: 4,
|
59
|
-
default_playback_rate: 1,
|
60
|
-
playback_rate: 1,
|
61
|
-
seeking: false,
|
62
|
-
default_muted: false,
|
63
|
-
muted: false,
|
64
|
-
volume: 1,
|
65
|
-
preload: preload,
|
66
|
-
src: ''
|
67
|
-
}
|
68
|
-
}
|
69
|
-
verify_ui_states(ui)
|
70
|
-
unless Environ.browser == :safari
|
71
|
-
ui = { video_player_1 => {
|
72
|
-
width: video_player_1.video_width,
|
73
|
-
height: video_player_1.video_height
|
74
|
-
}
|
75
|
-
}
|
76
|
-
verify_ui_states(ui)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def perform_action(media_type, action)
|
81
|
-
player = dispatch_player(media_type)
|
82
|
-
case action.downcase.to_sym
|
83
|
-
when :play
|
84
|
-
player.play
|
85
|
-
player.send_keys(:enter) if player.paused?
|
86
|
-
player.click_at(25, 25) if player.paused?
|
87
|
-
when :pause
|
88
|
-
player.pause
|
89
|
-
when :mute
|
90
|
-
player.mute
|
91
|
-
when :unmute
|
92
|
-
player.unmute
|
93
|
-
else
|
94
|
-
raise "#{action} is not a valid selector"
|
95
|
-
end
|
96
|
-
sleep(2)
|
97
|
-
end
|
98
|
-
|
99
|
-
def verify_media_state(media_type, state)
|
100
|
-
player = dispatch_player(media_type)
|
101
|
-
duration = player.duration
|
102
|
-
props = case state.downcase.to_sym
|
103
|
-
when :playing
|
104
|
-
{
|
105
|
-
visible: true,
|
106
|
-
paused: false,
|
107
|
-
ended: false,
|
108
|
-
current_time: { greater_than: 0 },
|
109
|
-
seeking: false
|
110
|
-
}
|
111
|
-
when :paused
|
112
|
-
{
|
113
|
-
visible: true,
|
114
|
-
paused: true,
|
115
|
-
ended: false,
|
116
|
-
current_time: { greater_than: 0 },
|
117
|
-
seeking: false
|
118
|
-
}
|
119
|
-
when :ended
|
120
|
-
{
|
121
|
-
visible: true,
|
122
|
-
paused: true,
|
123
|
-
ended: true,
|
124
|
-
current_time: duration,
|
125
|
-
seeking: false
|
126
|
-
}
|
127
|
-
when :muted
|
128
|
-
{
|
129
|
-
visible: true,
|
130
|
-
muted: true
|
131
|
-
}
|
132
|
-
when :unmuted
|
133
|
-
{
|
134
|
-
visible: true,
|
135
|
-
muted: false
|
136
|
-
}
|
137
|
-
else
|
138
|
-
raise "#{state} is not a valid selector"
|
139
|
-
end
|
140
|
-
verify_ui_states(player => props)
|
141
|
-
end
|
142
|
-
|
143
|
-
def set_playback_rate(media_type, rate)
|
144
|
-
player = dispatch_player(media_type)
|
145
|
-
player.playback_rate = rate.to_f
|
146
|
-
reset_play(player)
|
147
|
-
end
|
148
|
-
|
149
|
-
def verify_playback_rate(media_type, rate)
|
150
|
-
player = dispatch_player(media_type)
|
151
|
-
ui = {
|
152
|
-
player => {
|
153
|
-
playback_rate: rate.to_f,
|
154
|
-
visible: true,
|
155
|
-
paused: false,
|
156
|
-
seeking: false,
|
157
|
-
current_time: { greater_than: 0 }
|
158
|
-
}
|
159
|
-
}
|
160
|
-
verify_ui_states(ui)
|
161
|
-
end
|
162
|
-
|
163
|
-
def set_volume(media_type, volume)
|
164
|
-
player = dispatch_player(media_type)
|
165
|
-
player.volume = volume.to_f
|
166
|
-
reset_play(player)
|
167
|
-
end
|
168
|
-
|
169
|
-
def verify_volume(media_type, volume)
|
170
|
-
player = dispatch_player(media_type)
|
171
|
-
ui = {
|
172
|
-
player => {
|
173
|
-
volume: volume.to_f,
|
174
|
-
visible: true,
|
175
|
-
muted: false,
|
176
|
-
paused: false,
|
177
|
-
seeking: false,
|
178
|
-
current_time: { greater_than: 0 }
|
179
|
-
}
|
180
|
-
}
|
181
|
-
verify_ui_states(ui)
|
182
|
-
end
|
183
|
-
|
184
|
-
private
|
185
|
-
|
186
|
-
def dispatch_player(media_type)
|
187
|
-
player = case media_type.downcase.to_sym
|
188
|
-
when :video
|
189
|
-
video_player_1
|
190
|
-
when :audio
|
191
|
-
audio_player
|
192
|
-
else
|
193
|
-
raise "#{media_type} is not a valid selector"
|
194
|
-
end
|
195
|
-
player.wait_until_ready_state_is(4, 20)
|
196
|
-
player
|
197
|
-
end
|
198
|
-
|
199
|
-
def reset_play(player)
|
200
|
-
player.pause
|
201
|
-
player.current_time = 0
|
202
|
-
player.play
|
203
|
-
player.send_keys(:enter) if player.paused?
|
204
|
-
player.click_at(25, 25) if player.paused?
|
205
|
-
sleep(2)
|
206
|
-
end
|
207
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# Section Object class definition for Top Navigation Bar
|
2
|
-
|
3
|
-
class NavHeader < TestCentricity::PageSection
|
4
|
-
trait(:section_locator) { 'div#nav_bar' }
|
5
|
-
trait(:section_name) { 'Top Navigation Bar' }
|
6
|
-
|
7
|
-
# Top Navigation Bar UI elements
|
8
|
-
links form_link: 'a#form_link',
|
9
|
-
media_link: 'a#media_link',
|
10
|
-
indexed_sections_link: 'a#indexed_sections_link',
|
11
|
-
custom_controls_link: 'a#custom_controls_link'
|
12
|
-
|
13
|
-
def open_form_page
|
14
|
-
form_link.click
|
15
|
-
end
|
16
|
-
|
17
|
-
def open_media_page
|
18
|
-
media_link.click
|
19
|
-
end
|
20
|
-
|
21
|
-
def open_indexed_sections_page
|
22
|
-
indexed_sections_link.click
|
23
|
-
end
|
24
|
-
|
25
|
-
def open_custom_controls_page
|
26
|
-
custom_controls_link.click
|
27
|
-
end
|
28
|
-
|
29
|
-
def verify_nav_bar
|
30
|
-
self.wait_until_visible(5)
|
31
|
-
ui = {
|
32
|
-
self => {
|
33
|
-
exists: true,
|
34
|
-
visible: true,
|
35
|
-
hidden: false,
|
36
|
-
displayed: true,
|
37
|
-
enabled: true,
|
38
|
-
disabled: false,
|
39
|
-
class: 'topnav'
|
40
|
-
},
|
41
|
-
form_link => { visible: true, caption: 'Basic HTML Form' },
|
42
|
-
media_link => { visible: true, caption: 'Media' },
|
43
|
-
indexed_sections_link => { visible: true, caption: 'Indexed Sections' },
|
44
|
-
custom_controls_link => { visible: true, caption: 'Custom Controls' },
|
45
|
-
}
|
46
|
-
verify_ui_states(ui)
|
47
|
-
end
|
48
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# Section Object class definition for Product Card
|
2
|
-
|
3
|
-
class ProductCard < TestCentricity::PageSection
|
4
|
-
trait(:section_locator) { 'div.column' }
|
5
|
-
trait(:section_name) { 'Product Card' }
|
6
|
-
|
7
|
-
# Product Card UI elements
|
8
|
-
image :product_image, "img[data-test-id='product_image']"
|
9
|
-
labels name_label: "h1[data-test-id='product_name']",
|
10
|
-
price_label: "p[data-test-id='price']",
|
11
|
-
description_label: "p[data-test-id='description']"
|
12
|
-
elements ratings: "div[data-test-id='rating']",
|
13
|
-
checked_star: 'span.fa.fa-star.checked'
|
14
|
-
button :add_to_cart_button, "button[data-test-id='add_to_cart']"
|
15
|
-
|
16
|
-
def get_value
|
17
|
-
name_label.get_caption
|
18
|
-
end
|
19
|
-
|
20
|
-
def verify_card(card_data)
|
21
|
-
ui = {
|
22
|
-
product_image => {
|
23
|
-
visible: true,
|
24
|
-
loaded: true,
|
25
|
-
broken: false,
|
26
|
-
src: { ends_with: card_data[:image_src] },
|
27
|
-
alt: card_data[:image_alt]
|
28
|
-
},
|
29
|
-
name_label => { visible: true, caption: card_data[:product_name] },
|
30
|
-
price_label => { visible: true, caption: card_data[:price] },
|
31
|
-
description_label => { visible: true, caption: card_data[:description] },
|
32
|
-
checked_star => { count: card_data[:rating] },
|
33
|
-
add_to_cart_button => { visible: true, enabled: true, caption: 'Add to Cart' }
|
34
|
-
}
|
35
|
-
within(self.get_locator) do
|
36
|
-
verify_ui_states(ui)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module WorldData
|
2
|
-
#
|
3
|
-
# data_objects method returns a hash table of your web app's data objects and associated data object classes to be instantiated
|
4
|
-
# by the TestCentricity™ DataManager. Data Object class definitions are contained in the features/support/data folder.
|
5
|
-
#
|
6
|
-
def data_objects
|
7
|
-
{ form_data_source: FormDataSource }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
World(WorldData)
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module WorldPages
|
2
|
-
#
|
3
|
-
# page_objects method returns a hash table of your web app's page objects and associated page classes to be instantiated
|
4
|
-
# by the TestCentricity™ PageManager. Page Object class definitions are contained in the features/support/pages folder.
|
5
|
-
#
|
6
|
-
def page_objects
|
7
|
-
{
|
8
|
-
basic_css_form_page: BasicCSSFormPage,
|
9
|
-
basic_xpath_form_page: BasicXpathFormPage,
|
10
|
-
media_test_page: MediaTestPage,
|
11
|
-
indexed_sections_page: IndexedSectionsPage,
|
12
|
-
custom_controls_page: CustomControlsPage
|
13
|
-
}
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
World(WorldPages)
|
data/reports/.keep
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Placeholder file to allow the reports folder to be saved to repository. This folder is required for Jenkins test jobs using the Cucumber Reporting plug-in.
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class TestPage < TestCentricity::PageObject
|
2
|
-
trait(:page_name) { 'Basic Test Page' }
|
3
|
-
trait(:page_url) { '/basic_test_page.html' }
|
4
|
-
trait(:page_locator) { 'form#HTMLFormElements' }
|
5
|
-
|
6
|
-
elements element1: 'div#element1'
|
7
|
-
buttons button1: 'button#button1'
|
8
|
-
textfields field1: 'input#field1'
|
9
|
-
links link1: 'a#link1'
|
10
|
-
ranges range1: 'input#range1'
|
11
|
-
images image1: 'img#image1'
|
12
|
-
radios radio1: 'input#radio1'
|
13
|
-
checkboxes check1: 'input#check1'
|
14
|
-
filefields file1: 'input#file1'
|
15
|
-
labels label1: 'label#label1'
|
16
|
-
tables table1: 'table#table1'
|
17
|
-
selectlists select1: 'select#select1'
|
18
|
-
lists list1: 'ul#list1'
|
19
|
-
videos video1: 'video#video1'
|
20
|
-
audios audio1: 'audio#audio1'
|
21
|
-
sections section1: TestSection
|
22
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class TestSection < TestCentricity::PageSection
|
2
|
-
trait(:section_locator) { 'div#section' }
|
3
|
-
trait(:section_name) { 'Basic Test Section' }
|
4
|
-
|
5
|
-
elements element1: 'div#element1'
|
6
|
-
buttons button1: 'button#button1'
|
7
|
-
textfields field1: 'input#field1'
|
8
|
-
links link1: 'a#link1'
|
9
|
-
ranges range1: 'input#range1'
|
10
|
-
images image1: 'img#image1'
|
11
|
-
radios radio1: 'input#radio1'
|
12
|
-
checkboxes check1: 'input#check1'
|
13
|
-
filefields file1: 'input#file1'
|
14
|
-
labels label1: 'label#label1'
|
15
|
-
tables table1: 'table#table1'
|
16
|
-
selectlists select1: 'select#select1'
|
17
|
-
lists list1: 'ul#list1'
|
18
|
-
videos video1: 'video#video1'
|
19
|
-
audios audio1: 'audio#audio1'
|
20
|
-
sections section2: TestSection
|
21
|
-
end
|