Deployed 5be6c2b with MkDocs version: 1.0.4

This commit is contained in:
debugtalk 2019-12-11 17:20:18 +08:00
parent eacf448676
commit 63fd091ccb
47 changed files with 1538 additions and 27 deletions

View File

@ -596,6 +596,18 @@
</li>
<li class="md-nav__item">
<a href="/examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -600,6 +600,18 @@
</li>
<li class="md-nav__item">
<a href="../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>
@ -649,6 +661,20 @@
<label class="md-nav__title" for="__toc">目录</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#240-2019-12-11" class="md-nav__link">
2.4.0 (2019-12-11)
</a>
</li>
<li class="md-nav__item">
<a href="#233-2019-12-04" class="md-nav__link">
2.3.3 (2019-12-04)
</a>
</li>
<li class="md-nav__item">
<a href="#232-2019-11-01" class="md-nav__link">
2.3.2 (2019-11-01)
@ -827,6 +853,20 @@
<label class="md-nav__title" for="__toc">目录</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#240-2019-12-11" class="md-nav__link">
2.4.0 (2019-12-11)
</a>
</li>
<li class="md-nav__item">
<a href="#233-2019-12-04" class="md-nav__link">
2.3.3 (2019-12-04)
</a>
</li>
<li class="md-nav__item">
<a href="#232-2019-11-01" class="md-nav__link">
2.3.2 (2019-11-01)
@ -992,6 +1032,33 @@
<h1 id="release-history">Release History<a class="headerlink" href="#release-history" title="Permanent link">&para;</a></h1>
<h2 id="240-2019-12-11">2.4.0 (2019-12-11)<a class="headerlink" href="#240-2019-12-11" title="Permanent link">&para;</a></h2>
<p><strong>Added</strong></p>
<ul>
<li>feat: validate with python script, ref #773</li>
<li>feat: rearrange html report, failed testcases will be displayed on top.</li>
</ul>
<p><strong>Changed</strong></p>
<ul>
<li>refactor: make loader as submodule, split to check/locate/load/buildup</li>
<li>refactor: make built_in as submodule, split to comparators and functions</li>
<li>refactor: adjust code for context and validator</li>
<li>docs: update cli argument help</li>
<li>adjust format code, remove unused import</li>
</ul>
<p><strong>Fixed</strong></p>
<ul>
<li>fix: keep setup/teardown hooks original order when merge &amp; override.</li>
</ul>
<h2 id="233-2019-12-04">2.3.3 (2019-12-04)<a class="headerlink" href="#233-2019-12-04" title="Permanent link">&para;</a></h2>
<p><strong>Fixed</strong></p>
<ul>
<li>fix #768: dump json file path error when folder name contains dot, such as <code>a.b.c</code></li>
</ul>
<p><strong>Changed</strong></p>
<ul>
<li>change: rename builtin function, sleep_N_secs =&gt; sleep</li>
</ul>
<h2 id="232-2019-11-01">2.3.2 (2019-11-01)<a class="headerlink" href="#232-2019-11-01" title="Permanent link">&para;</a></h2>
<p><strong>Added</strong></p>
<ul>

View File

@ -638,6 +638,18 @@
</li>
<li class="md-nav__item">
<a href="../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -669,6 +669,18 @@
</li>
<li class="md-nav__item">
<a href="../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -664,6 +664,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -605,6 +605,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -708,6 +708,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

View File

@ -0,0 +1,19 @@
name: find place from text
base_url: https://maps.googleapis.com
request:
method: GET
url: /maps/api/place/findplacefromtext/json
params:
key: $key
inputtype: textquery
input: $input
fields: 'formatted_address,geometry,name,permanently_closed,place_id,plus_code,types'
language: zh_CN
variables:
input: 宝安
key: your_google_map_key
validate:
- eq: [status_code, 200]
- eq: [content.status, OK]
extract:
- place_id: content.candidates.0.place_id

View File

@ -0,0 +1,11 @@
name: get_groups
base_url: http://localhost:8085
request:
url: /v1/transferairportadminsrv/area/getGroups
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
Accept-language: zh_CN
cookie: $admin_cookie
data:
parentAreaId: 7037 # 广东省

View File

@ -0,0 +1,17 @@
name: get place detail
request:
method: GET
url: https://maps.googleapis.com/maps/api/place/details/json
params:
key: $key
placeid: $place_id
fields: 'address_component,formatted_address,geometry'
language: zh-CN
variables:
key: your_google_map_key
place_id: ChIJzyoujG6SAzQRRD3Jr26PFfM
validate:
- eq: [status_code, 200]
- eq: [content.status, OK]
extract:
- place_name: content.result.formatted_address

