Class: OnlyofficeDocumentserverTestingFramework::TestInstanceDocs
- Inherits:
-
Object
- Object
- OnlyofficeDocumentserverTestingFramework::TestInstanceDocs
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb
Overview
Main class for browser instance
Instance Attribute Summary collapse
-
#doc_server_base_url ⇒ String
readonly
Base url of DocumentServer.
-
#selenium ⇒ Object
(also: #webdriver)
Returns the value of attribute selenium.
Instance Method Summary collapse
-
#doc_editor ⇒ DocEditor
Document Editor instance.
-
#doc_service_welcome ⇒ DocServiceWelcome
Welcome page of DocumentServer.
-
#doc_test_functions ⇒ DocTestSiteFunctions
Methods for test site.
-
#env_options ⇒ Hash
Options read from environment variable.
-
#go_to_base_url ⇒ Object
Open DocServer base url page.
-
#initialize(webdriver: OnlyofficeWebdriverWrapper::WebDriver.new(:chrome), doc_server_base_url: nil) ⇒ TestInstanceDocs
constructor
Initialize new instance.
-
#integration_example_api ⇒ IntegrationExampleApi
For methods.
-
#management ⇒ Management
Management methods.
-
#presentation_editor ⇒ PresentationEditor
Editor of presentations.
-
#spreadsheet_editor ⇒ SpreadsheetEditor
Spreadsheet Editor instance.
Constructor Details
#initialize(webdriver: OnlyofficeWebdriverWrapper::WebDriver.new(:chrome), doc_server_base_url: nil) ⇒ TestInstanceDocs
Initialize new instance
24 25 26 27 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 24 def initialize(webdriver: OnlyofficeWebdriverWrapper::WebDriver.new(:chrome), doc_server_base_url: nil) @selenium = webdriver @doc_server_base_url = doc_server_base_url end |
Instance Attribute Details
#doc_server_base_url ⇒ String (readonly)
Returns base url of DocumentServer.
18 19 20 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 18 def doc_server_base_url @doc_server_base_url end |
#selenium ⇒ Object Also known as: webdriver
Returns the value of attribute selenium.
16 17 18 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 16 def selenium @selenium end |
Instance Method Details
#doc_editor ⇒ DocEditor
Returns Document Editor instance.
52 53 54 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 52 def doc_editor @doc_editor ||= DocEditor.new(self) end |
#doc_service_welcome ⇒ DocServiceWelcome
Returns welcome page of DocumentServer.
35 36 37 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 35 def doc_service_welcome @doc_service_welcome ||= DocServiceWelcome.new(self) end |
#doc_test_functions ⇒ DocTestSiteFunctions
Returns methods for test site.
40 41 42 43 44 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 40 def doc_test_functions # Do not cache methods since they use PageObject and cause all sort of troubles # if test run several times with different webdriver DocTestSiteFunctions.new(self) end |
#env_options ⇒ Hash
Returns Options read from environment variable.
72 73 74 75 76 77 78 79 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 72 def return @env_options if @env_options = ENV.fetch('ONLYOFFICE_DS_TESTING_OPTIONS', '{}') @env_options = JSON.parse() @env_options['IgnoredJSErrors'] = [] unless @env_options['IgnoredJSErrors'] @env_options end |
#go_to_base_url ⇒ Object
Open DocServer base url page
30 31 32 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 30 def go_to_base_url webdriver.open(doc_server_base_url) end |
#integration_example_api ⇒ IntegrationExampleApi
Returns for methods.
47 48 49 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 47 def integration_example_api @integration_example_api ||= IntegrationExampleApi.new(self) end |
#management ⇒ Management
Returns management methods.
67 68 69 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 67 def management @management ||= Management.new(self) end |
#presentation_editor ⇒ PresentationEditor
Returns editor of presentations.
62 63 64 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 62 def presentation_editor @presentation_editor ||= PresentationEditor.new(self) end |
#spreadsheet_editor ⇒ SpreadsheetEditor
Returns Spreadsheet Editor instance.
57 58 59 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs.rb', line 57 def spreadsheet_editor @spreadsheet_editor ||= SpreadsheetEditor.new(self) end |