testcentricity_web 3.3.0 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +37 -0
- data/Gemfile.lock +23 -25
- data/README.md +66 -33
- data/lib/testcentricity_web/browser_helper.rb +21 -13
- data/lib/testcentricity_web/data_objects/data_objects_helper.rb +34 -5
- data/lib/testcentricity_web/data_objects/environment.rb +30 -5
- data/lib/testcentricity_web/data_objects/excel_helper.rb +1 -25
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_object.rb +1 -93
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +1 -7
- data/lib/testcentricity_web/web_core/page_section.rb +0 -91
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +89 -31
- data/lib/testcentricity_web/web_elements/checkbox.rb +1 -15
- data/lib/testcentricity_web/web_elements/file_field.rb +1 -1
- data/lib/testcentricity_web/web_elements/radio.rb +1 -1
- data/lib/testcentricity_web/web_elements/select_list.rb +0 -52
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +5 -14
- data/lib/testcentricity_web/world_extensions.rb +1 -1
- data/lib/testcentricity_web.rb +0 -11
- metadata +6 -17
- data/lib/testcentricity_web/web_elements/cell_button.rb +0 -8
- data/lib/testcentricity_web/web_elements/cell_checkbox.rb +0 -38
- data/lib/testcentricity_web/web_elements/cell_element.rb +0 -69
- data/lib/testcentricity_web/web_elements/cell_image.rb +0 -8
- data/lib/testcentricity_web/web_elements/cell_radio.rb +0 -31
- data/lib/testcentricity_web/web_elements/list_button.rb +0 -8
- data/lib/testcentricity_web/web_elements/list_checkbox.rb +0 -38
- data/lib/testcentricity_web/web_elements/list_element.rb +0 -61
- data/lib/testcentricity_web/web_elements/list_radio.rb +0 -31
- data/lib/testcentricity_web/web_elements/siebel_open_ui_helper.rb +0 -15
@@ -441,7 +441,7 @@ module TestCentricity
|
|
441
441
|
# button_width = my_button.width
|
442
442
|
#
|
443
443
|
def width
|
444
|
-
obj, type = find_element(false)
|
444
|
+
obj, type = find_element(visible = false)
|
445
445
|
object_not_found_exception(obj, type)
|
446
446
|
obj.get_width
|
447
447
|
end
|
@@ -453,7 +453,7 @@ module TestCentricity
|
|
453
453
|
# button_height = my_button.height
|
454
454
|
#
|
455
455
|
def height
|
456
|
-
obj, type = find_element(false)
|
456
|
+
obj, type = find_element(visible = false)
|
457
457
|
object_not_found_exception(obj, type)
|
458
458
|
obj.get_height
|
459
459
|
end
|
@@ -465,7 +465,7 @@ module TestCentricity
|
|
465
465
|
# button_x = my_button.x
|
466
466
|
#
|
467
467
|
def x
|
468
|
-
obj, type = find_element(false)
|
468
|
+
obj, type = find_element(visible = false)
|
469
469
|
object_not_found_exception(obj, type)
|
470
470
|
obj.get_x
|
471
471
|
end
|
@@ -477,7 +477,7 @@ module TestCentricity
|
|
477
477
|
# button_y = my_button.y
|
478
478
|
#
|
479
479
|
def y
|
480
|
-
obj, type = find_element(false)
|
480
|
+
obj, type = find_element(visible = false)
|
481
481
|
object_not_found_exception(obj, type)
|
482
482
|
obj.get_y
|
483
483
|
end
|
@@ -499,7 +499,7 @@ module TestCentricity
|
|
499
499
|
# basket_link.displayed??
|
500
500
|
#
|
501
501
|
def displayed?
|
502
|
-
obj, type = find_element(false)
|
502
|
+
obj, type = find_element(visible = false)
|
503
503
|
object_not_found_exception(obj, type)
|
504
504
|
obj.displayed?
|
505
505
|
end
|
@@ -1032,15 +1032,6 @@ module TestCentricity
|
|
1032
1032
|
end
|
1033
1033
|
end
|
1034
1034
|
|
1035
|
-
def invoke_siebel_popup
|
1036
|
-
obj, = find_element
|
1037
|
-
object_not_found_exception(obj, 'Siebel object')
|
1038
|
-
trigger_name = obj.native.attribute('aria-describedby').strip
|
1039
|
-
trigger = "span##{trigger_name}"
|
1040
|
-
trigger = "#{@parent.get_locator} #{trigger}" if @context == :section && !@parent.get_locator.nil?
|
1041
|
-
first(trigger).click
|
1042
|
-
end
|
1043
|
-
|
1044
1035
|
def object_ref_message
|
1045
1036
|
"object '#{get_name}' (#{get_locator})"
|
1046
1037
|
end
|
data/lib/testcentricity_web.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'capybara/cucumber'
|
2
1
|
require 'test/unit'
|
3
2
|
require 'appium_lib'
|
4
3
|
|
@@ -35,16 +34,6 @@ require 'testcentricity_web/web_elements/range'
|
|
35
34
|
require 'testcentricity_web/web_elements/media'
|
36
35
|
require 'testcentricity_web/web_elements/audio'
|
37
36
|
require 'testcentricity_web/web_elements/video'
|
38
|
-
require 'testcentricity_web/web_elements/cell_element'
|
39
|
-
require 'testcentricity_web/web_elements/cell_button'
|
40
|
-
require 'testcentricity_web/web_elements/cell_checkbox'
|
41
|
-
require 'testcentricity_web/web_elements/cell_radio'
|
42
|
-
require 'testcentricity_web/web_elements/cell_image'
|
43
|
-
require 'testcentricity_web/web_elements/list_element'
|
44
|
-
require 'testcentricity_web/web_elements/list_button'
|
45
|
-
require 'testcentricity_web/web_elements/list_checkbox'
|
46
|
-
require 'testcentricity_web/web_elements/list_radio'
|
47
|
-
require 'testcentricity_web/web_elements/siebel_open_ui_helper'
|
48
37
|
|
49
38
|
|
50
39
|
module TestCentricity
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcentricity_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.J. Mrozinski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -274,26 +274,16 @@ files:
|
|
274
274
|
- lib/testcentricity_web/web_core/webdriver_helper.rb
|
275
275
|
- lib/testcentricity_web/web_elements/audio.rb
|
276
276
|
- lib/testcentricity_web/web_elements/button.rb
|
277
|
-
- lib/testcentricity_web/web_elements/cell_button.rb
|
278
|
-
- lib/testcentricity_web/web_elements/cell_checkbox.rb
|
279
|
-
- lib/testcentricity_web/web_elements/cell_element.rb
|
280
|
-
- lib/testcentricity_web/web_elements/cell_image.rb
|
281
|
-
- lib/testcentricity_web/web_elements/cell_radio.rb
|
282
277
|
- lib/testcentricity_web/web_elements/checkbox.rb
|
283
278
|
- lib/testcentricity_web/web_elements/file_field.rb
|
284
279
|
- lib/testcentricity_web/web_elements/image.rb
|
285
280
|
- lib/testcentricity_web/web_elements/label.rb
|
286
281
|
- lib/testcentricity_web/web_elements/link.rb
|
287
282
|
- lib/testcentricity_web/web_elements/list.rb
|
288
|
-
- lib/testcentricity_web/web_elements/list_button.rb
|
289
|
-
- lib/testcentricity_web/web_elements/list_checkbox.rb
|
290
|
-
- lib/testcentricity_web/web_elements/list_element.rb
|
291
|
-
- lib/testcentricity_web/web_elements/list_radio.rb
|
292
283
|
- lib/testcentricity_web/web_elements/media.rb
|
293
284
|
- lib/testcentricity_web/web_elements/radio.rb
|
294
285
|
- lib/testcentricity_web/web_elements/range.rb
|
295
286
|
- lib/testcentricity_web/web_elements/select_list.rb
|
296
|
-
- lib/testcentricity_web/web_elements/siebel_open_ui_helper.rb
|
297
287
|
- lib/testcentricity_web/web_elements/table.rb
|
298
288
|
- lib/testcentricity_web/web_elements/textfield.rb
|
299
289
|
- lib/testcentricity_web/web_elements/ui_elements_helper.rb
|
@@ -305,7 +295,7 @@ homepage: ''
|
|
305
295
|
licenses:
|
306
296
|
- BSD-3-Clause
|
307
297
|
metadata: {}
|
308
|
-
post_install_message:
|
298
|
+
post_install_message:
|
309
299
|
rdoc_options: []
|
310
300
|
require_paths:
|
311
301
|
- lib
|
@@ -321,9 +311,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
311
|
version: '0'
|
322
312
|
requirements:
|
323
313
|
- Capybara, Selenium-WebDriver
|
324
|
-
|
325
|
-
|
326
|
-
signing_key:
|
314
|
+
rubygems_version: 3.0.9
|
315
|
+
signing_key:
|
327
316
|
specification_version: 4
|
328
317
|
summary: A Page Object and Data Object Model Framework for desktop and mobile web
|
329
318
|
testing
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class CellCheckBox < CellElement
|
3
|
-
attr_accessor :proxy
|
4
|
-
|
5
|
-
def initialize(name, parent, locator, context, table, column, proxy = nil)
|
6
|
-
super
|
7
|
-
@type = :cell_checkbox
|
8
|
-
@proxy = proxy
|
9
|
-
end
|
10
|
-
|
11
|
-
def checked?(row)
|
12
|
-
obj, = find_cell_element(row)
|
13
|
-
cell_object_not_found_exception(obj, 'Cell CheckBox', row)
|
14
|
-
obj.checked?
|
15
|
-
end
|
16
|
-
|
17
|
-
def set_checkbox_state(row, state)
|
18
|
-
obj, = find_cell_element(row)
|
19
|
-
cell_object_not_found_exception(obj, 'Cell CheckBox', row)
|
20
|
-
obj.set(state)
|
21
|
-
end
|
22
|
-
|
23
|
-
def check(row)
|
24
|
-
set_checkbox_state(row, true)
|
25
|
-
end
|
26
|
-
|
27
|
-
def uncheck(row)
|
28
|
-
set_checkbox_state(row, false)
|
29
|
-
end
|
30
|
-
|
31
|
-
def verify_check_state(row, state, enqueue = false)
|
32
|
-
actual = checked?(row)
|
33
|
-
enqueue ?
|
34
|
-
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected Row #{row}/Col #{@column} Cell Checkbox #{object_ref_message}") :
|
35
|
-
assert_equal(state, actual, "Expected Row #{row}/Col #{@column} Cell Checkbox #{object_ref_message} to be #{state} but found #{actual} instead")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class CellElement < UIElement
|
3
|
-
attr_accessor :table
|
4
|
-
attr_accessor :column
|
5
|
-
attr_accessor :element_locator
|
6
|
-
|
7
|
-
def initialize(name, parent, locator, context, table, column, proxy = nil)
|
8
|
-
@name = name
|
9
|
-
@parent = parent
|
10
|
-
@context = context
|
11
|
-
@alt_locator = nil
|
12
|
-
@table = table
|
13
|
-
@column = column
|
14
|
-
@element_locator = locator
|
15
|
-
|
16
|
-
set_locator_type(@table.get_locator)
|
17
|
-
set_column(column)
|
18
|
-
end
|
19
|
-
|
20
|
-
def set_column(column)
|
21
|
-
@column = column
|
22
|
-
@locator = case @locator_type
|
23
|
-
when :xpath
|
24
|
-
"#{@table.get_table_cell_locator('ROW_SPEC', @column)}/#{@element_locator}"
|
25
|
-
when :css
|
26
|
-
"#{@table.get_table_cell_locator('ROW_SPEC', @column)} > #{@element_locator}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def exists?(row)
|
31
|
-
obj, = find_cell_element(row)
|
32
|
-
obj != nil
|
33
|
-
end
|
34
|
-
|
35
|
-
def click(row)
|
36
|
-
obj, = find_cell_element(row)
|
37
|
-
cell_object_not_found_exception(obj, @type, row)
|
38
|
-
obj.click
|
39
|
-
end
|
40
|
-
|
41
|
-
def get_native_attribute(row, attrib)
|
42
|
-
obj, = find_cell_element(row)
|
43
|
-
cell_object_not_found_exception(obj, @type, row)
|
44
|
-
obj.get_native_attribute(attrib)
|
45
|
-
end
|
46
|
-
|
47
|
-
def get_value(row, visible = true)
|
48
|
-
obj, = find_cell_element(row, visible)
|
49
|
-
cell_object_not_found_exception(obj, @type, row)
|
50
|
-
case obj.tag_name.downcase
|
51
|
-
when 'input', 'select', 'textarea'
|
52
|
-
obj.value
|
53
|
-
else
|
54
|
-
obj.text
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
alias get_caption get_value
|
59
|
-
|
60
|
-
def find_cell_element(row, visible = true)
|
61
|
-
set_alt_locator("#{@locator.gsub('ROW_SPEC', row.to_s)}")
|
62
|
-
find_element(visible)
|
63
|
-
end
|
64
|
-
|
65
|
-
def cell_object_not_found_exception(obj, obj_type, row)
|
66
|
-
object_not_found_exception(obj, "Row #{row}/Col #{@column} #{obj_type}")
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class CellRadio < CellElement
|
3
|
-
attr_accessor :proxy
|
4
|
-
|
5
|
-
def initialize(name, parent, locator, context, table, column, proxy = nil)
|
6
|
-
super
|
7
|
-
@type = :cell_radio
|
8
|
-
@proxy = proxy
|
9
|
-
end
|
10
|
-
|
11
|
-
def selected?(row)
|
12
|
-
obj, = find_cell_element(row)
|
13
|
-
cell_object_not_found_exception(obj, 'Cell Radio', row)
|
14
|
-
obj.checked?
|
15
|
-
end
|
16
|
-
|
17
|
-
def set_selected_state(row, state)
|
18
|
-
obj, = find_cell_element(row)
|
19
|
-
cell_object_not_found_exception(obj, 'Cell Radio', row)
|
20
|
-
obj.set(state)
|
21
|
-
end
|
22
|
-
|
23
|
-
def select(row)
|
24
|
-
set_selected_state(row, true)
|
25
|
-
end
|
26
|
-
|
27
|
-
def unselect(row)
|
28
|
-
set_selected_state(row, false)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class ListCheckBox < ListElement
|
3
|
-
attr_accessor :proxy
|
4
|
-
|
5
|
-
def initialize(name, parent, locator, context, list, proxy = nil)
|
6
|
-
super
|
7
|
-
@type = :list_checkbox
|
8
|
-
@proxy = proxy
|
9
|
-
end
|
10
|
-
|
11
|
-
def checked?(row)
|
12
|
-
obj, = find_list_element(row)
|
13
|
-
list_object_not_found_exception(obj, 'List CheckBox', row)
|
14
|
-
obj.checked?
|
15
|
-
end
|
16
|
-
|
17
|
-
def set_checkbox_state(row, state)
|
18
|
-
obj, = find_list_element(row)
|
19
|
-
list_object_not_found_exception(obj, 'List CheckBox', row)
|
20
|
-
obj.set(state)
|
21
|
-
end
|
22
|
-
|
23
|
-
def check(row)
|
24
|
-
set_checkbox_state(row, true)
|
25
|
-
end
|
26
|
-
|
27
|
-
def uncheck(row)
|
28
|
-
set_checkbox_state(row, false)
|
29
|
-
end
|
30
|
-
|
31
|
-
def verify_check_state(row, state, enqueue = false)
|
32
|
-
actual = checked?(row)
|
33
|
-
enqueue ?
|
34
|
-
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected Row #{row} List Checkbox #{object_ref_message}") :
|
35
|
-
assert_equal(state, actual, "Expected Row #{row} List Checkbox #{object_ref_message} to be #{state} but found #{actual} instead")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class ListElement < UIElement
|
3
|
-
attr_accessor :list
|
4
|
-
attr_accessor :element_locator
|
5
|
-
|
6
|
-
def initialize(name, parent, locator, context, list, proxy = nil)
|
7
|
-
@name = name
|
8
|
-
@parent = parent
|
9
|
-
@context = context
|
10
|
-
@alt_locator = nil
|
11
|
-
@list = list
|
12
|
-
@element_locator = locator
|
13
|
-
|
14
|
-
set_locator_type(@list.get_locator)
|
15
|
-
|
16
|
-
if locator.nil?
|
17
|
-
@locator = list.get_list_row_locator('ROW_SPEC')
|
18
|
-
else
|
19
|
-
@locator = case @locator_type
|
20
|
-
when :xpath
|
21
|
-
"#{list.get_list_row_locator('ROW_SPEC')}/#{@element_locator}"
|
22
|
-
when :css
|
23
|
-
"#{list.get_list_row_locator('ROW_SPEC')} > #{@element_locator}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def exists?(row)
|
29
|
-
obj, = find_list_element(row)
|
30
|
-
obj != nil
|
31
|
-
end
|
32
|
-
|
33
|
-
def click(row)
|
34
|
-
obj, = find_list_element(row)
|
35
|
-
list_object_not_found_exception(obj, @type, row)
|
36
|
-
obj.click
|
37
|
-
end
|
38
|
-
|
39
|
-
def get_value(row, visible = true)
|
40
|
-
obj, = find_list_element(row, visible)
|
41
|
-
list_object_not_found_exception(obj, @type, row)
|
42
|
-
case obj.tag_name.downcase
|
43
|
-
when 'input', 'select', 'textarea'
|
44
|
-
obj.value
|
45
|
-
else
|
46
|
-
obj.text
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
alias get_caption get_value
|
51
|
-
|
52
|
-
def find_list_element(row, visible = true)
|
53
|
-
set_alt_locator("#{@locator.gsub('ROW_SPEC', row.to_s)}")
|
54
|
-
find_element(visible)
|
55
|
-
end
|
56
|
-
|
57
|
-
def list_object_not_found_exception(obj, obj_type, row)
|
58
|
-
object_not_found_exception(obj, "Row #{row} #{obj_type}")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class ListRadio < ListElement
|
3
|
-
attr_accessor :proxy
|
4
|
-
|
5
|
-
def initialize(name, parent, locator, context, list, proxy = nil)
|
6
|
-
super
|
7
|
-
@type = :list_radio
|
8
|
-
@proxy = proxy
|
9
|
-
end
|
10
|
-
|
11
|
-
def selected?(row)
|
12
|
-
obj, = find_list_element(row)
|
13
|
-
list_object_not_found_exception(obj, 'List Radio', row)
|
14
|
-
obj.checked?
|
15
|
-
end
|
16
|
-
|
17
|
-
def set_selected_state(row, state)
|
18
|
-
obj, = find_list_element(row)
|
19
|
-
list_object_not_found_exception(obj, 'List Radio', row)
|
20
|
-
obj.set(state)
|
21
|
-
end
|
22
|
-
|
23
|
-
def select(row)
|
24
|
-
set_selected_state(row, true)
|
25
|
-
end
|
26
|
-
|
27
|
-
def unselect(row)
|
28
|
-
set_selected_state(row, false)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module TestCentricity
|
2
|
-
class UIElement
|
3
|
-
def invoke_siebel_dialog(popup, seconds = nil)
|
4
|
-
invoke_siebel_popup
|
5
|
-
timeout = seconds.nil? ? 15 : seconds
|
6
|
-
popup.wait_until_exists(timeout)
|
7
|
-
end
|
8
|
-
|
9
|
-
def get_siebel_object_type
|
10
|
-
obj, = find_element
|
11
|
-
object_not_found_exception(obj, 'Siebel object')
|
12
|
-
obj.native.attribute('ot')
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|