View File

@ -0,0 +1,11 @@
name: search_area_by_name
base_url: http://localhost:8085
request:
url: /v1/transferairportadminsrv/area/search_area_by_name
method: GET
headers:
Content-Type: application/x-www-form-urlencoded
Accept-language: zh_CN
cookie: $admin_cookie
params:
areaName: $in

View File

@ -0,0 +1,3 @@
input,formatted_address,address_components_len
娄底,中国湖南省娄底市,3
新化,中国湖南省娄底市新化县,4
1 input formatted_address address_components_len
2 娄底 中国湖南省娄底市 3
3 新化 中国湖南省娄底市新化县 4

View File

@ -0,0 +1,11 @@
from utils.validators.validators_of_area import *
from utils.validators.validators_of_common import *
from utils.setup_hooks import *
from utils.teardown_hooks import *
__all__ = [
klook_len_eq,
check_search_area_result,
exists_default_group,
teardown_hook_set_encoding
]

View File

@ -0,0 +1,952 @@
<!doctype html>
<html lang="zh" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="HttpRunner V2.x User Documentation">
<meta name="author" content="debugtalk">
<meta name="lang:clipboard.copy" content="复制">
<meta name="lang:clipboard.copied" content="已复制">
<meta name="lang:search.language" content="jp">
<meta name="lang:search.pipeline.stopwords" content="True">
<meta name="lang:search.pipeline.trimmer" content="True">
<meta name="lang:search.result.none" content="没有找到符合条件的结果">
<meta name="lang:search.result.one" content="找到 1 个符合条件的结果">
<meta name="lang:search.result.other" content="# 个符合条件的结果">
<meta name="lang:search.tokenizer" content="[\uff0c\u3002]+">
<link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.3">
<title>klook - HttpRunner V2.x 中文使用文档</title>
<link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css">
<link rel="stylesheet" href="../../assets/stylesheets/application-palette.a8b3c06d.css">
<meta name="theme-color" content="#3f51b5">
<script src="../../assets/javascripts/modernizr.74668098.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
<link rel="stylesheet" href="../../assets/fonts/material-icons.css">
<script>
window.ga = window.ga || function() {
(ga.q = ga.q || []).push(arguments)
}
ga.l = +new Date
/* Setup integration and send page view */
ga("create", "UA-114587036-2", "auto")
ga("set", "anonymizeIp", true)
ga("send", "pageview")
/* Register handler to log search on blur */
document.addEventListener("DOMContentLoaded", () => {
if (document.forms.search) {
var query = document.forms.search.query
query.addEventListener("blur", function() {
if (this.value) {
var path = document.location.pathname;
ga("send", "pageview", path + "?q=" + this.value)
}
})
}
})
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</head>
<body dir="ltr" data-md-color-primary="indigo" data-md-color-accent="indigo">
<svg class="md-svg">
<defs>
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#_1" tabindex="1" class="md-skip">
跳转至
</a>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="../.." title="HttpRunner V2.x 中文使用文档" class="md-header-nav__button md-logo">
<i class="md-icon"></i>
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">
HttpRunner V2.x 中文使用文档
</span>
<span class="md-header-nav__topic">
klook
</span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="搜索" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD;
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
键入以开始搜索
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/HttpRunner/HttpRunner" title="前往 Github 仓库" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
HttpRunner
</div>
</a>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container">
<main class="md-main" role="main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="__drawer">
<a href="../.." title="HttpRunner V2.x 中文使用文档" class="md-nav__button md-logo">
<i class="md-icon"></i>
</a>
HttpRunner V2.x 中文使用文档
</label>
<div class="md-nav__source">
<a href="https://github.com/HttpRunner/HttpRunner" title="前往 Github 仓库" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
HttpRunner
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." title="介绍" class="md-nav__link">
介绍
</a>
</li>
<li class="md-nav__item">
<a href="../../Installation/" title="安装说明" class="md-nav__link">
安装说明
</a>
</li>
<li class="md-nav__item">
<a href="../../quickstart/" title="快速上手" class="md-nav__link">
快速上手
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
<label class="md-nav__link" for="nav-4">
基础概念
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-4">
基础概念
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../concept/nominal/" title="名词解释" class="md-nav__link">
名词解释
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
<label class="md-nav__link" for="nav-5">
测试准备
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-5">
测试准备
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../prepare/record/" title="录制生成用例" class="md-nav__link">
录制生成用例
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/project-structure/" title="项目文件组织" class="md-nav__link">
项目文件组织
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/testcase-structure/" title="测试用例组织" class="md-nav__link">
测试用例组织
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/request-hook/" title="hook机制" class="md-nav__link">
hook机制
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/dot-env/" title="环境变量" class="md-nav__link">
环境变量
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/testcase-layer/" title="测试用例分层" class="md-nav__link">
测试用例分层
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/parameters/" title="参数化数据驱动" class="md-nav__link">
参数化数据驱动
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/validate-pretty/" title="Validate & Prettify" class="md-nav__link">
Validate & Prettify
</a>
</li>
<li class="md-nav__item">
<a href="../../prepare/security/" title="信息安全" class="md-nav__link">
信息安全
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6">
<label class="md-nav__link" for="nav-6">
测试执行
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-6">
测试执行
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../run-tests/cli/" title="运行测试(CLI)" class="md-nav__link">
运行测试(CLI)
</a>
</li>
<li class="md-nav__item">
<a href="../../run-tests/report/" title="测试报告" class="md-nav__link">
测试报告
</a>
</li>
<li class="md-nav__item">
<a href="../../run-tests/load-test/" title="性能测试" class="md-nav__link">
性能测试
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7">
<label class="md-nav__link" for="nav-7">
开发扩展
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-7">
开发扩展
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../development/architecture/" title="Pipline" class="md-nav__link">
Pipline
</a>
</li>
<li class="md-nav__item">
<a href="../../development/dev-api/" title="基础库调用" class="md-nav__link">
基础库调用
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../FAQ/" title="FAQ" class="md-nav__link">
FAQ
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9" checked>
<label class="md-nav__link" for="nav-9">
实践案例
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-9">
实践案例
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../testerhome-login/" title="TesterHome 登录" class="md-nav__link">
TesterHome 登录
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
klook
</label>
<a href="./" title="klook" class="md-nav__link md-nav__link--active">
klook
</a>
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">目录</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#_1" class="md-nav__link">
案例介绍
</a>
</li>
<li class="md-nav__item">
<a href="#_2" class="md-nav__link">
注意事项
</a>
</li>
<li class="md-nav__item">
<a href="#_3" class="md-nav__link">
相关文件说明
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../related-docs/" title="相关资料" class="md-nav__link">
相关资料
</a>
</li>
<li class="md-nav__item">
<a href="../../CHANGELOG/" title="CHANGELOG" class="md-nav__link">
CHANGELOG
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">目录</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#_1" class="md-nav__link">
案例介绍
</a>
</li>
<li class="md-nav__item">
<a href="#_2" class="md-nav__link">
注意事项
</a>
</li>
<li class="md-nav__item">
<a href="#_3" class="md-nav__link">
相关文件说明
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<h1>klook</h1>
<h2 id="_1">案例介绍<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h2>
<ul>
<li>被测案例:<a href="https://www.klook.com/">klook</a></li>
<li>案例作者:<a href="https://github.com/readyou">readyou</a></li>
</ul>
<p>我们团队选择了 HttpRunner 作为接口测试框架,并整理了一份案例,供大家参考。</p>
<h2 id="_2">注意事项<a class="headerlink" href="#_2" title="Permanent link">&para;</a></h2>
<ol>
<li>本例子中有些地方用到了<code>localhost:8085</code>作为base_url这些接口是不能访问的仅作为示例学习怎样组织测试用例。</li>
<li><code>https://maps.googleapis.com</code>是可以用的自己申请一个key替换掉文件中的<code>your_google_map_key</code>即可。</li>
</ol>
<h2 id="_3">相关文件说明<a class="headerlink" href="#_3" title="Permanent link">&para;</a></h2>
<table>
<thead>
<tr>
<th>模块</th>
<th>文件</th>
<th>用途</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>google map 接口测试</td>
<td>api/find_place_api.yml</td>
<td>google map根据名称搜索地址的api</td>
<td>比较全面地使用了api可以使用的关键字name, base_url, request, variables, validate, extract</td>
</tr>
<tr>
<td>google map 接口测试</td>
<td>testcases/find_place_testcase.yml</td>
<td>google map根据名称搜索地址的testcase</td>
<td>使用了testcase标准的写法testcase由teststep组成teststep中引用api(just_request_testcase.yml中演示了直接使用request而不是引用api的方式)。teststep中还使用了variables。</td>
</tr>
<tr>
<td>google map 接口测试</td>
<td>testcases/place_detail_testcase.yml</td>
<td>google map获取地址详情的testcase</td>
<td>config中使用variables</td>
</tr>
<tr>
<td>google map 接口测试</td>
<td>testsuites/place_detail_testsuite.yml</td>
<td>google map接口测试的testsuite包含上面两个testcase</td>
<td>使用了多种方式来做数据驱动测试</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>klook地理位置搜索接口测试</td>
<td>api/search_area_by_name_api.yml</td>
<td>根据名字查询区域支持多语言——api</td>
<td></td>
</tr>
<tr>
<td>klook地理位置搜索接口测试</td>
<td>api/search_area_by_name_testcase.yml</td>
<td>根据名字查询区域支持多语言——testcase</td>
<td></td>
</tr>
<tr>
<td>klook地理位置搜索接口测试</td>
<td>api/get_area_groups_api.yml</td>
<td>查询地理位置下面的组——api</td>
<td></td>
</tr>
<tr>
<td>klook地理位置搜索接口测试</td>
<td>api/get_area_groups_testcase.yml</td>
<td>查询地理位置下面的组——testcase</td>
<td></td>
</tr>
<tr>
<td>klook地理位置搜索接口测试</td>
<td>api/area_manage_testsuite.yml</td>
<td>区域管理——testsuite</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>baidu首页demo</td>
<td>testcases/just_request_testcase.yml</td>
<td>提取百度首页title的demo</td>
<td>演示了直接使用request而不是引用api的方式使用了teardown_hooks的使用</td>
</tr>
</tbody>
</table>
<p>完整的案例访问<a href="https://github.com/httprunner/httprunner/tree/master/docs/examples/demo-klook">地址</a></p>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="../testerhome-login/" title="TesterHome 登录" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
上一页
</span>
TesterHome 登录
</span>
</div>
</a>
<a href="../../related-docs/" title="相关资料" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
下一页
</span>
相关资料
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
Copyright &copy; 2017 - 2019 debugtalk
</div>
powered by
<a href="https://www.mkdocs.org">MkDocs</a>
and
<a href="https://squidfunk.github.io/mkdocs-material/">
Material for MkDocs</a>
</div>
<div class="md-footer-social">
<link rel="stylesheet" href="../../assets/fonts/font-awesome.css">
<a href="https://debugtalk.com" class="md-footer-social__link fa fa-globe"></a>
<a href="https://github.com/httprunner" class="md-footer-social__link fa fa-github"></a>
</div>
</div>
</div>
</footer>
</div>
<script src="../../assets/javascripts/application.ac79c3b0.js"></script>
<script src="../../assets/javascripts/lunr/lunr.stemmer.support.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
<script src="../../js/slardar.js"></script>
</body>
</html>

View File

@ -0,0 +1,19 @@
name: find place from text testcase
config:
base_url: https://maps.googleapis.com
# config 这里的variables优先级更高
# 如果本testcase被其他testcase引用variables无法覆盖这里配置的值
# variables:
# input: 福田
# formatted_address: 中国广东省深圳市福田区
teststeps:
- name: find place
api: api/find_place_api.yml
# 如果config上面配置了这里的同名变量会被覆盖
variables:
input: 深圳
formatted_address: 中国广东省深圳市
validate:
- eq: [content.candidates.0.formatted_address, $formatted_address]
extract:
- formatted_address: formatted_address"\s?:\s?"(.*)"

View File

@ -0,0 +1,13 @@
config:
base_url: http://127.0.0.1:8085
variables:
admin_cookie: 'cookies'
teststeps:
- name: get group by parent area id
api: api/get_area_groups_api.yml
validate:
- eq: [status_code, 200]
- eq: [headers.Content-Type, application/json]
- eq: [content.success, true]
- exists_default_group: [content.result, '']

View File

@ -0,0 +1,9 @@
teststeps:
- name: extract title
request:
method: GET
url: http://www.baidu.com
extract:
- title: <title>(.*)</title>
teardown_hooks:
- ${teardown_hook_set_encoding($response, utf-8)}

