我想写一个测试来测试响应的主体
it('passes', () => {
cy.request('POST',"localhost:8080",
{
"body":"Hello World",
"header": "Content-Type:application/json"
})
assert that response body HELLO WORLD
})
如何Assert响应体?I curl下面的命令将传递响应体
curl -H "Content-Type:application/json" localhost:8080 -d "Hello World"
HELLO WORLD%
1条答案
按热度按时间euoag5mw1#
文档中有一些示例,例如
@jjhelguero的真实示例