Beispiel #1
0
 def test_buy_hl(self, open_url1):
     hp(open_url1).search(bd.success_data_huliye["title"])
     time.sleep(2)
     # 是否进入搜索结果页
     assert unquote(open_url1.current_url,
                    encoding='utf-8') == bd.success_data_huliye["check_url"]
     # 点击进入商品详情页,并切换窗口
     hp(open_url1).click_hl()
     # 验证是否进入
     time.sleep(3)
     assert unquote(
         open_url1.current_url,
         encoding='utf-8') == bd.success_data_huliye["check_product_url"]
     # 选择数量并加入购物车
     pp(open_url1).huliye('1')
     assert True == ip(open_url1).jiaru_success()
Beispiel #2
0
 def test_buy_jp(self, open_url1):
     hp(open_url1).search(bd.success_data_jp["title"])
     time.sleep(2)
     # 是否进入搜索结果页
     assert unquote(open_url1.current_url,
                    encoding='utf-8') == bd.success_data_jp["check_url"]
     # 点击进入商品详情页,并切换窗口
     hp(open_url1).click_jp()
     # 验证是否进入
     time.sleep(3)
     assert unquote(
         open_url1.current_url,
         encoding='utf-8') == bd.success_data_jp["check_product_url"]
     # 选择sku并加入购物车
     pp(open_url1).jingpian(bd.success_data_jp["count"])
     assert True == ip(open_url1).jiaru_success()
Beispiel #3
0
 def test_buy_yx(self, open_url1):
     #搜索隐形眼镜商品
     hp(open_url1).search(bd.success_data_yxyj["title"])
     time.sleep(2)
     #是否进入搜索结果页
     assert unquote(open_url1.current_url,
                    encoding='utf-8') == bd.success_data_yxyj["check_url"]
     #点击进入商品详情页,并切换窗口
     hp(open_url1).click_yx()
     time.sleep(5)
     #验证是否进入
     assert unquote(
         open_url1.current_url,
         encoding='utf-8') == bd.success_data_yxyj["check_product_url"]
     #选择sku
     pp(open_url1).yxyj()
     assert True == ip(open_url1).jiaru_success()
Beispiel #4
0
    def test_buy_dzp(self, open_url1):
        hp(open_url1).search(bd.success_data_dzp["title"])
        time.sleep(2)
        # 是否进入搜索结果页
        assert unquote(open_url1.current_url,
                       encoding='utf-8') == bd.success_data_dzp["check_url"]
        # 点击进入商品详情页,并切换窗口
        hp(open_url1).click_dz()
        # 验证是否进入
        time.sleep(3)
        assert unquote(
            open_url1.current_url,
            encoding='utf-8') == bd.success_data_dzp["check_product_url"]
        # 选择sku并加入购物车
        pp(open_url1).dingzhi(bd.success_data_dzp["sku"][0],
                              bd.success_data_dzp["sku"][1],
                              bd.success_data_dzp["sku"][2],
                              bd.success_data_dzp["sku"][3],
                              bd.success_data_dzp["sku"][4])

        assert True == ip(open_url1).jiaru_success()