当前位置: 首页>>代码示例>>Python>>正文


Python HelpNavigateCheckMethods.element_is_none方法代码示例

本文整理汇总了Python中tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods.element_is_none方法的典型用法代码示例。如果您正苦于以下问题:Python HelpNavigateCheckMethods.element_is_none方法的具体用法?Python HelpNavigateCheckMethods.element_is_none怎么用?Python HelpNavigateCheckMethods.element_is_none使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods的用法示例。


在下文中一共展示了HelpNavigateCheckMethods.element_is_none方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pagination

# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import element_is_none [as 别名]
 def pagination(self, driver, count, section_xpath, items_in_page=40, e_msg=''):
     """
     Проверка пагинации
     :param driver:
     :param count:
     :param section_xpath:
     :param e_msg:
     :return:
     """
     current_page = 1
     all_pages = int(math.ceil(int(count) / (items_in_page + 0.0)))
     remaining_pages = all_pages - current_page
     if remaining_pages == 0:
         Navigate.element_is_none(driver, Navigate.click_search.PAG_PAGE % current_page)
         obj_on_page = Navigate.elements_is_present(driver, section_xpath)
         on_page = len(obj_on_page)
         self.assertEqual(count, on_page, e_msg)
     elif remaining_pages >= 1:
         count_on_pages = 0
         while remaining_pages >= 0:
             obj_on_page = Navigate.elements_is_present(driver, section_xpath)
             on_page = len(obj_on_page)
             next_page = current_page + 1
             if remaining_pages != 0:
                 self.assertEqual(items_in_page, on_page, e_msg)
                 Navigate.element_click(driver, Navigate.click_search.PAG_PAGE % next_page)
             else:
                 self.assertEqual(count-count_on_pages, on_page, e_msg)
             count_on_pages += on_page
             current_page += 1
             remaining_pages -= 1
         self.assertEqual(count, count_on_pages, e_msg)
     else:
         self.assertGreaterEqual(remaining_pages, 0, "Кол-во оставшихся страниц [%s] отрицательно" % remaining_pages)
开发者ID:Maksim1988,项目名称:test,代码行数:36,代码来源:class_search.py

示例2: check_page_authorization

# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import element_is_none [as 别名]
    def check_page_authorization(self, driver):
        """ TestRail: C-27 Внешний вид страницы Авторизации (wide)
        http://test-rails.oorraa.pro/index.php?/cases/view/27
        :param driver: ссылка на дравер
        """

        list_check1 = [#self.check_auth.TITLE_AUTH_PAGE,
                       #self.check_auth.HEADER,  # проверка header.
                       self.check_auth.LOGO,  # проверка логотипа.
                       self.check_auth.FORM_AUTH,  # проверка формы авторизации
                       self.check_auth.FORM_PHONE,  # проверка формы Моб.телефон
                       self.check_auth.FORM_PASS,  # проверка формы Пароль
                       self.check_auth.BTN_RESTORE,  # проверка кнопки Забыли пароль
                       #self.check_auth.BLC_RIGHT,  # блок справа "Впервые на УУРРАА? Регистрация"
                       #self.check_auth.TITLE_RIGHT,  # проверка загловка 'Впервые на УУРРАА?'
                       #self.check_auth.TITLE_BLC,  # загловк 'Впервые на УУРРАА?'
                       self.check_auth.BTN_REGISTRATION,  # проверка кнопки Регистрация
                       self.check_auth.FOOTER,  # проверка подвала
                       self.check_auth.INPUT_PHONE,
                       self.check_auth.INPUT_PASS,
                       self.check_auth.BTN_LOGIN
        ]

        list_check2 = ["//input[@class='search__input']",  # проверка отсутствия поиска
                       "//ul[@class='cat__list']",  # проверка отсутствия 6 рутовых категорий
                       "//nav[@class='cat']",  # проверка отсутствия Каталог товаров
        ]

        # Первый список проверки
        for index in list_check1:
            self.assertIsNotNone(HelpNavigateCheckMethods.get_element_navigate(driver, index))

        # Второй список проверки
        for index in list_check2:
            HelpNavigateCheckMethods.element_is_none(driver, index)
