Ошибки в шаблонах отчетов Specflow - PullRequest
1 голос
/ 25 февраля 2020

При запуске проекта Specflow я сталкиваюсь с ошибкой, когда отчет Specflow по умолчанию работает нормально, но как только я реализую его собственную версию с использованием файла ReportTemplate.cshtml, он выдает множество ошибок, требующих Specflow, helper и TechTalk.SpecRun.Framework.TestSuiteStructure и другие библиотеки не могут быть найдены, и я не могу понять, почему, потому что они есть (конечно, мои тесты Specflow не запустятся, если Specflow не будет установлен и отчет по умолчанию не будет сгенерирован идеально). Любая помощь приветствуется, поскольку я новичок в отчетах Specflow.

с использованием. NET Core 3.1

.csproj


  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
    <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
    <PackageReference Include="NUnit" Version="3.12.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Protractor" Version="0.13.0" />
    <PackageReference Include="RestSharp" Version="106.10.1" />
    <PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
    <PackageReference Include="SpecFlow" Version="3.1.82" />
    <PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.1.82" />
    <PackageReference Include="SpecRun.Runner" Version="3.1.48" />
    <PackageReference Include="SpecRun.SpecFlow" Version="3.1.48" />
  </ItemGroup>

</Project>

.runsettings file:


  <!-- Configurations for SpecFlow+ Runner -->
  <SpecRun>
    <Profile>./RunSettings/FAKE.srprofile</Profile>
    <ResultsDirectory>.\TestResults</ResultsDirectory>
    <ReportFile>Jacks_Sample_Reports_Template.html</ReportFile>
    <GenerateSpecRunTrait>false</GenerateSpecRunTrait>
    <GenerateFeatureTrait>false</GenerateFeatureTrait>
  </SpecRun>
</RunSettings>

.srprofile

<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
  <Settings projectName="PLACEHOLDER_NOTREAL" reportTemplate=".\\..\\..\\..\\RunSettings\\JacksSampleTemplate.cshtml"/>
  <!-- Look at this website for execution configurations : "https://github.com/SpecFlowOSS/SpecFlowPlus-Resources/wiki/Execution"-->
  <Execution stopAfterFailures="3" testThreadCount="1" testSchedulingMode="Sequential" retryCount="0" />
  <!-- For collecting by a SpecRun server update and enable the following element. For using the 
      collected statistics, set testSchedulingMode="Adaptive" attribute on the <Execution> element.
    <Server serverUrl="http://specrunserver:6365" publishResults="true" />
  -->
  <TestAssemblyPaths>
    <TestAssemblyPath>FAKE.dll</TestAssemblyPath>
  </TestAssemblyPaths>
  <DeploymentTransformation>
    <Steps>
      <!-- sample config transform to change the connection string-->
      <!--<ConfigFileTransformation configFile="App.config">
        <Transformation>
          <![CDATA[<?xml version="1.0" encoding="utf-8"?>
                            <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
                <connectionStrings>
                  <add name="MyDatabase" connectionString="Data Source=.;Initial Catalog=MyDatabaseForTesting;Integrated Security=True" 
                       xdt:Locator="Match(name)" xdt:Transform="SetAttributes(connectionString)" />
                </connectionStrings>
                            </configuration>
                        ]]>
        </Transformation>
      </ConfigFileTransformation>-->
    </Steps>
  </DeploymentTransformation>
</TestProfile>

enter image description here

Список ошибок go включен, но я вполне уверен, что они связаны с отсутствующими библиотеками

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