From 634ade56ff99afcc0f10e9e43eb4487f187a9038 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Thu, 9 Oct 2014 14:34:04 +0200 Subject: Setting up the app for functional tests using soledad test base so we can control the data --- service/test/functional/features/environment.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'service/test/functional') diff --git a/service/test/functional/features/environment.py b/service/test/functional/features/environment.py index c4f80872..db4aea9b 100644 --- a/service/test/functional/features/environment.py +++ b/service/test/functional/features/environment.py @@ -14,6 +14,31 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . from selenium import webdriver +from test.support.integration_helper import SoledadTestBase +import time +import pixelated.user_agent +import multiprocessing + + +def before_all(context): + context.soledad_test_base = SoledadTestBase() + context.soledad_test_base.setup_soledad() + + context.mailboxes = context.soledad_test_base.pixelated_mailboxes + context.app = pixelated.user_agent.app + context.app.mail_service = context.soledad_test_base.mail_service + + worker = lambda app, port: pixelated.user_agent.app.run(port=4567, use_reloader=False) + context._process = multiprocessing.Process(target=worker, args=(context.app, 4567)) + context._process.start() + + # we must wait the server start listening + time.sleep(1) + + +def after_all(context): + context.soledad_test_base.teardown_soledad() + context._process.terminate() def before_feature(context, feature): -- cgit v1.2.3