Ejemplo n.º 1
0
 def tearDownClass(cls) -> None:
     """
     后置函数->关闭浏览器
     :return:
     """
     # cls.driver.quit()
     GetDriver().close_driver()
Ejemplo n.º 2
0
 def setUpClass(cls) -> None:
     cls.driver = GetDriver().get_driver()
     # 调用登录成功方法
     PageLogin(cls.driver).page_login_success()
     time.sleep(2)
     # 实例化购物车页面
     cls.cart = PageCart(cls.driver)
Ejemplo n.º 3
0
    def setUpClass(cls) -> None:
        """
        前置函数->打开浏览器
        创建浏览器对象,打开登录页面
        """
        # 调用opendriver模块实现
        # cls.driver = OpenDriver().get_driver('ch')
        # cls.driver.maximize_window()
        # cls.driver.get(page.url)
        # cls.login = PageLogin(cls.driver)

        # 调用driver封装模块实现
        cls.driver = GetDriver().get_driver()
        cls.login = PageLogin(cls.driver)
Ejemplo n.º 4
0
 def tearDownClass(cls) -> None:
     GetDriver().close_driver()
Ejemplo n.º 5
0
    def page_sec_pay(self):
        """选择支付方式"""
        self.base_click(page.ordre_sec_pay)

    def page_click_submit_button(self):
        """点击提交订单按钮"""
        self.base_click(page.order_click_submit)

    def page_order(self):
        """
        组合业务:点击商品 > 提交订单
        """
        self.page_move_scrollbar()
        self.page_click_goods()
        self.base_switch_window(page.order_window_title)
        self.page_goods_color_size()
        self.page_click_buy_button()
        self.page_sec_pay()
        sleep(1)
        self.page_click_submit_button()


if __name__ == '__main__':
    from bases.driver import GetDriver
    from page.page_login import PageLogin

    driver = GetDriver().get_driver()
    PageLogin(driver).page_login_success()
    order = PageOrder(driver)
    order.page_order()
Ejemplo n.º 6
0
 def setUpClass(cls) -> None:
     cls.driver = GetDriver().get_driver()
     PageLogin(cls.driver).page_login_success()
     cls.order = PageOrder(cls.driver)