本文整理汇总了Python中tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods.get_element_navigate方法的典型用法代码示例。如果您正苦于以下问题:Python HelpNavigateCheckMethods.get_element_navigate方法的具体用法?Python HelpNavigateCheckMethods.get_element_navigate怎么用?Python HelpNavigateCheckMethods.get_element_navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods
的用法示例。
在下文中一共展示了HelpNavigateCheckMethods.get_element_navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_authorization_by_phone_incorrect_user_disabled
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def test_authorization_by_phone_incorrect_user_disabled(self, type_password="CORRECT"):
"""
Title: Я не могу войти в систему по телефону, если мой пользователь в статусе DISABLED
(пользователь Заблокирован)
Description:
* Отображается соответствующее сообщение
"""
service_log.run(self)
status = "DISABLED"
user = databases.db1.accounting.get_not_enabled_user(status=status)[0]
AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"])
# Устанавливаем новый пароль для пользователя
default_new_passwd = AccountingMethods.get_default_password()
hash_res_new = generate_sha256(default_new_passwd, user["salt"])
databases.db1.accounting.update_user_password(user["id"], hash_res_new)
# Переходим на страницу авторизации
self.go_authorization_page(self.driver)
obj_phone, obj_password, obj_submit_button = self.get_data_authorization(self.driver)
changed_passwd = self.get_password(type_passwd=type_password, source_passwd=default_new_passwd)
changed_phone = self.get_phone(type_phone=self.type_phone, source_phone=user["phone"])
# Вводим данные на авторизацию
self.send_password(password_object=obj_password, password_number=changed_passwd)
self.send_phone(phone_object=obj_phone, phone_number=changed_phone)
# Нажатие на кнопку авторизации
self.submit_button(obj_submit_button)
# Проверка блокировки пользователя
Navigate.get_element_navigate(self.driver, self.check_auth.ERR_CHECK_DISABLED)
Navigate.go_to_main_page(self.driver)
self.check_header_widget_visitor(self.driver)
示例2: get_user_card_web_status
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_user_card_web_status(driver, web_status_xpath, user_info, online_status='В сети'):
if user_info["online_status"] == 'ONLINE':
p = Navigate.get_element_navigate(driver, web_status_xpath % online_status)
else:
p = Navigate.get_element_navigate(driver, web_status_xpath %
HelpUserCardMethods.need_time(user_info['last_activity_timestamp']))
return p
示例3: check_main_menu_category
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def check_main_menu_category(self, driver, section_tree, category_dict):
""" Проверка категорий и их картинок в меню раздела
"""
for section in section_tree:
section_name = section.localizedName
if section_name == 'Торговое оборудование':
continue
# Кликаем на раздел, чтобы открыть меню раздела
section_clk_menu = Navigate.get_element_navigate(driver, self.xpath_section % section_name, mode=None)
Auth.click_button(section_clk_menu)
# Проверка, что раздел стал открытым
Navigate.get_element_navigate(driver, self.xpath_section_menu % section_name, mode=None)
# Проверка, что открылось меню раздела
Navigate.get_element_navigate(driver, Navigate.check_main.SECTION_MENU, mode=None)
# Получаем категории раздела
category_id_list = self.get_categories_list(section)
category_tree = self.get_categories_tree(category_dict, category_id_list)
cat_name_list = [category.localizedName for category in category_tree]
# Получить объекты категорий меню
cat_iu_list = self.get_categories(driver)
name_ui_list = [category.text.encode('utf-8') for category in cat_iu_list]
# Проверка количества возвращенных апи и показанных категорий
count_ui_cat = len(cat_iu_list)
count_db_cat = len(category_tree)
err_msg = "Количество разделов в главном меню='%d' больше с количества разделов из БД='%d'"
self.assertLessEqual(count_ui_cat, count_db_cat, err_msg % (count_ui_cat, count_db_cat))
sub = lambda db, ui: filter(lambda x: x not in db, ui)
# Берем максимум 6 категорий отображаемых в меню
name_ui = name_ui_list[:6]
sub_cat = sub(cat_name_list, name_ui)
err_msg = "В разделе '%s' содержится категория '%s', которой нет в ответе АПИ: %s"
self.assertFalse(sub_cat, err_msg % (section_name, sub_cat, cat_name_list))
示例4: get_user_store_photo_in_cont
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_user_store_photo_in_cont(driver, path, photo_xpath, logo_id):
if logo_id is None:
p = Navigate.get_element_navigate(driver, path + Navigate.check_user_contact.US_LOGO_STUB, sleep=0.1,
mode=None)
else:
p = Navigate.get_element_navigate(driver, path + photo_xpath % logo_id, sleep=0.1, mode=None)
return p
示例5: get_sub_categories
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_sub_categories(driver):
"""
Получить под-категории из категории раздела
:param driver:
:return:
"""
Navigate.get_element_navigate(driver, Navigate.check_main.MAIN_MENU_SUB_CATEGORY, mode=None)
return driver.find_elements_by_xpath(Navigate.check_main.MAIN_MENU_SUB_CATEGORY_ABSTRACT)
示例6: get_user_store_name
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_user_store_name(driver, path, name_xpath, name):
if name is None:
p = Navigate.get_element_navigate(driver, path + Navigate.check_user_contact.US_WITHOUT_NAME, sleep=0.1,
mode=None)
else:
Navigate.get_element_navigate(driver, path + Navigate.check_user_contact.US_LABEL_NAME, sleep=0.1, mode=None)
p = Navigate.get_element_navigate(driver, path + name_xpath % name, sleep=0.1, mode=None)
return p
示例7: check_no_add_contact_btn
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def check_no_add_contact_btn(self, driver):
f = False
try:
Navigate.get_element_navigate(driver, Navigate.click_user_contact.BTN_ADD_CONTACT, mode=None, sleep=0.1)
f = True
except Exception:
pass
self.assertFalse(f, "Появилась кнопка добавить пользователя")
示例8: check_form_create_user
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def check_form_create_user(self, driver):
"""
Проверка формы Создание пользователя в бэк-офисе
:param driver:
:return:
"""
for title in self.USER_FORM_TITLES:
HNCK.get_element_navigate(driver, HNCK.check_back_users.NAME_FIELDS % title)
示例9: get_back_auth_data
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_back_auth_data(driver):
"""
Получение форм и кнопки войти на странице авторизации бэк-офиса
:param driver:
:return:
"""
obj_login = HNCK.get_element_navigate(driver, HNCK.input_back_auth.FORM_LOGIN)
obj_pass = HNCK.get_element_navigate(driver, HNCK.input_back_auth.FORM_PASS)
obj_submit = HNCK.get_element_navigate(driver, HNCK.click_back_auth.BTN_SUBMIT)
return obj_login, obj_pass, obj_submit
示例10: get_sent_success_btn
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_sent_success_btn(driver):
"""
Получить объекты кнопок На страницу товара и В чат
Проверка сообщения об успешной отправке
:param driver:
:return:
"""
Navigate.get_element_navigate(driver, Navigate.check_good.MSG_SENT_SUCCESS, mode=None)
btn_to_good = Navigate.get_element_navigate(driver, Navigate.click_good.BTN_TO_CARD_GOOD, mode=None)
btn_to_chat = Navigate.get_element_navigate(driver, Navigate.click_good.BTN_TO_CHAT, mode=None)
return btn_to_good, btn_to_chat
示例11: check_card_user_in_search_contact
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def check_card_user_in_search_contact(self, driver, user):
path_fg = Navigate.check_user_contact.USER_IN_SEARCH
service_log.put("Start checking user card in search contact by user_id='%s'" % user["id"])
Navigate.get_element_navigate(driver, path_fg, mode=None, e_msg="Не найдена карточка пользователя в поисковй выдаче")
self.get_user_card_photo_in_cont(driver, path_fg, Navigate.check_user_contact.FU_USER_PHOTO_IN_SEARCH,
user["avatar_id"])
HelpUserCardCheckMethods.get_user_card_name(driver, path_fg + Navigate.check_user_contact.FU_USER_NAME,
user["display_name"])
HelpUserCardCheckMethods.get_user_card_on_off_line(driver, path_fg + Navigate.check_user_contact.FU_USER_STATUS,
user)
service_log.put("Success checking user card in search contact by user_id='%s'" % user["id"])
示例12: get_all_fields
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_all_fields(driver):
"""
Получить все input объекты формы обратной связи
:return:
"""
obj = dict()
obj['name'] = HNCM.get_element_navigate(driver, HNCM.input_contacts.NAME)
obj['phone'] = HNCM.get_element_navigate(driver, HNCM.input_contacts.PHONE)
obj['email'] = HNCM.get_element_navigate(driver, HNCM.input_contacts.EMAIL)
obj['message'] = HNCM.get_element_navigate(driver, HNCM.input_contacts.MESSAGE)
return obj
示例13: do_login
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def do_login(driver, sleep=2):
""" Авторизоваться нажав на кнопку с текущей страницы.
:param driver: ссылка на драйвер
:param sleep: ожидание
"""
# time.sleep(sleep)
reg_log_btn = HelpNavigateCheckMethods.get_element_navigate(driver, HelpAuthData.click_main.BUTTON_REG_AN_LOGIN)
HelpAuthCheckMethods.click_button(reg_log_btn)
login_button = HelpNavigateCheckMethods.get_element_navigate(driver, HelpAuthData.click_main.BUTTON_LOGIN)
login_button.is_displayed()
login_button.is_enabled()
HelpNavigateCheckMethods.element_click(driver, login_button)
示例14: get_restore_password_by_email_success
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_restore_password_by_email_success(driver):
""" Получить элементы формы восстановления пароля по емайл, письмо тправлено
:param driver: ссылка на драйвер
:return: словарь со ссылками на элементы формы восстановления пароля
"""
restore_email = {
"restore_title": Navigate.get_element_navigate(driver, Navigate.check_restore.TITLE_INPUT_PASS_PAGE),
"restore_text": Navigate.get_element_navigate(driver, Navigate.check_restore.TEXT_NEW_PASS_SET),
"start_work_btn": Navigate.get_element_navigate(driver, Navigate.click_restore.BTN_START_WORK),
}
service_log.put("Get elements form restore %s" % str(restore_email))
return restore_email
示例15: get_restore_email_sent_form
# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import get_element_navigate [as 别名]
def get_restore_email_sent_form(driver):
""" Получить элементы формы восстановления пароля по емайл, письмо тправлено
:param driver: ссылка на драйвер
:return: словарь со ссылками на элементы формы восстановления пароля
"""
restore_email = {
"restore_title": Navigate.get_element_navigate(driver, Navigate.check_restore.TITLE_RESTORE_PAGE),
"restore_text": Navigate.get_element_navigate(driver, Navigate.check_restore.TEXT_SENT_TO_EMAIL),
"to_main_btn": Navigate.get_element_navigate(driver, Navigate.click_restore.BTN_TO_MAIN),
}
service_log.put("Get elements form restore %s" % str(restore_email))
return restore_email