diff --git a/openappstack/__main__.py b/openappstack/__main__.py index d267ed6aa721c13565eba47a7ab0ad3a4cf5bd3e..04400584ebd31d609eef3a2c9cf3f9b44ade742c 100755 --- a/openappstack/__main__.py +++ b/openappstack/__main__.py @@ -68,8 +68,8 @@ def main(): # pylint: disable=too-many-statements,too-many-branches,too-many-lo create_parser.add_argument( '--create-hostname', type=str, - help='hostname of the machine. If not provided for a new machine, a ' - 'hostname is generated.') + help='hostname of the machine. If not provided for a new machine, the ' + 'cluster name is used.') group = create_parser.add_mutually_exclusive_group(required=True) @@ -181,6 +181,13 @@ def main(): # pylint: disable=too-many-statements,too-many-branches,too-many-lo '--behave-headless', action='store_true', help=('Run behave in headless mode')) + test_parser.add_argument( + '--behave-param', + metavar=['PARAM[=VALUE]'], + action='append', + nargs=1, + default=[], + help=('Pass additional behave options (like "-D browser=firefox"')) info_parser = subparsers.add_parser( 'info', @@ -326,6 +333,14 @@ def test(clus, args): for tag in args.behave_tags: log.info(command) command.append('-t {tag}'.format(tag=tag)) + if args.behave_param: + for param in args.behave_param: + if len(param) > 1: + log.warning('More than 1 parameter. Ignoring the rest! ' + 'Use --behave-param several times to supply ' + 'more than 1 parameter') + param = param[0] + command.append(param) log.info('Running behave command %s', command) return_code = behave_main(command) diff --git a/openappstack/cluster.py b/openappstack/cluster.py index 340144270e1beb030c4c6afa79ca65d6f5c7827c..0d6f74baab46e6949cae6f4c7f081a4f4be06758 100644 --- a/openappstack/cluster.py +++ b/openappstack/cluster.py @@ -90,8 +90,7 @@ class Cluster: the cluster name """ if hostname is None: - # Use random generated ID in case we're not running in - # gitlab CI and there's no CI_PIPELINE_ID env var + # If hostname is not set use cluster name for it. hostname = self.name droplet = greenhost_cloud.create_droplet( name=hostname, diff --git a/test/behave/features/grafana.feature b/test/behave/features/grafana.feature index e37fdfecc4c94f3d8ff01409f635747e955dfaa9..ff431d27944c548e7927d6542d21c72602d7b2ab 100644 --- a/test/behave/features/grafana.feature +++ b/test/behave/features/grafana.feature @@ -6,12 +6,15 @@ Feature: Test grafana admin login Scenario: Open grafana When I open the grafana URL Then I wait on element "//input[@name='user']" for 25000ms to be visible + And I expect that the title is "Grafana" And I expect that element "#inputPassword" is visible + And I expect that the path is "/login" Scenario: Login to grafana Given the element "//input[@name='user']" is visible When I enter the "grafana" "username" in the inputfield "//input[@name='user']" And I enter the "grafana" "password" in the inputfield "#inputPassword" And I click on the button "//div[@id='login-view']//button[@type='submit']" - Then I wait on element "/html/body/grafana-app/sidemenu/a" for 25000ms to be visible + Then I wait on element "div.dashboard-header" for 25000ms to be visible + And I expect that the path is "/" And I expect that the title is "Home - Grafana"