Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 关于后置法空手道测试用例的问题_Unit Testing_Cucumber_Gherkin_Karate - Fatal编程技术网

Unit testing 关于后置法空手道测试用例的问题

Unit testing 关于后置法空手道测试用例的问题,unit-testing,cucumber,gherkin,karate,Unit Testing,Cucumber,Gherkin,Karate,我有一个端点URL,在Swagger中,我必须通过某些字段来测试POST方法。我想知道是否有人举过一个例子,说明如何为POST方法设置空手道测试 是的,文档中有很多内容: 如果您遵循快速入门,您将获得一个带有工作日志的示例项目: 是的,文档中有很多内容: 如果您遵循快速入门,您将获得一个带有工作日志的示例项目: 非常感谢。我试试看,谢谢!我要试试这个。 Scenario: create a user and then get it by id * def user = """ { "n

我有一个端点URL,在Swagger中,我必须通过某些字段来测试POST方法。我想知道是否有人举过一个例子,说明如何为POST方法设置空手道测试

是的,文档中有很多内容:

如果您遵循快速入门,您将获得一个带有工作日志的示例项目:


是的,文档中有很多内容:

如果您遵循快速入门,您将获得一个带有工作日志的示例项目:


非常感谢。我试试看,谢谢!我要试试这个。
Scenario: create a user and then get it by id

* def user =
"""
{
    "name": "Test User",
    "username": "testuser",
    "email": "test@user.com",
    "address": {
      "street": "Has No Name",
      "suite": "Apt. 123",
      "city": "Electri",
      "zipcode": "54321-6789"
    }
}
"""

Given url 'https://jsonplaceholder.typicode.com/users'
And request user
When method post
Then status 201