请检查playwright 帮助器
@checkly/playwright-helpers 包含在运行时间 2023.09 之后,此库仅用于内部 检查 多步和浏览器检查 .
安装
npm i @checkly/playwright-helpers
方法
已降级
如果 :
- 检查失败了 有软的断言,或
- 支票没有失败
import { markCheckAsDegraded } from '@checkly/playwright-helpers'
test("Checkly Multistep", async ({ request }) => {
test.step('Google', () => {
const response = await request.get('https://google.com')
const data = await response.json()
if (data.foo.length > 100) {
markCheckAsDegraded('Foo is too long.')
}
})
})
参数
reason字符串( 可选) 。 调用方法时登录 。 用于识别导致降解的方法.
获取时长
获得请求响应时间 .
import { getAPIResponseTime } from '@checkly/playwright-helpers'
test("Checkly Multistep", async ({ request }) => {
test.step('Google', () => {
const response = await request.get('https://google.com')
console.log(getAPIResponseTime(response))
})
})
参数
response授权 (所须. Playwright API请求的回应.
支助
如果你有任何问题,可以联系我们的客户支持 支持@ checklyhq.com。 。 。 .