开发者ID:Maksim1988,项目名称:test,代码行数:37,代码来源:class_front.py

示例3: check_page_restore_password

# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import element_is_none [as 别名]
    def check_page_restore_password(self, driver):
        """ TestRail: C-548 Валидации полей формы Восстановления пароля: Негативные
        http://test-rails.oorraa.pro/index.php?/cases/view/548
        :param driver: ссылка на дравер
        """

        list_check1 = [self.check_restore.TITLE_RESTORE_PAGE,
                       #self.check_restore.HEADER,
                       self.check_restore.LOGO,
                       self.check_restore.FORM_RESTORE,
                       self.check_restore.FORM_PHONE,
                       #self.check_restore.BLC_RIGHT,
                       #self.check_restore.TITLE_RIGHT,
                       #self.check_restore.TITLE_BLC,
                       #self.check_restore.BTN_REGISTRATION,
                       self.check_restore.FOOTER,
                       self.check_restore.INPUT_PHONE,
                       self.check_restore.BTN_RESTORE
        ]

        list_check2 = ["//input[@class='search__input']",  # проверка отсутствия поиска
                       "//ul[@class='cat__list']",  # проверка отсутствия 6 рутовых категорий
                       "//nav[@class='cat']",  # проверка отсутствия Каталог товаров
        ]

        # Первый список проверки
        for index in list_check1:
            self.assertIsNotNone(driver.find_element_by_xpath(index))

        # Второй список проверки
        for index in list_check2:
            HelpNavigateCheckMethods.element_is_none(driver, index)

        # проверка что можно вводить только российские номера
        self.assertEqual(driver.find_element_by_xpath(self.FORM_PHONE_CODE).text, u'+7')
开发者ID:Maksim1988,项目名称:test,代码行数:37,代码来源:class_front.py

示例4: check_registration_page

# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import element_is_none [as 别名]
    def check_registration_page(self, driver):
        """ Проверка страницы регистрации.
        :param driver: ссылка на драйвер
        """

        for index in self.LIST_REG_PAGE1:
            self.assertIsNotNone(Navigate.get_element_navigate(driver, index))

        for index in self.LIST_REG_PAGE2:
            Navigate.element_is_none(driver, index)

        # проверка что можно вводить только российские номера
        self.assertEqual(driver.find_element_by_xpath(self.FORM_PHONE_CODE).text, u'+7')
开发者ID:Maksim1988,项目名称:test,代码行数:15,代码来源:class_registration.py

示例5: check_main_menu_to_url

# 需要导入模块: from tests.front_office.not_sorted.classes.class_navigate import HelpNavigateCheckMethods [as 别名]
# 或者: from tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods import element_is_none [as 别名]
 def check_main_menu_to_url(self, driver, link_map, role, param=None):
     """
     Проверка наличия меню на страницах сайта путем перехода по урлу
     :param driver:
     :param role:
     :return:
     """
     service_log.put("Checking role -> '%s'" % role)
     menu = lambda x, d, m: Navigate.get_element_navigate(d, m) if x is True else Navigate.element_is_none(d, m)
     url = lambda par, sm, p: sm[p] if par is None else sm[p] % par[p]
     page_map = link_map[role]
     for page in page_map:
         service_log.put("Checking...['%s']" % page)
         source = driver.page_source
         url_page = url(param, self.SITE_MAP, page)
         Navigate.get_page(driver, url_page)
         source_new = driver.page_source
         err_msg = "Переход по урлу='%s' не произошел, содержимое страницы не изменилось"
         self.assertNotEqual(source, source_new, err_msg % url)
         menu(page_map[page], driver, self.xpath_menu)
         service_log.put("PASS...['%s']" % page)
     service_log.put("Checked role -> '%s'" % role)
开发者ID:Maksim1988,项目名称:test,代码行数:24,代码来源:class_main_menu.py


注:本文中的tests.front_office.not_sorted.classes.class_navigate.HelpNavigateCheckMethods.element_is_none方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。