Class: OnlyofficeDocumentserverTestingFramework::TopToolbarDocument

Inherits:
Object
  • Object
show all
Includes:
SeleniumWrapper
Defined in:
lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/top_toolbar_document.rb

Overview

More methods for working with top toolbar of document

Instance Method Summary collapse

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) ⇒ TopToolbarDocument

Returns a new instance of TopToolbarDocument.



8
9
10
11
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/top_toolbar_document.rb', line 8

def initialize(instance)
  @instance = instance
  @xpath_document_name = '//*[(@id="rib-doc-name") or (@id="title-doc-name")]'
end

Instance Method Details

#document_nameString

Returns name of the document.

Returns:

  • (String)

    name of the document



14
15
16
17
18
19
20
21
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/top_toolbar_document.rb', line 14

def document_name
  # TODO: use `get_text` before `get_text_by_js`
  #   as soon as https://bugzilla.onlyoffice.com/show_bug.cgi?id=45981 resolved
  # If top toolbar is hidden - cannot get text by WebDriver, use js instead
  text = selenium_functions(:get_text_by_js, @xpath_document_name)
  OnlyofficeLoggerHelper.log("Get document name from header: #{text}")
  text
end