View File

@ -0,0 +1,19 @@
name: get place detail
config:
base_url: https://maps.googleapis.com
variables:
input: 娄底
formatted_address: 中国湖南省娄底市
address_components_len: 3
teststeps:
# 文档里面说这里可以使用testcase测试了一下这种方式还有问题使用testcase时api里面的变量无法正常覆盖
# 所以teststep中最好不要使用testcase引用
- name: find place
api: api/find_place_api.yml
validate:
- eq: [content.candidates.0.formatted_address, $formatted_address]
- name: get place detail
api: api/place_detail_api.yml
validate:
- eq: [content.result.formatted_address, $formatted_address]
- klook_len_eq: [content.result.address_components, $address_components_len]

View File

@ -0,0 +1,14 @@
config:
base_url: http://localhost:8085
variables:
admin_cookie: 'cookies'
teststeps:
- name: search area by name
api: api/search_area_by_name_api.yml
variables:
in: 北京
out: 中国北京市
validate:
- eq: [content.success, true]
- check_search_area_result: [content.result, $out]

View File

@ -0,0 +1,16 @@
config:
name: area manage testsuite
variables:
admin_cookie: 'cookies'
base_url: http://127.0.0.1:8085
verify: False
testcases:
- name: search area by name
testcase: testcases/search_area_by_name_api_testcase.yml
parameters:
in-out:
- ['北京', '中国, 北京市']
- ['广东', '中国, 广东省']
- ['shenzhen', '中国, 广东省, 深圳市']
- ['서울', '韩国, 首尔']

View File

@ -0,0 +1,22 @@
name: get place detail testsuites
config:
base_url: https://maps.googleapis.com
testcases:
- name: find place from text
testcase: testcases/find_place_testcase.yml
parameters:
input-formatted_address:
- [娄底, 中国湖南省娄底市]
- [新化, 中国湖南省娄底市新化县]
- ['北京', '中国北京市']
- ['广东', '中国广东省']
- ['shenzhen', '中国广东省深圳市']
- ['서울', '韩国汉城']
- name: get place detail
testcase: testcases/place_detail_testcase.yml
parameters:
input-formatted_address-address_components_len: ${P(data/place_detail.csv)}
# input-formatted_address-address_components_len:
# - [娄底, 中国湖南省娄底市, 3]
# - [新化, 中国湖南省娄底市新化县, 4]

View File

View File

View File

@ -0,0 +1,6 @@
def teardown_hook_set_encoding(response, encoding):
"""
Set encoding of response.
"""
response.resp_obj.encoding = encoding
return response

View File

@ -0,0 +1,18 @@
def check_search_area_result(content, expect_name):
print(content, expect_name)
found = False
for item in content:
if item['fullName'] == expect_name:
found = True
break
assert found
def exists_default_group(content, expect):
found = False
for item in content:
if item['defaultGroup']:
print('defaultGroup found, id={}, parentAreaId={}'.format(item['id'], item['parentAreaId']))
found = True
break
assert found

View File

@ -0,0 +1,3 @@
def klook_len_eq(check_value, expect_value):
# 校验列表、字典、字符串等长度是否相等
assert len(check_value) == int(expect_value)

View File

@ -690,6 +690,18 @@
</li>
<li class="md-nav__item">
<a href="../demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>
@ -1065,13 +1077,13 @@ INFO Generated Html report: /Users/debugtalk/MyProjects/HttpRunner-dev/httpr
</a>
<a href="../../related-docs/" title="相关资料" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../demo-klook/" title="klook" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
下一页
</span>
相关资料
klook
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">

View File

@ -648,6 +648,18 @@
</li>
<li class="md-nav__item">
<a href="examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -670,6 +670,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -719,6 +719,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -643,6 +643,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -643,6 +643,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -690,6 +690,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -643,6 +643,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -724,6 +724,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -664,6 +664,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -643,6 +643,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -744,6 +744,18 @@
</li>
<li class="md-nav__item">
<a href="../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -600,6 +600,18 @@
</li>
<li class="md-nav__item">
<a href="../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>
@ -751,7 +763,7 @@
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="../examples/testerhome-login/" title="TesterHome 登录" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../examples/demo-klook/" title="klook" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
@ -760,7 +772,7 @@
<span class="md-footer-nav__direction">
上一页
</span>
TesterHome 登录
klook
</span>
</div>
</a>

View File

@ -657,6 +657,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -657,6 +657,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

View File

@ -677,6 +677,18 @@
</li>
<li class="md-nav__item">
<a href="../../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>

File diff suppressed because one or more lines are too long

View File

@ -2,112 +2,117 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-11-03</lastmod>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-12-11</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

View File

@ -600,6 +600,18 @@
</li>
<li class="md-nav__item">
<a href="../examples/demo-klook/" title="klook" class="md-nav__link">
klook
</a>
</li>
</ul>
</nav>
</li>