Skip to content
Snippets Groups Projects
Unverified Commit ebe28ef1 authored by Varac's avatar Varac
Browse files

Test Onlyoffice Nextcloud integration

Fixes: #725
parent 80dc43a8
Branches
Tags
No related merge requests found
......@@ -32,7 +32,7 @@ Scenario: Create a new document in OnlyOffice
When I click on the element "[aria-label='Files']"
# Unfortunaty there's no check if the element that's already visible
# is also clickable.
And I pause for 5000ms
And I wait on element "[class='button new']" to be clickable
And I click on the button "[class='button new']"
And I click on the element "[data-action='onlyofficeDocx']"
And I add a random string to the inputfield ".filenameform input[type=text]"
......@@ -40,4 +40,14 @@ Scenario: Create a new document in OnlyOffice
And I focus the last opened tab
Then I expect a new tab has been opened
And I expect that element "div.toast-error" does not exist
And I wait on element "iframe[name='frameEditor']" for 20000ms to be visible
Scenario: Assert the bold button is not activated
When I wait for the iframe named "frameEditor" and switch to it
Then I wait on element "div.asc-loadmask" for 20000ms to be visible
And I wait on element "div.asc-loadmask" for 20000ms to not exist
And I wait on element "[id='id-toolbar-btn-bold']" for 20000ms to be visible
And I expect that element "[id='id-toolbar-btn-bold']" does not have the class "active"
Scenario: Active the bold button
When I click on the element "[id='id-toolbar-btn-bold']"
Then I expect that element "[id='id-toolbar-btn-bold']" has the class "active"
from oas_behave.common_steps import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
@when(u'I open the rocketchat URL')
@given(u'I open the rocketchat URL')
......@@ -21,3 +23,16 @@ def step_impl(context):
print(eventrouter_url)
context.behave_driver.get(eventrouter_url)
@when(u'I wait on element "{element}" to be clickable')
@given(u'I wait on element "{element}" to be clickable')
def step_impl(context, element):
"""Wait for element ro be clickable."""
wait = WebDriverWait(context.behave_driver, 30)
wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "button.new")))
@when(u'I wait for the iframe named "{name}" and switch to it')
@given(u'I wait for the iframe named "{name}" and switch to it')
def step_impl(context, name):
"""Wait for the iframe with given name and switch to it."""
wait = WebDriverWait(context.behave_driver, 30)
wait.until(EC.frame_to_be_available_and_switch_to_it((By.NAME, name)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment