예제 #1
0
def app(request):
    global target
    global fixture
    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["base_url"],
                              gmail="")
        fixture.open_station()
        fixture.session.login_as_admin(userName=target["userName"],
                                       admPass=target["admPass"])
    return fixture