-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodap_table_object.rb
41 lines (33 loc) · 1.3 KB
/
codap_table_object.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class CodapTableObject< CodapBaseObject
H_SCROLLER = {css: '.sc-horizontal, .sc-scroller-view'}
SCROLL_H_RIGHT = {css: '.thumb'}
CASE_TABLE_TILE = {css: '.dg-case-table'}
ATTRIBUTE_NAME = {css: '.slick-header-column'}
TABLE_TRASH = {css: '.table-trash'}
TABLE_DROP_TARGET = {css: '.dg-table-drop-target'}
TABLE_ATTRIBUTES = {css: '.table-attributes'} #Tool palette icon for creating new attributes and export cases
TABLE_ATTRIBUTES_MENU = {css: '.attributes-popup'}
# Need to add menu items for trash and attributes menu
def initialize(driver)
super
end
def get_column_header(header_name)
header_name_path = '//span[contains(@class, "slick-column-name") and text()="'+header_name+'"]'
column_header_name = {xpath: header_name_path}
column_header_name_loc = driver.find_element(column_header_name)
driver.action.move_to(column_header_name_loc).perform
puts "Column header name is #{column_header_name_loc.text}"
return column_header_name_loc
end
def drag_scroller
scroll = driver.find_element(H_SCROLLER)
driver.action.drag_and_drop_by(scroll, 100, 0).perform
end
def drag_scroller_right
puts "In drag_scroller_right"
scroll_right = driver.find_element(SCROLL_H_RIGHT)
puts "Found element #{scroll_right}"
driver.action.drag_and_drop_by(scroll_right, 50, 0).perform
#scroll_right.click
end
end