Class: DocServiceWelcome

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_service_welcome.rb

Overview

Class for describing Welcome page of test example

Instance Method Summary collapse

Constructor Details

#initialize(instance) ⇒ DocServiceWelcome

Returns a new instance of DocServiceWelcome.



6
7
8
9
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_service_welcome.rb', line 6

def initialize(instance)
  @instance = instance
  @xpath_test_example = '//a[contains(@href, "/example")]'
end

Instance Method Details

#go_to_exampleNothing

Go to Test Example

Returns:

  • (Nothing)


29
30
31
32
33
34
35
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_service_welcome.rb', line 29

def go_to_example
  wait_load
  @instance.selenium.wait_until_element_visible(@xpath_test_example)
  @instance.selenium.click_on_locator(@xpath_test_example)
  OnlyofficeLoggerHelper.log('Go to test example')
  @instance.doc_test_functions.wait_load
end

#opened?True, False

Returns is welcome page opened.

Returns:

  • (True, False)

    is welcome page opened



21
22
23
24
25
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_service_welcome.rb', line 21

def opened?
  result = @instance.selenium.element_present?(@xpath_test_example)
  OnlyofficeLoggerHelper.log("Current server is a Doc Service Welcome: #{result}")
  result
end

#wait_loadNothing

Waiting for load of page

Returns:

  • (Nothing)


13
14
15
16
17
18
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_service_welcome.rb', line 13

def wait_load
  @instance.webdriver.wait_until do
    opened?
  end
  sleep 1 # Additional wait for load
end