コード例 #1
0
    def test_正测_成功添加品牌节点_一级合作方下添加(self, depend_nodeInfo):
        with allure.step('准备用例入参'):
            brandName = testdata.random_node_brandName()
            ageGroups = [(0, 90)]

        with allure.step('接口请求'):
            res_info = api.bns_node_addBrand(
                parentAreaCode=depend_nodeInfo["firstPartnerData"]["areaCode"],
                brandName=brandName,
                ageGroups=ageGroups)
        res_data = JsonHelper.parseJson_by_objectpath(res_info,
                                                      "$.response_data.data")
        with allure.step('校验:接口响应信息'):
            with allure.step('校验:接口状态码'):
                actual_code = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.code")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code,
                                                expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            api.bns_node_delete(areaCode=res_data["areaCode"])
コード例 #2
0
    def test_正测_成功添加三级合作方_名称在另一个二级合作方下已使用(self, depend_nodeInfo):
        with allure.step('准备用例入参'):
            secondPartnerName = testdata.random_node_secondPartnerName()
            thirdPartnerName = depend_nodeInfo["thirdPartnerData"]["name"]

        with allure.step('接口请求'):
            res_info = api.bns_node_addSecondPartner(
                parentAreaCode=depend_nodeInfo["firstPartnerData"]["areaCode"],
                partnerName=secondPartnerName,
            )
            areaCode = JsonHelper.parseJson_by_objectpath(res_info, "$.response_data.data.areaCode")
        with allure.step('接口请求'):
            res_info = api.bns_node_addThirdPartner(
                parentAreaCode=areaCode,
                partnerName=thirdPartnerName,
            )
        res_data = JsonHelper.parseJson_by_objectpath(res_info, "$.response_data.data")
        with allure.step('校验:接口响应信息'):
            with allure.step('校验:接口状态码'):
                actual_code = JsonHelper.parseJson_by_objectpath(res_info, "$.response_data.code")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code, expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            api.bns_node_delete(areaCode=res_data["areaCode"])
コード例 #3
0
    def test_正测_成功添加品牌节点_划分20个年龄分组(self, depend_nodeInfo):
        with allure.step('准备用例入参'):
            brandName = testdata.random_node_brandName()
            ageGroups = [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5),
                         (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (11, 11),
                         (12, 12), (13, 13), (14, 14), (15, 15), (16, 16),
                         (17, 17), (18, 18), (19, 90)]

        with allure.step('接口请求'):
            res_info = api.bns_node_addBrand(
                parentAreaCode=depend_nodeInfo["firstPartnerData"]["areaCode"],
                brandName=brandName,
                ageGroups=ageGroups)
        res_data = JsonHelper.parseJson_by_objectpath(res_info,
                                                      "$.response_data.data")
        with allure.step('校验:接口响应信息'):
            with allure.step('校验:接口状态码'):
                actual_code = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.code")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code,
                                                expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            api.bns_node_delete(areaCode=res_data["areaCode"])
コード例 #4
0
    def test_正测_成功添加一级合作方(self):

        with allure.step('准备用例入参'):

            partnerName = testdata.random_node_firstPartnerName()

        with allure.step('接口请求'):

            res_info = api.bns_node_addFirstPartner(partnerName=partnerName, )

        with allure.step('校验:接口响应信息'):

            with allure.step('校验:接口状态码'):

                actual_code = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.code")
                res_data = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.data")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code,
                                                expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            api.bns_node_delete(areaCode=res_data["areaCode"])
コード例 #5
0
    def test_正测_成功添加楼层节点_在门店下创建楼层(self, depend_nodeInfo):

        with allure.step('准备用例入参'):

            parentAreaCode = depend_nodeInfo["shopData"]["areaCode"]
            floorName = testdata.random_node_floorName()

        with allure.step('接口请求'):

            res_info = api.bns_node_addFloor(
                parentAreaCode=parentAreaCode,
                floorName=floorName,
            )
            res_data = JsonHelper.parseJson_by_objectpath(
                res_info, "$.response_data.data")
        with allure.step('校验:接口响应信息'):

            with allure.step('校验:接口状态码'):

                actual_code = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.code")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code,
                                                expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            pass
コード例 #6
0
    def test_正测_成功添加楼层节点_名称在另一个门店下已使用(self, depend_nodeInfo):
        with allure.step('准备用例入参'):
            shopName = testdata.random_node_shopName()
            floorName = depend_nodeInfo["floorData"]["floorName"]

        with allure.step('接口请求'):
            res_info = api.scn_node_addShop(
                parentAreaCode=depend_nodeInfo["brandData"]["areaCode"],
                shopName=shopName)
            parentAreaCode = res_info["areaCode"]
        with allure.step('接口请求'):
            res_info = api.bns_node_addFloor(
                parentAreaCode=parentAreaCode,
                floorName=floorName,
            )
            res_data = JsonHelper.parseJson_by_objectpath(
                res_info, "$.response_data.data")
        with allure.step('校验:接口响应信息'):
            with allure.step('校验:接口状态码'):
                actual_code = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.code")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code,
                                                expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            api.bns_node_delete(areaCode=res_data["areaCode"])
コード例 #7
0
    def test_正测_成功添加门店节点_名称在另一个品牌下已使用(self, depend_nodeInfo):
        with allure.step('准备用例入参'):
            brandName = testdata.random_node_brandName()
            shopName = depend_nodeInfo["shopData"]["shopName"]
            province, city, district = testdata.get_random_addNode_mallAddr()
            clerkSimType = 1
            customerSimType = 1
            repeatDate = 30
            skipTime = 3600
            trailSkipTime = 3600

        with allure.step('接口请求'):
            res_info = api.scn_node_addBrand(
                parentAreaCode=depend_nodeInfo["thirdPartnerData"]["areaCode"],
                brandName=brandName)
            parentAreaCode = res_info["areaCode"]
        with allure.step('接口请求'):
            res_info = api.bns_node_addShop(
                parentAreaCode=parentAreaCode,
                shopName=shopName,
                province=province,
                city=city,
                district=district,
                clerkSimType=clerkSimType,
                customerSimType=customerSimType,
                repeatDate=repeatDate,
                skipTime=skipTime,
                trailSkipTime=trailSkipTime,
            )
            res_data = JsonHelper.parseJson_by_objectpath(
                res_info, "$.response_data.data")
        with allure.step('校验:接口响应信息'):
            with allure.step('校验:接口状态码'):
                actual_code = JsonHelper.parseJson_by_objectpath(
                    res_info, "$.response_data.code")
                expect_code = 0
                self.assert_actual_equal_expect("接口业务码", actual_code,
                                                expect_code)

        with allure.step('校验:关联业务'):
            utils.positive_check_node(api, res_data)

        with allure.step('清理用例'):
            api.bns_node_delete(areaCode=res_data["areaCode"])