aboutsummaryrefslogtreecommitdiffstats
path: root/servo
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2017-01-19 18:15:15 +0200
committerFilipp Lepalaan <filipp@mac.com>2017-01-19 18:15:15 +0200
commit0c5eaed74117ef3664ba1646494638f3eca124c1 (patch)
treec59c9d6105fd209622837c8e965bf9bebd984cf4 /servo
parent9fcb963e76d06ca4f659bc052bb46c3d50f155ce (diff)
downloadServo-0c5eaed74117ef3664ba1646494638f3eca124c1.tar.gz
Servo-0c5eaed74117ef3664ba1646494638f3eca124c1.tar.bz2
Servo-0c5eaed74117ef3664ba1646494638f3eca124c1.zip
Added disabled cookies, checkin test
Diffstat (limited to 'servo')
-rw-r--r--servo/tests/test_functional.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/servo/tests/test_functional.py b/servo/tests/test_functional.py
index 201a582..d9fabfb 100644
--- a/servo/tests/test_functional.py
+++ b/servo/tests/test_functional.py
@@ -1,15 +1,18 @@
# -*- coding: utf-8 -*-
+import os
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
-@unittest.skip
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.url = 'http://localhost:8000/checkin/'
- self.browser = webdriver.Firefox()
+ fp = webdriver.FirefoxProfile()
+ if os.getenv('DISABLE_COOKIES'):
+ fp.set_preference('network.cookie.cookieBehavior', 2)
+ self.browser = webdriver.Firefox(firefox_profile=fp)
self.browser.implicitly_wait(3)
self.browser.get(self.url)
@@ -80,7 +83,11 @@ class NewVisitorTest(unittest.TestCase):
def test_can_checkin_sn(self):
# Customer logs in to check-in
- self.assertIn('Service Order Check-In', self.browser.title)
+ if os.getenv('CHECKIN_DISABLED'):
+ self.assertIn('An error occurred', self.browser.title)
+ return
+
+ self.assertIn('Service Order', self.browser.title)
# customer checks warranty status...
snfield = self.browser.find_element_by_id('id_sn')
@@ -104,7 +111,7 @@ class NewVisitorTest(unittest.TestCase):
# Check that it actually worked
btn = self.browser.find_element_by_class_name('btn-large')
- self.assertEqual(btn.text, 'Print')
+ self.assertEqual(btn.text, 'Skapa ny')
if __name__ == '__main__':