Пример #1
0
def app(request):
    global fixture
    global fixtureAuth
    url_param = request.config.getoption("--url")
    if url_param != '':
        with open(request.config.getoption("--target"), 'r') as config_file:
            target = json.load(config_file)
        if url_param == target['baseUrl']:
            fixture = Application(base_url=target['baseUrl'])
            fixtureAuth = ApplicationAuth(base_url=url_param + PREFICS_URL,
                                          mail=target['email'],
                                          password=target['password'])
        else:
            fixture = Application(base_url=url_param + "mobile_api/1.2/")
    request.addfinalizer(fixture.destroy)
    return fixture
Пример #2
0
def app(request):
    global fixture
    global target
    browser = request.config.getoption("--browser")
    web_config = load_config(request.config.getoption("--target"))['web']
    if fixture is None or not fixture.is_valid():
        fixture = Application(browser=browser, base_url=web_config['baseUrl'])
    return fixture
Пример #3
0
def app(request):
    global fixture
    web_config = load_config(request.config.getoption("--target"))["web"]
    browser = request.config.getoption("--browser")
    if fixture is None or not fixture.is_valid():
        fixture = Application(browser=browser, base_url=web_config['baseURL'])
    fixture.session.ensure_login(username=web_config['username'], password=web_config['password'])
    return fixture
Пример #4
0
def app(request):
    global fixture
    browser = request.config.getoption('--browser')
    web_config = load_config(request.config.getoption('--target'))['web']

    if fixture is None or not fixture.is_valid():
        fixture = Application(browser=browser, base_url=web_config['baseURL'])
    fixture.session.ensure_login(login=web_config['login'],
                                 password=web_config['password'])
    return fixture
Пример #5
0
def app(request):
    global fixture
    browser = request.config.getoption('--browser')
    web_config = load_config(request.config.getoption("--target"))['web']
    if fixture is None or not fixture.is_valid():
        fixture = Application(
            browser=browser,
            base_url=web_config["BaseURL"])  # Инициалзизация фикстуры
    fixture.session.ensure_login(web_config["username"],
                                 web_config["password"])
    return fixture
Пример #6
0
def app(request):

    global fixture
    global target
    browser = request.config.getoption("--browser")
    if target is None:
        config_file = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                   request.config.getoption("--target"))
        with open(config_file) as f:
            target = json.load(f)
    if fixture is None or not fixture.is_valid():
        fixture = Application(browser=browser, base_url=target['baseUrl'])
    fixture.session.ensure_login(username=target['username'],
                                 password=target['password'])
    return fixture
Пример #7
0
def app(request, config):
    global fixture
    browser = request.config.getoption("--browser")
    if fixture is None or not fixture.is_valid():
        fixture = Application(browser=browser, config=config)
    return fixture
Пример #8
0
def app(request):
    fixture = Application()
    request.addfinalizer(fixture.destroy)
    return fixture