예제 #1
0
파일: test.py 프로젝트: yanghui-007/UI_test
    def test004_getUniversalTypeAllCountry(self):
        url = urd + '/gameservProduct/productCountry/getUniversalTypeAllCountry'

        headers = {
            "Content-Type": 'application/x-www-form-urlencoded',
            "Authorization": "Bearer" + token
        }

        res = get_request(self, url, headers)

        print(res.status_code)  #响应的HTTP状态码
        print(res.reason)  #响应的状态码含义
        #print(res.text)

        #b7b0ab40-84cc-4dae-bb3d-f55b5e95d125
        ress = res.text
        res_dict = json.loads(ress)
        res_json = json.dumps(res_dict,
                              indent=2,
                              sort_keys=True,
                              ensure_ascii=False)  #响应格式改为json格式
        print(
            '---------------------------test004_/gameservProduct/productCountry/getUniversalTypeAllCountry后台-商品类型-获取国家列表---------------------------'
        )
        #print(res_json)

        self.assertIn('"code":0,"msg":"success"', res.text)
예제 #2
0
파일: test.py 프로젝트: yanghui-007/UI_test
    def test_010_getBalancePrice(self):
        url = urd + '/gameservProduct/productSetting/getBalancePrice'

        headers = {
            "Content-Type": 'application/x-www-form-urlencoded',
            "Authorization": "Bearer" + token
        }

        params = {"id": 1}

        res = get_request(self, url, headers, params)

        #print(res.text)

        print(res.status_code)  #相应的状态码
        print(res.reason)  #相应的状态码含义

        #相应格式为json格式
        ress = res.text
        res_dict = json.loads(ress)
        res_json = json.dumps(res_dict,
                              indent=2,
                              sort_keys=True,
                              ensure_ascii=False)  #相应格式为json格式
        print(
            '---------------------------test010_/gameservProduct/productSetting/getBalancePrice获取余额代充报价---------------------------'
        )
예제 #3
0
파일: test.py 프로젝트: yanghui-007/UI_test
    def test009_rankpage(self):
        url = urd + '/gameservUser/rank/page'

        headers = {
            "Content-Type": 'application/x-www-form-urlencoded',
            "Authorization": "Bearer" + token
        }

        params = {"current": 1, "size": 1}

        res = get_request(self, url, headers, params)

        #print(res.text)

        print(res.status_code)  #相应的状态码
        print(res.reason)  #相应的状态码含义

        #相应格式为json格式
        ress = res.text
        res_dict = json.loads(ress)
        res_json = json.dumps(res_dict,
                              indent=2,
                              sort_keys=True,
                              ensure_ascii=False)  #相应格式为json格式
        print(
            '---------------------------test009_/gameservUser/rank/page后台-会员管理-会员等级管理-列表---------------------------'
        )
        #print(res_json)

        self.assertIn('"code":0,"msg":"success"', res.text)
예제 #4
0
파일: test.py 프로젝트: yanghui-007/UI_test
    def test006_countryProductdetail(self):
        url = urd + "/gameservProduct/countryProduct/detail"

        headers = {
            "Content-Type": 'application/x-www-form-urlencoded',
            "Authorization": "Bearer" + token
        }

        params = {'countryId': 1, 'productId': 1}

        res = get_request(self, url, headers, params)
        #print(res.text)

        print(res.status_code)  #相应的状态码
        print(res.reason)  #响应的状态码含义

        #响应格式为json格式
        ress = res.text
        res_dict = json.loads(ress)
        res_json = json.dumps(res_dict,
                              indent=2,
                              sort_keys=True,
                              ensure_ascii=False)  #响应格式为json格式
        print(
            '---------------------------test006_/gameservProduct/countryProduct/detail后台-商品管理-国家商品库#详情---------------------------'
        )
        #print(res_json)

        self.assertIn('"code":0,"msg":"success"', res.text)
예제 #5
0
파일: test.py 프로젝트: yanghui-007/UI_test
    def test005_detailPage(self):
        url = urd + '/gameservProduct/commonProduct/detailPage'

        headers = {
            "Content-Type": 'application/x-www-form-urlencoded',
            "Authorization": "Bearer" + token
        }

        params = {'id': '1', 'size': '10', 'current': '1'}

        res = get_request(self, url, headers, params)
        #print(res.text)
        print(res.status_code)  #响应的HTTP状态码
        print(res.reason)  #响应的状态码含义

        #响应格式为json格式
        ress = res.text
        res_dict = json.loads(ress)
        res_json = json.dumps(res_dict,
                              indent=2,
                              sort_keys=True,
                              ensure_ascii=False)  #响应格式为json格式
        print(
            '---------------------------test005_/gameservProduct/commonProduct/detailPage后台-商品管理-通用商品列表-关联sku列表分页---------------------------'
        )
예제 #6
0
    def test0009_cardDetail(self):
        url = urd + '/api/shopuser/shopUserInfo/getUserInfo'
        #url='http://shop.c792da175267647238186842c09054706.cn-shanghai.alicontainer.com/api/shopuser/shopUserInfo/getUserInfo'
        params = {"cardPicDetailId": "1169452461839945730"}

        # headers={
        #     "Authorization":"Bearer"+token
        # }
        res = get_request(self, url, headers, params=params)
        #print(res.text)
        self.assertIn('"code":0,"msg":"success"', res.text)
예제 #7
0
파일: test.py 프로젝트: yanghui-007/UI_test
    def test003_countryproductpage(self):
        url = urd + '/gameservProduct/countryProduct/page'

        headers = {
            "Content-Type": 'application/x-www-form-urlencoded',
            "Authorization": "Bearer" + token
        }

        params = {
            'productTypeId': '1',
            'productName': '',
            'statue': '1',
            'countryId': '21',
            'current': '1',
            'size': '2'
        }

        res = get_request(self, url, headers, params)

        print(res.status_code)  #响应的HTTP状态码
        print(res.reason)  #响应的状态码含义

        #print(res.text)
        #响应格式改为json格式
        ress = res.text
        res_dict = json.loads(ress)
        res_json = json.dumps(res_dict,
                              indent=2,
                              sort_keys=True,
                              ensure_ascii=False)  #响应格式改为json格式
        #print(ress)
        #print(res_dict)
        print(
            '---------------------------test003_/gameservProduct/countryProduct/page后台-商品管理-国家商品库#列表---------------------------'
        )
        #print(res_json)

        #self.assertIn('"code":0,"msg":"success"',res.text)

        try:
            self.assertIn('"code":0,"msg":"success"', res.text)
        except Exception as err:
            # 正式运行前注释掉打印异常
            print(err)