简体   繁体   English

如何将外部数据源与 Cucumber 功能文件集成

[英]how to integrate external data source with Cucumber feature file

I have created cucumber feature file.我已经创建了 cucumber 功能文件。 As of now I am giving input from scenario outline with Examples.截至目前,我正在通过示例提供场景大纲的输入。

But My test data is very huge now.但是我现在的测试数据非常庞大。 I just want to give input from CSV or EXCEL.我只想从 CSV 或 EXCEL 提供输入。

Could you please explain How to achieve this?您能否解释一下如何实现这一目标?

If you are using cucumber version 5+ you can use qaf-cucumber that will enable external test data with in-built data providers and many other features from qaf.如果您使用的是 cucumber 版本 5+,您可以使用qaf-cucumber ,它可以使用内置数据提供程序和 qaf 的许多其他功能启用外部测试数据。 Below is example of test data from CSV usage.下面是 CSV 使用的测试数据示例。 You can switch to any available data-provider or you can create custom as well.您可以切换到任何可用的数据提供者,也可以创建自定义。

Feature: my feature    

@dataFile:resources/data/testdata.csv
Scenario: my scenario
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM