赛普拉斯-具有请求有效负载的API调用-如何处理代码中的有效负载

时间:2019-12-04 14:37:17

标签: cypress

我需要帮助来了解如何使用cy.route()和cy.wait()来检查结果下面的三个API调用中的每个调用是否为200或说成功。

HTTP地址

请求网址:https://......../ABC 请求方法:POST 状态码:200 OK

请求有效负载-基于该值,我看到使用上述Http请求的三个API调用如下

{CountryCode: "USA", countryRatingType: "A"}
{CountryCode: "USA", countryRatingType: "B"}
{CountryCode: "USA", countryRatingType: "C"}

在上述三个API调用中,各个API的countryRatingType保持不变,但国家/地区代码值根据输入而更改

假设我选择了CAN作为国家/地区

{CountryCode: "CAN", countryRatingType: "A"}
{CountryCode: "CAN", countryRatingType: "B"}
{CountryCode: "CAN", countryRatingType: "C"}

1 个答案:

答案 0 :(得分:0)

@foo.bars = @bars
@foo.bars << @bars