空手道Api测试-如何将数据从一个功能文件传递到另一个功能文件 [英] Karate Api Testing - How to pass data from one feature file to another
本文介绍了空手道Api测试-如何将数据从一个功能文件传递到另一个功能文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将数据从一个功能文件传递到另一个功能文件.
I need to pass data from one feature file to another.
功能(1):创建一个新用户
Feature(1): Create a new user
背景:
* url 'http://127.0.0.1:8900/'
* header Accept = 'application/json'
Scenario: Create a new user
Given path '/user'
And request {"email" : "test@test.com", "name" : "Brian"}
When method post
And def newUser = $..id
Then status 201
功能(2):从功能1调用newUser
Feature(2): Call newUser from feature 1
背景:
* url 'http://127.0.0.1:8900/'
* header Accept = 'application/json'
Scenario: Call User
* def newUser = $..id
* print newUser
推荐答案
查看全文