summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTulio Casagrande <tcasagra@thoughtworks.com>2016-11-30 11:39:16 -0200
committerTulio Casagrande <tcasagra@thoughtworks.com>2016-11-30 11:39:16 -0200
commitcf55bf8e3657a13b230cd56787e0c941b2a596e9 (patch)
treec1a77c37ea0a5263876b5ea6374e3645d46f0185
parentcb95c9442032fc04f4530f2690f22611445c7565 (diff)
Setup browser before_all method
See: https://github.com/pixelated/project-issues/issues/381
-rw-r--r--service/test/functional/features/environment.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/service/test/functional/features/environment.py b/service/test/functional/features/environment.py
index b7dbba3f..ce880a87 100644
--- a/service/test/functional/features/environment.py
+++ b/service/test/functional/features/environment.py
@@ -37,6 +37,11 @@ def start_app_test_client(client, mode):
def before_all(context):
+ context.browser = webdriver.PhantomJS()
+ context.browser.set_window_size(1280, 1024)
+ context.browser.implicitly_wait(DEFAULT_IMPLICIT_WAIT_TIMEOUT_IN_S)
+ context.browser.set_page_load_timeout(60) # wait for data
+
userdata = context.config.userdata
context.homepage_url = userdata.get('homepage_url', 'http://localhost:8889')
context.multi_user_port = userdata.getint('multi_user_port', default=4568)
@@ -57,17 +62,19 @@ def before_all(context):
def after_all(context):
+ context.browser.quit()
context.client.stop()
def before_feature(context, feature):
- context.browser = webdriver.PhantomJS()
- context.browser.set_window_size(1280, 1024)
- context.browser.implicitly_wait(DEFAULT_IMPLICIT_WAIT_TIMEOUT_IN_S)
- context.browser.set_page_load_timeout(60) # wait for data
context.browser.get(context.homepage_url)
+def after_feature(context, feature):
+ cleanup_all_mails(context)
+ context.last_mail = None
+
+
def after_step(context, step):
_debug_on_error(context, step)
_save_screenshot(context, step)
@@ -88,11 +95,6 @@ def _save_screenshot(context, step):
context.browser.save_screenshot(filepath)
-def after_feature(context, feature):
- context.browser.quit()
-
- cleanup_all_mails(context)
- context.last_mail = None
@wait_for(timeout=10.0)