Module: OnlyofficeDocumentserverTestingFramework::LoaderHelper
- Extended by:
- Gem::Deprecate
- Included in:
- Management
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb
Overview
Module for methods with loader of document
Instance Method Summary collapse
-
#check_2_5_version_error ⇒ Object
Check if any error from DocumentServer v2.5.
-
#error_message_alert ⇒ Object
(also: #get_error_message_alert)
Check for error message 3.0 version.
-
#handle_alert_dialog ⇒ Object
Handle some more alert dialogs.
-
#handle_error ⇒ Object
Handle default error in alert.
Instance Method Details
#check_2_5_version_error ⇒ Object
Check if any error from DocumentServer v2.5
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb', line 7 def check_2_5_version_error @instance.selenium.select_frame(@xpath_iframe, @xpath_iframe_count) = '//div[contains(@class,"x-message-box")]' error_box_xpath = "#{}/div[2]/div[1]/div[2]/span" if @instance.selenium.element_visible?(error_box_xpath) && @instance.selenium.get_style_parameter(, 'left') .gsub('px', '').to_i.positive? error_text = @instance.selenium.get_text(error_box_xpath).tr("\n", ' ') @instance.selenium.webdriver_error("Server Error: #{error_text}") end end |
#error_message_alert ⇒ Object Also known as: get_error_message_alert
Check for error message 3.0 version
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb', line 28 def alert_xpath = "//div[contains(@class,'asc-window modal alert')]" return unless visible?("#{alert_xpath}/div[2]/div[1]/div[2]/span") && selenium_functions(:get_style_parameter, alert_xpath, 'left') .gsub('px', '').to_i.positive? error = selenium_functions(:get_text, "#{alert_xpath}/div[2]/div[1]/div[2]/span").tr("\n", ' ') if error.include?('There are one or more circular references') ("#{@alert_dialog_xpath}//button[@result='ok']") return nil end "Server Error: #{error}" end |
#handle_alert_dialog ⇒ Object
Handle some more alert dialogs
47 48 49 50 51 52 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb', line 47 def handle_alert_dialog return unless @instance.selenium.element_visible?(@alert_dialog_span_xpath) error = @instance.selenium.get_text(@alert_dialog_span_xpath).tr("\n", ' ') @instance.selenium.webdriver_error("Server Error: #{error}") end |
#handle_error ⇒ Object
Handle default error in alert
20 21 22 23 24 25 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb', line 20 def handle_error @instance.selenium.select_top_frame error = @instance.selenium.webdriver_error(error) unless error.nil? @instance.selenium.select_frame(@xpath_iframe, @xpath_iframe_count) end |