Class: DocTestSiteFileListEntry
- Inherits:
-
Object
- Object
- DocTestSiteFileListEntry
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb
Overview
Class for single entry of file in doc test site
Instance Attribute Summary collapse
-
#comment_mode_url ⇒ String
Comment mode url.
-
#embedded_url ⇒ String
Url of embedded mode.
-
#file_name ⇒ String
Name of file.
-
#fill_forms_mode_url ⇒ String
readonly
Fill forms mode url.
-
#only_fill_forms_mode_url ⇒ String
readonly
Only fill forms mode url.
-
#review_mode_url ⇒ String
Review mode url.
-
#view_mode_url ⇒ String
View mode url.
Instance Method Summary collapse
-
#==(other) ⇒ True, False
Compare two DocTestSiteFileListEntry.
-
#fetch_comment_mode_url ⇒ String
Url on review mode.
-
#fetch_embedded_url ⇒ String
Url on embedded file.
-
#fetch_file_name ⇒ String
Name of file.
-
#fetch_fill_forms_mode_url ⇒ String
Url on fill forms mode.
-
#fetch_only_fill_forms_mode_url ⇒ String
Url on fill forms mode.
-
#fetch_review_mode_url ⇒ String
Url on review mode.
-
#fetch_view_mode_url ⇒ String
Url on viewer mode.
-
#initialize(instance, xpath, edit_modes_indexes) ⇒ DocTestSiteFileListEntry
constructor
A new instance of DocTestSiteFileListEntry.
Constructor Details
#initialize(instance, xpath, edit_modes_indexes) ⇒ DocTestSiteFileListEntry
Returns a new instance of DocTestSiteFileListEntry.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 21 def initialize(instance, xpath, edit_modes_indexes) @instance = instance @xpath_line = xpath @edit_modes_indexes = edit_modes_indexes @file_name = fetch_file_name @embedded_url = @review_mode_url = fetch_review_mode_url @comment_mode_url = fetch_comment_mode_url @fill_forms_mode_url = fetch_fill_forms_mode_url @view_mode_url = fetch_view_mode_url end |
Instance Attribute Details
#comment_mode_url ⇒ String
Returns Comment mode url.
13 14 15 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 13 def comment_mode_url @comment_mode_url end |
#embedded_url ⇒ String
Returns url of embedded mode.
9 10 11 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 9 def @embedded_url end |
#file_name ⇒ String
Returns name of file.
7 8 9 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 7 def file_name @file_name end |
#fill_forms_mode_url ⇒ String (readonly)
Returns Fill forms mode url.
15 16 17 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 15 def fill_forms_mode_url @fill_forms_mode_url end |
#only_fill_forms_mode_url ⇒ String (readonly)
Returns Only fill forms mode url.
17 18 19 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 17 def only_fill_forms_mode_url @only_fill_forms_mode_url end |
#review_mode_url ⇒ String
Returns Review mode url.
11 12 13 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 11 def review_mode_url @review_mode_url end |
#view_mode_url ⇒ String
Returns View mode url.
19 20 21 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 19 def view_mode_url @view_mode_url end |
Instance Method Details
#==(other) ⇒ True, False
Compare two DocTestSiteFileListEntry
35 36 37 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 35 def ==(other) @file_name == other.file_name end |
#fetch_comment_mode_url ⇒ String
Returns url on review mode.
57 58 59 60 61 62 63 64 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 57 def fetch_comment_mode_url xpath_comment = "#{@xpath_line}/td[#{@edit_modes_indexes[:comment_mode]}]/a" return nil unless @instance.selenium.element_present?(xpath_comment) url = @instance.selenium.get_attribute(xpath_comment, 'href') OnlyofficeLoggerHelper.log("Got comment mode #{@xpath_line} url: #{url}") url end |
#fetch_embedded_url ⇒ String
Returns url on embedded file.
97 98 99 100 101 102 103 104 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 97 def = "#{@xpath_line}/td[#{@edit_modes_indexes[:embedded]}]/a" return nil unless @instance.selenium.element_present?() url = @instance.selenium.get_attribute(, 'href') OnlyofficeLoggerHelper.log("Got embedded #{@xpath_line} url: #{url}") url end |
#fetch_file_name ⇒ String
Returns name of file.
40 41 42 43 44 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 40 def fetch_file_name text = @instance.selenium.get_text("#{@xpath_line}/td/a[1]/span") OnlyofficeLoggerHelper.log("Got filename #{@xpath_line} name: #{text}") text end |
#fetch_fill_forms_mode_url ⇒ String
Returns url on fill forms mode.
67 68 69 70 71 72 73 74 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 67 def fetch_fill_forms_mode_url xpath_comment = "#{@xpath_line}/td[#{@edit_modes_indexes[:fill_forms]}]/a" return nil unless @instance.selenium.element_present?(xpath_comment) url = @instance.selenium.get_attribute(xpath_comment, 'href') OnlyofficeLoggerHelper.log("Got fill forms mode #{@xpath_line} url: #{url}") url end |
#fetch_only_fill_forms_mode_url ⇒ String
Returns url on fill forms mode.
77 78 79 80 81 82 83 84 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 77 def fetch_only_fill_forms_mode_url link_xpath = "#{@xpath_line}/td[#{@edit_modes_indexes[:only_fill_forms]}]/a" return nil unless @instance.selenium.element_present?(link_xpath) url = @instance.selenium.get_attribute(link_xpath, 'href') OnlyofficeLoggerHelper.log("Got only fill forms mode #{@xpath_line} url: #{url}") url end |
#fetch_review_mode_url ⇒ String
Returns url on review mode.
47 48 49 50 51 52 53 54 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 47 def fetch_review_mode_url xpath_review = "#{@xpath_line}/td[#{@edit_modes_indexes[:review_mode]}]/a" return nil unless @instance.selenium.element_present?(xpath_review) url = @instance.selenium.get_attribute(xpath_review, 'href') OnlyofficeLoggerHelper.log("Got review mode #{@xpath_line} url: #{url}") url end |
#fetch_view_mode_url ⇒ String
Returns url on viewer mode.
87 88 89 90 91 92 93 94 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb', line 87 def fetch_view_mode_url xpath_comments = "#{@xpath_line}/td[#{@edit_modes_indexes[:view_mode]}]/a" return nil unless @instance.selenium.element_present?(xpath_comments) url = @instance.selenium.get_attribute(xpath_comments, 'href') OnlyofficeLoggerHelper.log("Got view mode #{@xpath_line} url: #{url}") url end |