CustomDataProvider for feature file (QAF)

2020-04-11 05:17发布

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'}

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

1条回答
我命由我不由天
2楼-- · 2020-04-11 05:34

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"}

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
...
查看更多
登录 后发表回答