jeudi 5 décembre 2019

Karate Api Testing - How to pass data from one feature file to another

I need to pass data from one feature file to another.

Feature(1): Create a new user

Background:

* 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

Feature(2): Call newUser from feature 1

Background:

* url 'http://127.0.0.1:8900/'
* header Accept = 'application/json'
 Scenario: Call User
  * def newUser = $..id
  * print newUser

Aucun commentaire:

Enregistrer un commentaire