Skip to content
Snippets Groups Projects
Verified Commit 1cf7eb07 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

fix both the behave return code and the failing tests

parent 744f93a9
No related branches found
No related tags found
No related merge requests found
...@@ -296,11 +296,12 @@ def test(clus, args): ...@@ -296,11 +296,12 @@ def test(clus, args):
log.info(command) log.info(command)
command.append('-t {tag}'.format(tag=tag)) command.append('-t {tag}'.format(tag=tag))
log.info('Running behave command %s', command) log.info('Running behave command %s', command)
behave_main(command) return_code = behave_main(command)
# Remove behave.ini so we don't leave secrets hanging around. # Remove behave.ini so we don't leave secrets hanging around.
os.remove(behave_ini) os.remove(behave_ini)
sys.exit(return_code)
def create_domain_records(domain, droplet_ip, subdomain=None): def create_domain_records(domain, droplet_ip, subdomain=None):
""" """
......
...@@ -199,7 +199,6 @@ class Cluster: ...@@ -199,7 +199,6 @@ class Cluster:
behave_config['behave.userdata']['nextcloud.username'] = 'admin' behave_config['behave.userdata']['nextcloud.username'] = 'admin'
behave_config['behave.userdata']['nextcloud.password'] = \ behave_config['behave.userdata']['nextcloud.password'] = \
nextcloud_admin_password nextcloud_admin_password
behave_config['behave.userdata']['onlyoffice.url'] = \ behave_config['behave.userdata']['onlyoffice.url'] = \
'https://office.{}/welcome'.format(self.domain) 'https://office.{}/welcome'.format(self.domain)
......
...@@ -4,6 +4,11 @@ Feature: Test nextcloud admin login ...@@ -4,6 +4,11 @@ Feature: Test nextcloud admin login
I want to be able to login to nextcloud as the user admin I want to be able to login to nextcloud as the user admin
And I want to be able to open a document in OnlyOffice And I want to be able to open a document in OnlyOffice
Scenario: Test OnlyOffice welcome screen
When I open the onlyoffice URL
Then I expect that element "#status-ok-icon" is visible
Scenario: Open nextcloud Scenario: Open nextcloud
When I open the nextcloud URL When I open the nextcloud URL
Then I wait on element "input#user" for 25000ms to be visible Then I wait on element "input#user" for 25000ms to be visible
...@@ -22,10 +27,7 @@ Scenario: Login to nextcloud ...@@ -22,10 +27,7 @@ Scenario: Login to nextcloud
Scenario: Close welcome to nextcloud modal Scenario: Close welcome to nextcloud modal
When I close the nextcloud welcome wizard if it exists When I close the nextcloud welcome wizard if it exists
Then I wait on element "#firstrunwizard" for 1000ms to not exist Then I wait on element "#firstrunwizard" for 1000ms to not exist
And I wait on element ".actions a.button.new" for 5000ms to be visible
Scenario: Test OnlyOffice welcome screen
When I open the onlyoffice URL
Then I expect that element "#status-ok-icon" is visible
Scenario: Create a new document in OnlyOffice Scenario: Create a new document in OnlyOffice
When I click on the element ".actions a.button.new" When I click on the element ".actions a.button.new"
......
...@@ -10,6 +10,13 @@ from behave_webdriver.steps import * ...@@ -10,6 +10,13 @@ from behave_webdriver.steps import *
def before_all(context): def before_all(context):
pass # login and save cookies here pass # login and save cookies here
@when(u'I open the onlyoffice URL')
@given(u'I open the onlyoffice URL')
def step_impl(context):
"""Open onlyoffice URL."""
print(context.nextcloud)
context.behave_driver.get(context.config.userdata.get('onlyoffice.url'))
@when(u'I open the nextcloud URL') @when(u'I open the nextcloud URL')
@given(u'I open the nextcloud URL') @given(u'I open the nextcloud URL')
def step_impl(context): def step_impl(context):
...@@ -23,13 +30,6 @@ def step_impl(context): ...@@ -23,13 +30,6 @@ def step_impl(context):
"""Open grafana URL.""" """Open grafana URL."""
context.behave_driver.get(context.grafana['url']) context.behave_driver.get(context.grafana['url'])
@when(u'I open the onlyoffice URL')
@given(u'I open the onlyoffice URL')
def step_impl(context):
"""Open onlyoffice URL."""
context.behave_driver.get(context.onlyoffice['url'])
@when(u'I enter the "{section}" "{cred_type}" in the inputfield "{element}"') @when(u'I enter the "{section}" "{cred_type}" in the inputfield "{element}"')
def step_impl(context, section, cred_type, element): def step_impl(context, section, cred_type, element):
"""Enter username/password into login inputfields.""" """Enter username/password into login inputfields."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment