如果我在不同功能中多次使用该函数,callonce函数是否会再次执行该功能? [英] Does the callonce function executes the feature again if i use use in this function multiple times in different features?

查看:40
本文介绍了如果我在不同功能中多次使用该函数,callonce函数是否会再次执行该功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有多个功能文件.功能文件之一创建令牌.我只想在测试开始时调用一次此功能,然后在其他功能中使用令牌,而不必一次又一次地执行令牌功能.

I have multiple feature files in my project. One of the feature file creates tokens. I want to call this feature only once at the start of the test and then use the tokens in the other feature without executing the token feature again and again.

有人可以帮我吗?

推荐答案

查看karate-config.js中的callSingle(),请参考文档:

Look at callSingle() in karate-config.js and please refer the docs: https://github.com/intuit/karate#hooks

var result = karate.callSingle('classpath:tokens.feature');

这篇关于如果我在不同功能中多次使用该函数,callonce函数是否会再次执行该功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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