c# - Specflow - 场景大纲测试被忽略
问题描述
我正在使用 Selenium 和 Specflow 开发测试自动化,但是当我尝试运行我的 Scenario Outline 时,它被完全忽略了。
我已经尝试调试它并且没有执行任何步骤,我不知道为什么。
常见场景工作得很好。
我在 Visual Studio Code 中使用 .NET Core 2.2。我当前的测试 Runner 是 NUnit 版本 3.12.0,而我的 Specflow 版本是 3.0.225。
常规场景没有显示出任何这样的问题。
@FilterScenario
Scenario Outline: Validating filter box and grid results
Given I accessed the screen
And the filter box is on
When I select the groups <TypeGroup1>, <TypeGroup2>, <TypeGroup3>
And select the teams <TypeTeam1>, <TypeTeam2>, <TypeTeam3>
And click the Apply button
Then the grid should show me only results that match groups <TypeGroup1>, <TypeGroup2>, <TypeGroup3> and teams <TypeTeam1>, <TypeTeam2>, <TypeTeam3>
Examples:
| TypeGroup1 | TypeGroup2 | TypeGroup3 | TypeTeam1 | TypeTeam2 | TypeTeam3 |
| Type 1 | | | Type 1 | | |
| Type 1 | Type 2 | Type 3 | Type 1 | Type 2 | Type 3 |
| | | | Type 1 | | |
我的项目中包含的软件包:
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="Specflow" Version="3.0.225" />
<PackageReference Include="Specflow.Assist.Dynamic" Version="1.4.1" />
<PackageReference Include="Specflow.NUnit" Version="3.0.225" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.0.225" />
解决方案
您的功能文件中有问题。
@FilterScenario
Scenario Outline: Validating filter box and grid results
Given I accessed the screen
And the filter box is on
When I select the groups '<TypeGroup1>', '<TypeGroup2>', '<TypeGroup3>'
And select the teams '<TypeTeam1>', '<TypeTeam2>', '<TypeTeam3>'
And click the Apply button
Then the grid should show me only results that match groups '<TypeGroup1>', '<TypeGroup2>', '<TypeGroup3>' and teams '<TypeTeam1>', '<TypeTeam2>', '<TypeTeam3>'
Examples:
| TypeGroup1 | TypeGroup2 | TypeGroup3 | TypeTeam1 | TypeTeam2 | TypeTeam3 |
| Type 1 | | | Type 1 | | |
| Type 1 | Type 2 | Type 3 | Type 1 | Type 2 | Type 3 |
| | | | Type 1 | | |
重新生成 stepdef 并重试
推荐阅读
- python-3.x - How to remove empty x-axis coordinates in Matplotlib
- node.js - 从节点流式传输并在 javascript 客户端上生成 blob 的文件要大得多且已损坏
- excel - 根据第一行中的值选择列并将这些列复制到另一个工作表
- javascript - 使用 JS 同时应用 Hue-Rotation、Saturation 和 Lightness Filters
- docker - redis-sentinel 日志被 +sentinel-address-switch 和 +sentinel-address-update 淹没
- c# - PowerShell:.NET 程序集的 Import-Module 或 Add-Type?
- python - 如何在python中获取一行字典
- yaml - serverless.yml 文件中打包作业的使用
- javascript - 在类创建的对象上返回未定义
- sql - 交叉表查询 - 记录消失