- 新增 body 分组校验:contains、regex、json(JSONPath)、css(CSS选择器)、xpath - 新增操作符系统:equals、contains、match、empty、exists、gte、lte、gt、lt - 新增 headers 响应头校验 - 引入 cheerio、xpath、@xmldom/xmldom 依赖 - BREAKING: expect.bodyContains 迁移至 expect.body.contains
37 lines
727 B
YAML
37 lines
727 B
YAML
server:
|
|
host: "127.0.0.1"
|
|
port: 3000
|
|
dataDir: "/tmp/probes_data"
|
|
|
|
defaults:
|
|
interval: "5s"
|
|
timeout: "10s"
|
|
method: "GET"
|
|
|
|
targets:
|
|
- name: "Baidu"
|
|
url: "https://www.baidu.com"
|
|
expect:
|
|
status: [200]
|
|
maxLatencyMs: 10000
|
|
|
|
- name: "JSON API 示例"
|
|
url: "https://httpbin.org/json"
|
|
expect:
|
|
status: [200]
|
|
headers:
|
|
Content-Type: application/json
|
|
body:
|
|
contains: "slideshow"
|
|
json:
|
|
$.slideshow.title: "Sample Slide Show"
|
|
|
|
- name: "HTML 页面示例"
|
|
url: "https://httpbin.org/html"
|
|
expect:
|
|
status: [200]
|
|
body:
|
|
contains: "Moby-Dick"
|
|
xpath:
|
|
"/html/body/h1/text()": "Herman Melville - Moby-Dick"
|