def signup(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.open_home_page() return fixture
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.open_home_page() fixture.session.ensure_login(username = web_config['username'], password = web_config['password']) return fixture
def app(request): global fixture if fixture is None: fixture = Application() else: if not fixture.is_valid(): fixture = Application() fixture.open_home_page() fixture.session.ensure_login(username="******", password="******") return fixture
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.open_home_page() fixture.session.login(email=web_config["email"], password=web_config["password"]) return fixture
def app(request): global fixture # Объявление глобальной переменной для фикстуры web_config = load_config(request.config.getoption("--target"))["web"] if fixture is None or not fixture.is_valid(): fixture = Application(browser=web_config["browser"], base_url=web_config["baseUrl"]) # Открываем главную страницу в любом случае fixture.open_home_page() # Выполняем логин в любом случае fixture.session.ensure_login(username=web_config["username"], password=web_config["password"]) return fixture
def app(request): global fixture if fixture is None or not fixture.is_valid(): fixture = Application() fixture.open_home_page() return fixture