Skip to content
Snippets Groups Projects
Verified Commit 43d9474d authored by Varac's avatar Varac
Browse files

Changes from review of !107

parent 2b762539
No related branches found
No related tags found
No related merge requests found
......@@ -35,36 +35,27 @@ def before_all(context):
def before_tag(context, tag):
def get_values(app):
values = {}
values['url'] = userdata.get(app + '.url')
values['username'] = \
userdata.get(app + '.username', 'admin')
values['password'] = \
userdata.get(app + '.password')
assert values['url'], '{0}.url variable missing in' \
'userdata. Provide it with "-D {0}.url".'.format(app)
assert values['username'], '{0}.username variable missing in' \
'userdata. Provide it with "-D {0}.username".'.format(app)
assert values['password'], '{0}.password variable missing in' \
'userdata. Provide it with "-D {0}.password".'.format(app)
return(values)
userdata = context.config.userdata
if tag == 'grafana':
context.grafana = {}
context.grafana['url'] = userdata.get('grafana.url')
context.grafana['username'] = \
userdata.get('grafana.username', 'admin')
context.grafana['password'] = \
userdata.get('grafana.password')
assert context.grafana['url'], 'grafana url variable missing in' \
'userdata. Provide it with "-D grafana.url".'
assert context.grafana['username'], 'grafana username variable' \
'missing in userdata. Provide it with "-D grafana.username".'
assert context.grafana['password'], 'grafana password variable' \
'missing in userdata. Provide it with "-D grafana.password".'
context.grafana = get_values('grafana')
if tag == 'nextcloud':
context.nextcloud = {}
context.nextcloud['url'] = userdata.get('nextcloud.url')
context.nextcloud['username'] = \
userdata.get('nextcloud.username', 'admin')
context.nextcloud['password'] = \
userdata.get('nextcloud.password')
assert context.nextcloud['url'], 'Nextcloud url variable missing in' \
'userdata. Provide it with "-D nextcloud.url".'
assert context.nextcloud['username'], 'Nextcloud username variable' \
'missing in userdata. Provide it with "-D nextcloud.username".'
assert context.nextcloud['password'], 'Nextcloud password variable' \
'missing in userdata. Provide it with "-D nextcloud.password".'
context.grafana = get_values('nextcloud')
......
......@@ -6,14 +6,14 @@ from behave_webdriver.steps import *
@when(u'I open the nextcloud URL')
@given(u'I open the nextcloud URL')
def step_impl(context):
"""Login to nextcloud."""
"""Open nextcloud URL."""
context.behave_driver.get(context.nextcloud['url'])
@when(u'I open the grafana URL')
@given(u'I open the grafana URL')
def step_impl(context):
"""Login to grafana."""
"""Open grafana URL."""
context.behave_driver.get(context.grafana['url'])
......
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