功能文件(QAF)的CustomDataProvider [英] CustomDataProvider for feature file (QAF)

查看:132
本文介绍了功能文件(QAF)的CustomDataProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用QAF,它是一个了不起的工具,但是我有一个问题。
是否有任何方法可以像在BDD文件中一样使用自定义数据提供程序来参数化黄瓜特征步骤?

I'm using QAF and it's amazing tool, but i have one problem. Are there any ways to parameterize cucumber feature steps with custom data provider as it's done in BDD files?

例如,我们可以从外部文件插入数据

For example, we can insert data from external file

Examples: {'datafile':'resources/testdata.txt'}

在.BDD中是这样的:

In .BDD it's done like this:

SCENARIO: Data provider with testng method argument and context
META-DATA: {"dataProvider":"dp-with-testngmethod-contex", "dataProviderClass":"com.qmetry.qaf.automation.impl.CustomDataProvider"}
# Comment '${value}'
END


推荐答案

如果您发现内置数据提供程序可以无法满足您的需求,那么您可以提供自定义数据提供程序。如果是小黄瓜,则可以提供 Examples

If you found in-built data-providers does not satisfy your need then you can provide custom data provider. In case of gherkin you can provide it with Examples:

Examples: {"dataProvider":"dp-with-testngmethod-contex", "dataProviderClass":"com.qmetry.qaf.automation.impl.CustomDataProvider"}

任何< href = https://qmetry.github.io/qaf/latest/maketest_data_driven.html#meta-data rel = nofollow noreferrer>用于数据提供者的元数据可以与示例
此外,使用最新的 BDD2语法,您还可以提供它如下所示:

Any of the meta-data for data-provider can be used with Examples. Moreover with latest BDD2 syntax you can also provide it as below:

@dataProvider:dp-with-testngmethod-contex
@dataProviderClass:com.qmetry.qaf.automation.impl.CustomDataProvider
@regression 
Scenario: my scenario
...

这篇关于功能文件(QAF)的CustomDataProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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