From d6abd906cb64ae68eed3348eba521bc44ebed7b2 Mon Sep 17 00:00:00 2001 From: Varac Date: Fri, 9 Jun 2017 09:40:55 +0200 Subject: [test] Add basic functional login test * Move todo list to https://0xacab.org/leap/bitmask-dev/issues/8929 * use bundled pysqlcipher - debian package has not been fixed yet. * reset bitmaskd for each scenario so they are isolated * run functional tests on CI * moved e2e tests before the bundle * add test_functional_graphical Make target * Install chromedriver in docker image * add screenshots as artifacts on failure * run chrome without sandbox for docker Tests were failing on CI with chrome sandbox: https://0xacab.org/leap/bitmask-dev/-/jobs/15196 Used this workaround: https://stackoverflow.com/questions/28364012/webdriver-exception-chrome-not-reachable/28949227#28949227 - Resolves: #8929 --- tests/functional/features/steps/bitmask.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/functional/features/steps/bitmask.py (limited to 'tests/functional/features/steps/bitmask.py') diff --git a/tests/functional/features/steps/bitmask.py b/tests/functional/features/steps/bitmask.py new file mode 100644 index 0000000..b5b4cf1 --- /dev/null +++ b/tests/functional/features/steps/bitmask.py @@ -0,0 +1,26 @@ +import commands +import shutil +import os +import time +from leap.common.config import get_path_prefix + +from behave import given + + +@given('I start bitmask for the first time') +def initial_run(context): + commands.getoutput('bitmaskctl stop') + # TODO: fix bitmaskctl to only exit once bitmaskd has stopped + time.sleep(2) + _initialize_home_path() + commands.getoutput('bitmaskctl start') + tokenpath = os.path.join(get_path_prefix(), 'leap', 'authtoken') + token = open(tokenpath).read().strip() + context.login_url = "http://localhost:7070/#%s" % token + + +def _initialize_home_path(): + home_path = '/tmp/bitmask-test' + shutil.rmtree(home_path, ignore_errors=True) + os.environ['HOME'] = home_path + os.makedirs(get_path_prefix()) -- cgit v1.2.3