Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replace command line flag with server detecting code

  • Loading branch information...
commit 17f054c1cade850d0468278edcdc0c4eafc4510d 1 parent eb158dd
@klrmn klrmn authored
View
25 automation-tests/123done/conftest.py
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import py
-
-def pytest_runtest_setup(item):
- pytest_mozwebqa = py.test.config.pluginmanager.getplugin("mozwebqa")
- pytest_mozwebqa.TestSetup.server_base_url = item.config.option.server_base_url
-
-
-def pytest_addoption(parser):
- parser.addoption("--serverbaseurl",
- action="store",
- dest='server_base_url',
- metavar='str',
- default="https://login.dev.anosrep.org",
- help="specify the server base url")
-
-
-def pytest_funcarg__mozwebqa(request):
- pytest_mozwebqa = py.test.config.pluginmanager.getplugin("mozwebqa")
- return pytest_mozwebqa.TestSetup(request)
View
12 automation-tests/123done/tests/test_change_password.py
@@ -14,6 +14,16 @@
class TestChangePassword:
+ def _persona_server_url(self, mozwebqa):
+ server = None
+ if 'dev' in mozwebqa.base_url:
+ server = 'https://login.dev.anosrep.org'
+ elif 'beta' in mozwebqa.base_url:
+ server = 'https://login.anosrep.org'
+ else:
+ server = 'https://login.persona.org'
+ return server
+
def test_can_change_user_password(self, mozwebqa):
user = MockUser()
home_pg = HomePage(mozwebqa)
@@ -30,7 +40,7 @@ def test_can_change_user_password(self, mozwebqa):
from browserid.pages.complete_registration import CompleteRegistration
CompleteRegistration(mozwebqa.selenium, mozwebqa.timeout, email.verify_user_link)
- mozwebqa.selenium.get(mozwebqa.server_base_url)
+ mozwebqa.selenium.get(self._persona_server_url(mozwebqa))
from browserid.pages.account_manager import AccountManager
account_manager = AccountManager(mozwebqa.selenium, mozwebqa.timeout)
Please sign in to comment.
Something went wrong with that request. Please try again.