У Specflow есть 3 попытки, и я остановил его на 0 - PullRequest
0 голосов
/ 16 июня 2020

Я обновил свой профиль, чтобы останавливаться после сбоев, и повторить счет до 0. Тем не менее, Specflow по-прежнему повторно запускает неудачные тесты 3 раза и останавливается после сбоев после 3 сбоев. посоветуйте пожалуйста.

Ответы [ 2 ]

0 голосов
/ 18 июня 2020

В профиле .sr вам нужно установить retryFor = "None"

пример:

 <Execution stopAfterFailures="100" retryFor="None" testThreadCount="4" testSchedulingMode="Sequential" />
0 голосов
/ 16 июня 2020

На самом деле, я думаю, что отвечу на свой вопрос.

Я создаю свой собственный файл runsettings

<?xml version="1.0" encoding="utf-8"?>
  <RunSettings>
    <!-- Configurations that affect the Test Framework -->
    <RunConfiguration>
      <MaxCpuCount>1</MaxCpuCount>
      <!-- Path relative to solution directory -->
      <ResultsDirectory>.\TestResults</ResultsDirectory>

      <!-- [x86] | x64
        - You can also change it from menu Test, Test Settings, Default Processor Architecture -->
      <TargetPlatform>x86</TargetPlatform>

      <!-- Framework35 | [Framework40] | Framework45 -->
      <TargetFrameworkVersion>Framework40</TargetFrameworkVersion>

      <!-- Path to Test Adapters -->
      <TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>
    </RunConfiguration>

    <!-- Configurations for data collectors -->
    <DataCollectionRunSettings>
      <DataCollectors>
        <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
          <Configuration>
            <CodeCoverage>
              <ModulePaths>
                <Exclude>
                  <ModulePath>.*CPPUnitTestFramework.*</ModulePath>
                </Exclude>
              </ModulePaths>

              <!-- We recommend you do not change the following values: -->
              <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
              <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
              <CollectFromChildProcesses>True</CollectFromChildProcesses>
              <CollectAspDotNet>False</CollectAspDotNet>

            </CodeCoverage>
          </Configuration>
        </DataCollector>

      </DataCollectors>
    </DataCollectionRunSettings>

    <!-- Parameters used by tests at runtime -->
    <TestRunParameters>
      <Parameter name="webAppUrl" value="http://localhost" />
      <Parameter name="webAppUserName" value="Admin" />
      <Parameter name="webAppPassword" value="Password" />
    </TestRunParameters>

    <!-- Adapter Specific sections -->

    <!-- MSTest adapter -->
    <MSTest>
      <MapInconclusiveToFailed>True</MapInconclusiveToFailed>
      <CaptureTraceOutput>false</CaptureTraceOutput>
      <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
      <DeploymentEnabled>False</DeploymentEnabled>
      <AssemblyResolution>
        <Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
      </AssemblyResolution>
      </RunSettings>
           <!-- Configurations for SpecFlow+ Runner -->
               <SpecRun>
              <Profile>{add my profile file name here}</Profile>
              <ReportFile>CustomReport.html</ReportFile>
              <GenerateSpecRunTrait>false</GenerateSpecRunTrait>
              <GenerateFeatureTrait>false</GenerateFeatureTrait>
              </SpecRun>
          </RunSettings>

    </MSTest>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...