Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (38 sloc) 1.935 kb
#!/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 pytest
LOCALES = ['ach', 'af','ak','ar', 'as', 'ast', 'be', 'bg', 'bn-BD', 'bn-IN', 'br', 'bs', 'ca', 'cs', 'csb', 'cy', 'da', 'de', 'el', 'en-GB',
'en-ZA', 'eo', 'es-AR', 'es-CL', 'es-ES', 'es-MX', 'et', 'eu', 'fa', 'ff', 'fi', 'fr', 'fy-NL', 'ga-IE', 'gd', 'gl', 'gu-IN',
'he', 'hi-IN', 'hr', 'hu', 'hy-AM', 'id', 'is', 'it', 'ja', 'kk', 'km', 'kn', 'ko', 'ku', 'lg', 'lij', 'lt', 'lv', 'mai', 'mk',
'ml', 'mn', 'mr', 'nb-NO', 'nl', 'nn-NO', 'nso', 'or', 'pa-IN', 'pl', 'pt-BR', 'pt-PT', 'rm', 'ro', 'ru', 'si', 'sk', 'sl',
'son', 'sq', 'sr', 'sv-SE', 'sw', 'ta', 'ta-LK', 'te', 'th', 'tr', 'uk', 'vi', 'zh-CN', 'zh-TW', 'zu']
OS = ['win', 'linux', 'osx']
def pytest_generate_tests(metafunc):
if 'lang' in metafunc.funcargnames:
metafunc.parametrize('lang', LOCALES)
if 'os' in metafunc.funcargnames:
metafunc.parametrize('os', OS)
def pytest_sessionstart(session):
print session.config.option.base_url
if session.config.option.base_url is None:
raise pytest.UsageError('--baseurl must be specified.')
def pytest_addoption(parser):
parser.addoption("--baseurl",
action='store',
dest='base_url',
metavar='url',
help='base url for the application under test.')
parser.addoption("--product",
action='store',
dest='product',
metavar='str',
default='firefox-latest',
help='product under test')
def pytest_funcarg__testsetup(request):
return TestSetup(request)
class TestSetup(object):
def __init__(self, options):
self.base_url = options.config.option.base_url
self.product = options.config.option.product
Jump to Line
Something went wrong with that request. Please try again.