Files
httprunner/docs/examples/test_klook/README.md
2019-12-11 15:19:57 +08:00

2.1 KiB
Raw Blame History

案例介绍

我们团队在调研接口测试框架的时候选了httprunner让我来负责给大家做一次分享,于是有了这里的示例。

注意事项

  1. 本例子中有些地方用到了localhost:8085作为base_url这些接口是不能访问的仅仅作为示例学习怎样组织测试用例。
  2. https://maps.googleapis.com是可以用的自己申请一个key替换掉文件中的your_google_map_key即可。

相关文件说明

模块 文件 用途 备注
google map 接口测试 api/find_place_api.yml google map根据名称搜索地址的api 比较全面地使用了api可以使用的关键字name, base_url, request, variables, validate, extract
google map 接口测试 testcases/find_place_testcase.yml google map根据名称搜索地址的testcase 使用了testcase标准的写法testcase由teststep组成teststep中引用api(just_request_testcase.yml中演示了直接使用request而不是引用api的方式)。teststep中还使用了variables。
google map 接口测试 testcases/place_detail_testcase.yml google map获取地址详情的testcase config中使用variables
google map 接口测试 testsuites/place_detail_testsuite.yml google map接口测试的testsuite包含上面两个testcase 使用了多种方式来做数据驱动测试
klook地理位置搜索接口测试 api/search_area_by_name_api.yml 根据名字查询区域支持多语言——api
klook地理位置搜索接口测试 api/search_area_by_name_testcase.yml 根据名字查询区域支持多语言——testcase
klook地理位置搜索接口测试 api/get_area_groups_api.yml 查询地理位置下面的组——api
klook地理位置搜索接口测试 api/get_area_groups_testcase.yml 查询地理位置下面的组——testcase
klook地理位置搜索接口测试 api/area_manage_testsuite.yml 区域管理——testsuite
baidu首页demo testcases/just_request_testcase.yml 提取百度首页title的demo 演示了直接使用request而不是引用api的方式使用了teardown_hooks的使用