Module: OnlyofficeDocumentserverTestingFramework::SeleniumWrapper
- Includes:
- SeleniumWrapperJsErrors
- Included in:
- CsvOption, EditorTab, Management, TitleRow, TopToolbarDocument, TopToolbarUsers, TxtOptions
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb
Overview
Module for handle selenium with frames and some other methods
Instance Method Summary collapse
-
#button_disabled?(xpath) ⇒ Boolean
This method return true if button disabled @param xpath.
-
#button_menu_active?(xpath) ⇒ True, False
If menu active.
-
#button_menu_open?(xpath) ⇒ Boolean
This method return true if button menu open @param xpath.
-
#button_pressed?(xpath) ⇒ Boolean
(also: #button_active?)
This method return true if button pressed @param xpath.
-
#click_on_button(xpath) ⇒ Object
This method click over button by xpath @param xpath.
-
#click_on_displayed_button(xpath) ⇒ nil
Wait to element to appear and click.
-
#click_on_of_several_by_display_button(xpath) ⇒ nil
Click on one of several displayed.
-
#frame_count_addition ⇒ Integer
Frame count with addition.
-
#get_attribute(xpath, attribute) ⇒ String
Get attribute.
-
#line_checked?(xpath) ⇒ True, False
Is line checked.
-
#line_enabled?(xpath) ⇒ True, False
Is line enabled.
-
#menu_disabled?(xpath) ⇒ True, False
Is menu disabled.
-
#remove_element(xpath) ⇒ nil
Remove element.
-
#select_frame ⇒ Object
Select actual frame of Editor.
-
#selenium_functions(name, *arguments, **options) ⇒ Object
Main wrapper function.
-
#visible?(xpath) ⇒ Boolean
(also: #element_visible?, #element_present_and_visible?)
This method return true if xpath visible on the web page @param xpath.
Methods included from SeleniumWrapperJsErrors
#console_errors, #error_ignored?, #fail_if_console_error, #ignored_errors
Instance Method Details
#button_disabled?(xpath) ⇒ Boolean
This method return true if button disabled @param xpath
64 65 66 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 64 def (xpath) selenium_functions(:get_attribute, xpath, 'class').include?('disabled') end |
#button_menu_active?(xpath) ⇒ True, False
Returns if menu active.
70 71 72 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 70 def (xpath) selenium_functions(:get_attribute, xpath, 'class').include?('menu-active') end |
#button_menu_open?(xpath) ⇒ Boolean
This method return true if button menu open @param xpath
77 78 79 80 81 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 77 def (xpath) element_visible = visible?(xpath) element_visible = selenium_functions(:get_attribute, xpath, 'class').include?('open') if element_visible element_visible end |
#button_pressed?(xpath) ⇒ Boolean Also known as:
This method return true if button pressed @param xpath
55 56 57 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 55 def (xpath) selenium_functions(:get_attribute, xpath, 'class').include?('active') end |
#click_on_button(xpath) ⇒ Object
This method click over button by xpath @param xpath
48 49 50 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 48 def (xpath) selenium_functions :click_on_locator, xpath end |
#click_on_displayed_button(xpath) ⇒ nil
Wait to element to appear and click
93 94 95 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 93 def (xpath) selenium_functions(:click_on_displayed, xpath) end |
#click_on_of_several_by_display_button(xpath) ⇒ nil
Click on one of several displayed
86 87 88 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 86 def (xpath) selenium_functions :click_on_one_of_several_by_display, xpath end |
#frame_count_addition ⇒ Integer
Returns frame count with addition.
32 33 34 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 32 def frame_count_addition @count_of_frame + @instance.management.xpath_iframe_count - 1 end |
#get_attribute(xpath, attribute) ⇒ String
Get attribute
129 130 131 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 129 def get_attribute(xpath, attribute) selenium_functions :get_attribute, xpath, attribute end |
#line_checked?(xpath) ⇒ True, False
Is line checked
107 108 109 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 107 def line_checked?(xpath) selenium_functions(:get_attribute, xpath, 'class').include?('checked') end |
#line_enabled?(xpath) ⇒ True, False
Is line enabled
100 101 102 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 100 def line_enabled?(xpath) selenium_functions :element_visible?, xpath end |
#menu_disabled?(xpath) ⇒ True, False
Is menu disabled
114 115 116 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 114 def (xpath) selenium_functions(:get_attribute, xpath, 'class').include?('disabled') end |
#remove_element(xpath) ⇒ nil
Remove element
121 122 123 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 121 def remove_element(xpath) selenium_functions :remove_element, xpath end |
#select_frame ⇒ Object
Select actual frame of Editor
21 22 23 24 25 26 27 28 29 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 21 def select_frame count_of_frame = @count_of_frame ? frame_count_addition : @instance.management.xpath_iframe_count xpath_of_frame = @xpath_of_frame || @instance.management.xpath_iframe @instance.selenium.select_frame xpath_of_frame, count_of_frame value = yield fail_if_console_error @instance.selenium.select_top_frame value end |
#selenium_functions(name, *arguments, **options) ⇒ Object
Main wrapper function
14 15 16 17 18 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 14 def selenium_functions(name, *arguments, **) select_frame do @instance.selenium.send name, *arguments, ** end end |
#visible?(xpath) ⇒ Boolean Also known as: element_visible?, element_present_and_visible?
This method return true if xpath visible on the web page @param xpath
39 40 41 |
# File 'lib/onlyoffice_documentserver_testing_framework/selenium_wrapper.rb', line 39 def visible?(xpath) selenium_functions :element_visible?, xpath end |