summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-09 14:34:04 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-09 14:34:04 +0200
commit634ade56ff99afcc0f10e9e43eb4487f187a9038 (patch)
tree05165ab43c8888b3879fb80ec03f19ac87ff53a1
parentf28906c1c417800f5823dc937a7671a04d14193c (diff)
Setting up the app for functional tests using soledad test base so we can control the data
-rw-r--r--service/test/functional/features/environment.py25
1 files changed, 25 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
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):