空手道:如何在afterScenario中使用方案的响应 [英] Karate : How to use response of scenario in afterScenario

查看:95
本文介绍了空手道:如何在afterScenario中使用方案的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在afterScenario中使用场景响应的最佳方法是什么?

What is the best way to use the response of scenario in afterScenario??

Background:    
   * configure afterScenario = function(response){if(response.key){ karate.log('key is present');} else{karate.log('key is not present');} }

    Scenario: get all users 

    Given path 'users'
    When method get
    Then status 200

推荐答案

尝试不使用输入参数的函数

Try function without input params

* configure afterScenario = function(){if(response.key){ karate.log('key is present');} else{karate.log('key is not present');} }

如果response变量可用于钩子,则此方法应该起作用.

if the response variable available for hooks this should work.

这篇关于空手道:如何在afterScenario中使用方案的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