将Specflow方案和标签转换为列表

时间:2018-06-22 20:46:07

标签: c# python visual-studio selenium specflow

我有几十个SpecFlow功能文件,其中有数百个具有不同结构和标签的测试场景,如下所示(文件1,文件2)。

要跟踪创建的所有测试的列表,我想获取一个数据表文件-csv,xls或等效文件-列出所有方案和类似的标签(使用最简单的解决方案-标签未分组):< / p>

enter image description here

我认为最好的选择是创建一个脚本以在功能文件目录上运行并提取数据。有谁知道该算法将如何提取具有这些不同结构的文件的线索?

Specflow文件-代码示例:

File1.feature

Feature: ProductOffer
	Background:
		Given I access the site application
@P1
@Desktop
@DetailPage
@C693287
@TeamA
Scenario: Duplicate Product with at least one variant from a different country
	Given …
	When …
	Then …
	And …

@Regression
@Desktop
@Mobile
@Tablet
@DetailPage
@C838942
@Quarantine
Scenario: Product in Brazil with shipping country and store name in description
	Given …
	And …
	Then …
	And …
	When …
	Then …
	And …

@P1
@Mobile
@DetailPage
@C838789
@TeamD

Scenario: Duplicate Product with at least one variant from a different page
	Given …
	When …
	Then …

File2.feature

Feature: ChangeCountry

@Desktop
@MobileQuarantine
@ChangeCountry
Scenario Outline: Access Ste and change country on footer
	Given …
	Then …
	@C702953
	Examples:
	 | Country | Subfolder | Search |
	 | Canada  | ca        | Search |
	@C89676
	Examples:
	 | Country | Subfolder | Search |
	 | China   | cn        | 搜索     |

@P3
@Desktop
@Quarantine
@C135722

Scenario: Validate location on change country while accessing through the header
	Given …
	When …
	Then …

0 个答案:

没有答案