Specflow не может найти определения шагов - PullRequest
0 голосов
/ 26 января 2020

Я запускаю проект с Specflow, однако, мои определения шагов не найдены. Я использую: Visual Studio Code Linux Ubuntu

Это мой файл функций

# language: pt

Funcionalidade: Cadastro de filas

    Contexto:
        Dado que "Jose" acessa a aplicação de backoffice

    Cenário: Realizar cadastro de uma fila com sucesso
        Quando ele realiza o cadastro de uma fila preenchendo todos os campos corretamente
        Então ele deve ver que a fila foi cadastrada com sucesso

Это .feature.cs, сгенерированный автоматически

// ------------------------------------------------------------------------------
//  <auto-generated>
//      This code was generated by SpecFlow (http://www.specflow.org/).
//      SpecFlow Version:3.1.0.0
//      SpecFlow Generator Version:3.1.0.0
// 
//      Changes to this file may cause incorrect behavior and will be lost if
//      the code is regenerated.
//  </auto-generated>
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
namespace e2e_tests.Features
{
    using TechTalk.SpecFlow;
    using System;
    using System.Linq;


    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.1.0.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [NUnit.Framework.TestFixtureAttribute()]
    [NUnit.Framework.DescriptionAttribute("Cadastro de filas")]
    [NUnit.Framework.CategoryAttribute("cadastro-filas")]
    public partial class CadastroDeFilasFeature
    {

        private TechTalk.SpecFlow.ITestRunner testRunner;

        private string[] _featureTags = new string[] {
                "cadastro-filas"};

#line 1 "CreateQueue.feature"
#line hidden

        [NUnit.Framework.OneTimeSetUpAttribute()]
        public virtual void FeatureSetup()
        {
            testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
            TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("pt"), "Cadastro de filas", "    Clientes", ProgrammingLanguage.CSharp, new string[] {
                        "cadastro-filas"});
            testRunner.OnFeatureStart(featureInfo);
        }

        [NUnit.Framework.OneTimeTearDownAttribute()]
        public virtual void FeatureTearDown()
        {
            testRunner.OnFeatureEnd();
            testRunner = null;
        }

        [NUnit.Framework.SetUpAttribute()]
        public virtual void TestInitialize()
        {
        }

        [NUnit.Framework.TearDownAttribute()]
        public virtual void TestTearDown()
        {
            testRunner.OnScenarioEnd();
        }

        public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
        {
            testRunner.OnScenarioInitialize(scenarioInfo);
            testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs<NUnit.Framework.TestContext>(NUnit.Framework.TestContext.CurrentContext);
        }

        public virtual void ScenarioStart()
        {
            testRunner.OnScenarioStart();
        }

        public virtual void ScenarioCleanup()
        {
            testRunner.CollectScenarioErrors();
        }

        public virtual void FeatureBackground()
        {
#line 9
    #line hidden
#line 10
        testRunner.Given("que \"José\" acessa a aplicação de backoffice", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Dado ");
#line hidden
        }

        [NUnit.Framework.TestAttribute()]
        [NUnit.Framework.DescriptionAttribute("Realizar cadastro de uma fila com sucesso")]
        [NUnit.Framework.CategoryAttribute("prioridade:alta")]
        [NUnit.Framework.CategoryAttribute("valido")]
        public virtual void RealizarCadastroDeUmaFilaComSucesso()
        {
            string[] tagsOfScenario = new string[] {
                    "prioridade:alta",
                    "valido"};
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Realizar cadastro de uma fila com sucesso", null, new string[] {
                        "prioridade:alta",
                        "valido"});
#line 13
    this.ScenarioInitialize(scenarioInfo);
#line hidden
            bool isScenarioIgnored = default(bool);
            bool isFeatureIgnored = default(bool);
            if ((tagsOfScenario != null))
            {
                isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any();
            }
            if ((this._featureTags != null))
            {
                isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any();
            }
            if ((isScenarioIgnored || isFeatureIgnored))
            {
                testRunner.SkipScenario();
            }
            else
            {
                this.ScenarioStart();
#line 9
    this.FeatureBackground();
#line hidden
#line 14
        testRunner.When("ele realiza o cadastro de uma fila preenchendo todos os campos corretamente", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Quando ");
#line hidden
#line 15
        testRunner.Then("ele deve ver que a fila foi cadastrada com sucesso", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Então ");
#line hidden
            }
            this.ScenarioCleanup();
        }
    }
}
#pragma warning restore
#endregion

это определение шага, которое я сгенерировал, но, видимо, оно не было выполнено.

using System;
using TechTalk.SpecFlow;

namespace e2e_tests.StepDefinitions
{
  [Binding]
  public class CreateQueueSteps
  {
    [When(@"ele realiza o cadastro de uma fila preenchendo todos os campos corretamente")]
    public void WhenEleRealizaOCadastroDeUmaFilaPreenchendoTodosOsCamposCorretamente()
    {
      Console.WriteLine("teste");
    }

  }
}

Кто-нибудь знает, что я не так делаю?

спасибо большое!

...