Module: OnlyofficeDocumentserverTestingFramework::PasswordProtectedConversionHelper
- Included in:
- DocTestSiteFunctions
- Defined in:
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb
Overview
Helper to handle password protected files on conversion step
Instance Method Summary collapse
-
#handle_password_protection(password) ⇒ Object
Handle password block.
-
#incorrect_password_shown? ⇒ Boolean
Check if incorrect password warning is shown.
-
#wait_to_check_password ⇒ Nothing
Waits until password is checked.
-
#xpath_enter_password ⇒ String
Xpath of enter button.
-
#xpath_input_password ⇒ String
Xpath of password input.
-
#xpath_password_error ⇒ String
Xpath of error message.
Instance Method Details
#handle_password_protection(password) ⇒ Object
Handle password block
35 36 37 38 39 40 41 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb', line 35 def handle_password_protection(password) @instance.selenium.type_text(xpath_input_password, password) @instance.selenium.click_on_locator(xpath_enter_password) wait_to_check_password @instance.webdriver.webdriver_error("Cannot open file with password: `#{password}`") if incorrect_password_shown? OnlyofficeLoggerHelper.log('Entered password') end |
#incorrect_password_shown? ⇒ Boolean
Returns check if incorrect password warning is shown.
30 31 32 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb', line 30 def incorrect_password_shown? @instance.selenium.element_visible?(xpath_password_error) end |
#wait_to_check_password ⇒ Nothing
Waits until password is checked
23 24 25 26 27 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb', line 23 def wait_to_check_password @instance.webdriver.wait_until(5) do !@instance.webdriver.get_attribute(@xpath_conversion_step, 'class').include?('current') end end |
#xpath_enter_password ⇒ String
Returns xpath of enter button.
12 13 14 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb', line 12 def xpath_enter_password '//div[@id="enterPass"]' end |
#xpath_input_password ⇒ String
Returns xpath of password input.
7 8 9 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb', line 7 def xpath_input_password '//input[@id="filePass"]' end |
#xpath_password_error ⇒ String
Returns xpath of error message.
17 18 19 |
# File 'lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb', line 17 def xpath_password_error '//span[@class="errorPass"]' end |