Skip to content
Snippets Groups Projects
Commit 17f054c1 authored by Leah Klearman's avatar Leah Klearman
Browse files

replace command line flag with server detecting code

parent eb158dd7
No related branches found
No related tags found
No related merge requests found
#!/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)
......@@ -14,6 +14,16 @@ import pytest
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 @@ class TestChangePassword:
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment