From d305b26f82c353407b312b909a5ed900ea2006dd Mon Sep 17 00:00:00 2001
From: Leah Klearman <lklrmn@gmail.com>
Date: Mon, 20 Aug 2012 14:09:59 -0700
Subject: [PATCH] remove need for --email and --password in bidpom tests

all tests can be run by travis now
---
 automation-tests/browserid/conftest.py         | 15 ---------------
 .../browserid/tests/check_sign_in.py           | 18 ++++++++++--------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/automation-tests/browserid/conftest.py b/automation-tests/browserid/conftest.py
index 048e3efc7..1d7eda7aa 100644
--- a/automation-tests/browserid/conftest.py
+++ b/automation-tests/browserid/conftest.py
@@ -9,21 +9,6 @@ import py
 
 def pytest_runtest_setup(item):
     pytest_mozwebqa = py.test.config.pluginmanager.getplugin('mozwebqa')
-    pytest_mozwebqa.TestSetup.email = item.config.option.email
-    pytest_mozwebqa.TestSetup.password = item.config.option.password
-
-
-def pytest_addoption(parser):
-    group = parser.getgroup('persona', 'persona')
-    group._addoption('--email',
-                     action='store',
-                     metavar='str',
-                     help='email address for persona account')
-    group._addoption('--password',
-                     action='store',
-                     metavar='str',
-                     help='password for persona account')
-
 
 def pytest_funcarg__mozwebqa(request):
     return request.getfuncargvalue('mozwebqa')
diff --git a/automation-tests/browserid/tests/check_sign_in.py b/automation-tests/browserid/tests/check_sign_in.py
index 224d3cc27..c273555cc 100644
--- a/automation-tests/browserid/tests/check_sign_in.py
+++ b/automation-tests/browserid/tests/check_sign_in.py
@@ -17,23 +17,23 @@ import restmail
 @pytest.mark.nondestructive
 class TestSignIn(BaseTest):
 
+    @pytest.mark.travis
     def test_sign_in_helper(self, mozwebqa):
-        if mozwebqa.email == None:
-            pytest.skip("no --email supplied")
+        credentials = mozwebqa.credentials['default']
         browser_id = BrowserID(mozwebqa.selenium, mozwebqa.timeout)
-        browser_id.sign_in(mozwebqa.email, mozwebqa.password)
+        browser_id.sign_in(credentials['email'], credentials['password'])
 
         WebDriverWait(mozwebqa.selenium, mozwebqa.timeout).until(
             lambda s: s.find_element_by_id('loggedin').is_displayed())
 
+    @pytest.mark.travis
     def test_sign_in(self, mozwebqa):
-        if mozwebqa.email == None:
-            pytest.skip("no --email supplied")
+        credentials = mozwebqa.credentials['default']
         from .. pages.sign_in import SignIn
         signin = SignIn(mozwebqa.selenium, mozwebqa.timeout, expect='new')
-        signin.email = mozwebqa.email
+        signin.email = credentials['email']
         signin.click_next(expect='password')
-        signin.password = mozwebqa.password
+        signin.password = credentials['password']
         signin.click_sign_in()
 
         WebDriverWait(mozwebqa.selenium, mozwebqa.timeout).until(
@@ -74,9 +74,11 @@ class TestSignIn(BaseTest):
         WebDriverWait(mozwebqa.selenium, mozwebqa.timeout).until(
             lambda s: s.find_element_by_id('loggedin').is_displayed())
 
+    @pytest.mark.travis
     def test_sign_in_is_this_your_computer(self, mozwebqa):
+        credentials = mozwebqa.credentials['default']
         browser_id = BrowserID(mozwebqa.selenium, mozwebqa.timeout)
-        browser_id.sign_in(mozwebqa.email, mozwebqa.password)
+        browser_id.sign_in(credentials['email'], credentials['password'])
 
         WebDriverWait(mozwebqa.selenium, mozwebqa.timeout).until(
             lambda s: s.find_element_by_id('loggedin').is_displayed())
-- 
GitLab