20230525_接口自动化测试_作业

练习:

接口地址: Swagger UI

接口:
post /pet 新增
get /pet/findByStatus 查询

要求:

  • 使用pytest对上述两个接口进行冒烟测试
  • 添加allure step
  • 断言相应状态码

示例:

@allure.feature("宠物商店宠物信息接口测试")
class TestPetstore:
    def setup_class(self):
        # 基础的数据信息
        pass

    @allure.story("查询宠物接口冒烟用例")
    def test_getpet(self):
        '''
        获取宠物信息
        :return:
        '''
        get_url = self.url + "/findByStatus"
        with allure.step("发出查询接口请求"):
            r = requests.get(get_url, self.find_parmas)
        with allure.step("获取查询接口响应"):
            print(r.json())
        with allure.step("查询接口断言"):
            assert r.status_code == 200

数据2102丁熄桂

数据2102李天威: 161616161616 (gitee.com)

数据2101申中旭:https://gitee.com/shen-zhongxu/shuju2101.git

数据2102赵琰锋

数据2102王子妍

信计2002杜鹏辉123: 123

数据2101江博伦: 作业: 12345678910 - Gitee.com

数据2101蔡正阳

https://gitee.com/zhao-jing000/nhvfwebjufef.git

数据2102杨帆:数据2102杨帆: 111111111111111111 - Gitee.com

数据2102 刘岩