使用Specflow重新运行失败的测试. [英] Rerun failed tests using Specflow.Retry

查看:61
本文介绍了使用Specflow重新运行失败的测试.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用specflow.retry插件

I'm trying to rerun failed tests in specflow using specflow.retry plugin https://github.com/DamirAinullin/specflow-retry

这是我的App.config文件:

Here is my App.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <unitTestProvider name="nUnit" />
    <plugins>
        <add name="SpecFlow.Retry.Generator" path="..\packages\SpecFlow.Retry.2.4.0\lib\net45" type="Generator" />
    </plugins>
</configuration>

如果有人提示我这边出了什么问题,我将不胜感激

I'd appreciate any help if someone gives a hint what's wrong from my side

以下是我开始构建该项目的一些警告:

Here is a few warning that i get on building the project:

: warning NU1608: Detected package version outside of dependency constraint: SpecFlow.CustomPlugin 2.4.0 requires SpecFlow (= 2.4.0) but version SpecFlow 3.3.74 was resolved.
warning NU1701: Package 'FluentAssert 1.0.0.11' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
: warning NU1701: Package 'SpecFlow.Retry 2.4.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2081,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\me\.nuget\packages\magick.net-q16-x64\7.21.1\lib\netstandard20\Magick.NET-Q16-x64.dll", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
: warning CS0618: 'ScenarioContext.Current' is obsolete: 'Please get the ScenarioContext via Context Injection - https://www.specflow.org/documentation/Context-Injection/'
: warning CS0618: 'ScenarioContext.Current' is obsolete: 'Please get the ScenarioContext via Context Injection - https://www.specflow.org/documentation/Context-Injection/'
>Done building project "TestAutomation.UI.Tests.csproj".
=

推荐答案

SpecFlow.Retry仅支持SpecFlow 2 *.您不能在SpecFlow 3中使用它.我们在插件基础结构中从2更改为3.

SpecFlow.Retry only supports SpecFlow 2.*.
You can't use it with SpecFlow 3. We changed a lot in the plugin infrastructure from 2 to 3.

该插件似乎已不再维护,因为最新更改已于2年前完成.

It looks like the plugin isn't maintained anymore, as the latest change was done more than 2 years ago.

如果要切换单元测试运行器,则可以切换到内置了重试功能的SpecFlow +运行器.文档位于

If you want to switch unit test runner, you could switch to the SpecFlow+ Runner which has a retry feature build in. Documentation at https://docs.specflow.org/projects/specflow-runner/en/latest/Profile/Execution.html

完全公开:我是SpecFlow和SpecFlow +的社区经理.

Full Disclosure: I am the Community Manager of SpecFlow and SpecFlow+

这篇关于使用Specflow重新运行失败的测试.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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