Class: OnlyofficeDocumentserverTestingFramework::CsvOption
- Inherits:
-
TxtOptions
- Object
- TxtOptions
- OnlyofficeDocumentserverTestingFramework::CsvOption
- Extended by:
- Gem::Deprecate
- Includes:
- SeleniumWrapper
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows/csv_option.rb
Overview
Class for CSV window
Constant Summary collapse
- DELIMITER_TYPE =
Returns list of possible csv delimiters.
%i[comma semicolon colon tab space other].freeze
Instance Method Summary collapse
-
#csv_options=(options = {}) ⇒ nil
(also: #set_csv_options)
Set options in csv window.
-
#delimiter ⇒ Object
region CVN Framework.
- #delimiter_select(delimiter_type) ⇒ Object
-
#initialize(instance) ⇒ CsvOption
constructor
A new instance of CsvOption.
-
#other_delimiter ⇒ TextInput
Text input for enter custom delimiter.
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
Methods inherited from TxtOptions
#click_on_cancel, #click_on_ok, #close_warning_loose_data, #dialog_window_opened?, #encoding, #encoding_select, #loose_data_warning_present?, #scroll_encoding_list_to, #txt_options=, #wait_options, #wait_warning
Constructor Details
#initialize(instance) ⇒ CsvOption
Returns a new instance of CsvOption.
8 9 10 11 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows/csv_option.rb', line 8 def initialize(instance) super @xpath_codepage_selector = '//*[contains(text(), "CSV")]/../..//div[@id="id-codepages-combo"]' end |
Instance Method Details
#csv_options=(options = {}) ⇒ nil Also known as: set_csv_options
Set options in csv window
43 44 45 46 47 48 49 50 51 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows/csv_option.rb', line 43 def ( = {}) [:encoding_to_set] ||= 'Unicode (UTF-8)' [:csv_delimiter] ||= :comma return unless dialog_window_opened? encoding_select [:encoding_to_set] delimiter_select [:csv_delimiter] click_on_ok end |
#delimiter ⇒ Object
region CVN Framework
17 18 19 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows/csv_option.rb', line 17 def delimiter BoundComboBoxUl.new(@instance, '//*[@id="id-delimiters-combo"]', nil, 'span') end |
#delimiter_select(delimiter_type) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows/csv_option.rb', line 31 def delimiter_select(delimiter_type) if DELIMITER_TYPE.include?(delimiter_type) delimiter.select_by_number(DELIMITER_TYPE.index(delimiter_type) + 1) else delimiter.select_by_number(DELIMITER_TYPE.index(:other) + 1) other_delimiter.set(delimiter_type) end end |
#other_delimiter ⇒ TextInput
Returns text input for enter custom delimiter.
22 23 24 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows/csv_option.rb', line 22 def other_delimiter @other_delimiter ||= TextInput.new(@instance, '//*[@id="id-delimiter-other"]') end |