Class: OnlyofficeDocumentserverTestingFramework::EditorTab
- Inherits:
-
Object
- Object
- OnlyofficeDocumentserverTestingFramework::EditorTab
- Includes:
- SeleniumWrapper
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb
Overview
Meta class to describe editors tabs
Direct Known Subclasses
Instance Method Summary collapse
-
#active? ⇒ True, False
If this tab opened.
-
#click ⇒ Nothing
Click on tab.
-
#close_tooltips ⇒ Nothing
Close tooltips.
-
#double_click ⇒ Nothing
Double click on tab.
-
#initialize(instance, tab_xpath: nil, tab_name: 'Default tab name') ⇒ EditorTab
constructor
A new instance of EditorTab.
-
#open(to_open = true) ⇒ Void
Open current tab rubocop disable to not change interface of public method rubocop:disable Style/OptionalBooleanParameter.
-
#present? ⇒ True, False
Is tab present.
Methods included from SeleniumWrapper
#button_disabled?, #button_menu_active?, #button_menu_open?, #button_pressed?, #click_on_button, #click_on_displayed_button, #click_on_of_several_by_display_button, #frame_count_addition, #get_attribute, #line_checked?, #line_enabled?, #menu_disabled?, #remove_element, #select_frame, #selenium_functions, #visible?
Methods included from SeleniumWrapperJsErrors
#console_errors, #error_ignored?, #fail_if_console_error, #ignored_errors
Constructor Details
#initialize(instance, tab_xpath: nil, tab_name: 'Default tab name') ⇒ EditorTab
Returns a new instance of EditorTab.
8 9 10 11 12 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 8 def initialize(instance, tab_xpath: nil, tab_name: 'Default tab name') @instance = instance @xpath_insert_tab = tab_xpath @tab_name = tab_name end |
Instance Method Details
#active? ⇒ True, False
Returns if this tab opened.
22 23 24 25 26 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 22 def active? active = get_attribute(@xpath_insert_tab, 'class').include?('active') OnlyofficeLoggerHelper.log("#{@tab_name} Tab active?: #{active}") active end |
#click ⇒ Nothing
Click on tab
30 31 32 33 34 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 30 def click (@xpath_insert_tab) OnlyofficeLoggerHelper.log("Clicked on #{@tab_name} Tab") sleep 2 # timeout for tab animation end |
#close_tooltips ⇒ Nothing
Close tooltips
56 57 58 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 56 def close_tooltips (close_tooltip_xpath) while visible?(tooltip_xpath) end |
#double_click ⇒ Nothing
Double click on tab
38 39 40 41 42 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 38 def double_click selenium_functions(:double_click, @xpath_insert_tab) OnlyofficeLoggerHelper.log("Double Clicked on #{@tab_name} Tab") sleep 2 # need time to toolbar to hide end |
#open(to_open = true) ⇒ Void
Open current tab rubocop disable to not change interface of public method rubocop:disable Style/OptionalBooleanParameter
49 50 51 52 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 49 def open(to_open = true) click if to_open != active? close_tooltips end |
#present? ⇒ True, False
Returns is tab present.
15 16 17 18 19 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb', line 15 def present? result = visible?(@xpath_insert_tab) OnlyofficeLoggerHelper.log("#{@tab_name} Tab present?: #{result}") result end |