Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Reuven Y.
    @robi-y
    Thanks
    Michael Whelan
    @mwhelan
    hmmm, some images haven't made it over. Need to fix that.
    But yeah, I think all the old docs have been migrated
    thanks for setting up gitter for BDDfy Jake. Very useful.
    Reuven Y.
    @robi-y
    Hello all,
    I thougt of extending / configuring BDDFy to produce a living glossary (see e.g. this interesting coming book https://leanpub.com/livingdocumentation)
    a. Would be happy to hear you opinions
    b. What is the proper way? Is it "just" a custom framework? Does BDDfy has attribure extension mechanism? e.g. for adding an attribute like [Gloassary] for decorating classes representing domain entities.
    Thanks
    Michael Whelan
    @mwhelan
    Tell me more about how that would work?
    not "just" a custom framework. The customisation means it can be a lot of things you want to be
    *want it to be
    Reuven Y.
    @robi-y
    For a start, it will scan the source files, e.g., of a project containg classes annotated with gloassary attribute and produce a nice html with a glossary.
    E.g.,
    [Gloassary("Main entity for holding client details")] class Client {...
    Michael Whelan
    @mwhelan
    where would BDDfy fit in?
    Reuven Y.
    @robi-y
    First of all I though this might fit the overall TestStack goal. From implementation point of view BDDfy already has the abilities of looking for attributes and producing reports, so maybe some could be reused ??
    Michael Whelan
    @mwhelan
    BDDfy does that during a test run. What you are describing seems more of a process in its own right
    Might have some similarities to our ConventionTests project?
    But I see where you are coming from with the reporting in BDDfy
    BDDfy only finds attributes on test classes
    Thanks for the book link. I'm very interested in living documentation and meaningful ways to expand it. Seems like the author has thought pretty deeply in this area
    Liam McLennan
    @liammclennan
    Hello. Say I have mockups for user stories or scenarios, is it possible to get them to come through in the report?
    Liam McLennan
    @liammclennan
    seems not TestStack/TestStack.BDDfy#173
    Shayne van Asperen
    @shaynevanasperen
    Hello all. Please see https://github.com/TestStack/TestStack.BDDfy/issues/228#issuecomment-293100656 and https://github.com/TestStack/TestStack.BDDfy/issues/228#issuecomment-293100656. I hope you don't mind that I named my package with a prefix of TestStack.BDDfy. I'm happy to pass ownership to you if you think that would be best. I'm also happy to contribute towards any work that would make my library unnecessary (by natively supporting Xunit parallel test execution in TestStack.BDDfy).
    Mehdi Khalili
    @MehdiK
    No worries @shaynevanasperen. I recommend that naming convention to promote a community of extensions.
    Thanks for the contribution.
    Omer Raviv
    @OmerRaviv
    Hey folks, on November 21st there will be an episode of Visual Studio Toolbox with Robert Green on Channel9 where I presented "Creating High Quality Visual Studio extensions". I talked quite extensively about BDDfy (both in general and in the context of creating integration tests for VS extensions).
    I hope this will open more people's eyes to the amazing power of BDDfy :)
    Mehdi Khalili
    @MehdiK
    Nice. Thanks @OmerRaviv. Looking forward to watching it.
    Omer Raviv
    @OmerRaviv
    @MehdiK Sorry that I haven't updated this, but that video has long since been released https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Building-High-Performance-Extensions-Part-1
    Mehdi Khalili
    @MehdiK
    Nice one +1 Checking it out @OmerRaviv
    Omer Raviv
    @OmerRaviv
    @MehdiK Sweet :) Also /CC @mwhelan @JakeGinnivan whose faces are also on my slide deck :)
    Jake Ginnivan
    @JakeGinnivan
    Awesome!
    Omer Raviv
    @OmerRaviv
    @JakeGinnivan Yeah, Shouldly also got a nice plug :)
    Marius Morar
    @marius02
    Bddfy is a great framework, I think more people should use it in their applications, but I have a curiosity, what about the future of the framework, there will be new features added?new updates? The last changes in github are from 2 years ago
    Sai Lee
    @Sailee316_twitter
    Sequence contains more than one element at System.Linq.Enumerable.SingleOrDefaultTSource
    at TestStack.BDDfy.FluentScanner1.<CreateTitle>b__16_3(<>f__AnonymousType02 i)
    at System.Linq.Enumerable.SelectEnumerableIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
    at TestStack.BDDfy.FluentScanner1.<>c__DisplayClass16_0.<CreateTitle>b__0() at TestStack.BDDfy.StepTitle.ToString() at TestStack.BDDfy.Step.get_Title() at TestStack.BDDfy.Reporters.TextReporter.GetStepWithLines(Step s) at System.Linq.Enumerable.SelectEnumerableIterator2.ToList()
    at System.Linq.Enumerable.ToListTSource
    at TestStack.BDDfy.Reporters.TextReporter.Process(Story story)
    at TestStack.BDDfy.Engine.Run()
    at TestStack.BDDfy.BDDfyExtensions.BDDfy(Object testObject, String scenarioTitle, String caller)
    Hi at the end of my test run when BDDfy tries to create report I get the above error. Does anyone know why?
    Nicholas Jordaan
    @remiX-
    Sucks this project is dead :(
    Jake Ginnivan
    @JakeGinnivan
    I'd be happy to help out anyone who wanted to start maintaining. The original maintainers (including me) just don't work in .net anymore so can't maintain
    Nicholas Jordaan
    @remiX-
    Anyone able to?
    Marius Morar
    @marius02
    @all could be possible to save the tests to a mysql database(using entity framework)as they run -> to create the Context and all the entity models/services inside inside BDDfy project ?
    Marius Morar
    @marius02
    Is there a way to get the FileReportModel Model after just one test? in case you have a class with 5 tests to get the updated FileReportModel Model for each test?
    right now the only way is at the end of the test or class or namespace in CreateRealTimeReport method
    Michael Whelan
    @mwhelan
    The FileReportModel is part of the HTML report, which runs as a batch processor. These run after all the tests have completed. There are things that you can do after each test, for example using a standard processor. I have saved all the BDDfy test results to a database in the past, but I think I did it as a batch processor at the end. I'm not sure what you are trying to do in the second part of your first question regarding creating models inside BDDfy?
    Marius Morar
    @marius02
    @mwhelan thank you for sharing this, actually I was looking for StoryCache.Stories, and with this I have all the Story object populated after each test was run in order to handle the logic to save it to database
    Marius Morar
    @marius02
    @mwhelan from what you know using the BDDfy is there a way to compare 2 Test objects between executions? for example for the same Test in case we modify the steps/adding new tags/ renaming the Test name and so on, to be aware of those changes somehow?
    Michael Whelan
    @mwhelan
    I don't quite understand what you are asking. Can you elaborate a bit?
    Marius Morar
    @marius02
    Yes, so basically I'm saving each test to a database, and I want to add a mechanism that is able to tell when a test was last updated
    Last updated in the test framework, because there are cases when you have to modifie an existing Test
    Michael Whelan
    @mwhelan
    @marius02 if I understand you correctly, you are wanting to know essentially if the test file changes over time, say with changing the steps or adding tags? If that's the case it would seem that you would have to keep that in the database somehow and check it there. BDDfy does not maintain any state between test runs. As you've already seen, it provides plenty of hooks for a dev to do this sort of thing themselves ... Not sure if that is helpful...
    Marius Morar
    @marius02
    @mwhelan thank you for the reply, you're right, I'm handling it in the database, but indeed BDDfy provides plenty of hooks
    Marius Morar
    @marius02
    @mwhelan is there a way to set a test as BDDfy without using .BDDfy(); at the end of the test like this :
          [Test]
          [Timeout(Globals.cmTimeout)]
          public void TestIsDetailsButtonEnabled()
          {
             this.Given(_ => GivenAn())
                .When(_ => WhenINavigateTo())
                .And(_ => WhenIOpen())
                .Then(_ => ThenThe())
                .WithTags(Tags.Tag1, Tags.Tag2)
                .BDDfy();
          }
    I'm referring to a test like this :
          [Test]
          public void TestIsDetailsButtonEnabled()
          {  
             NavigateToPage()
                .TestPageOne
                .SelectTab(1)
                .DetailsButton
                .IsEnabled
                .Should()
                .BeTrue();
          }
    Maybe there is also an attribute? or maybe we can add a custom attribute for it ? or maybe it is not possible at all thank you in advance
    Michael Whelan
    @mwhelan

    Short answer is yes, it is possible. Longer answer is, it depends on some of your preferences. I've never used the fluent interface you're using here, so I'm not as sure how to hook into some of the customizations that BDDfy provides for there (but I think you could possibly find a solution there).

    I see you are using NUnit, like me, and your suggestion of the attribute got me thinking about solutions within NUnit. I recently found NUnit quite extensible when I was able to create an attribute to get BDDfy test names to read correctly in Visual Studio/Azure DevOps. You work with NUnit at build time for that, but I think you would need to customize the runtime behaviour of NUnit for what you want (though technically the fluent interface is just building up code to run and it is BDDfy that is running at runtime so maybe you could do something at build time too). The NUnit ICommandWrapper interface looks like it might provide the runtime hooks you want to run the test method, then call BDDfy. Checkout the RetryAttribute for an interesting example.

    Alternately, you might like to consider Fixie as your test runner, as I suspect it might be quite straightforward to do the customization you are looking for there.

    So, I haven't explained my yes answer yet. I left it to last, as I assume you prefer the fluent interface and I have always preferred the reflective API. I personally have a similar preference to you in that I don't want to put BDDfy (nor the NUnit Test attribute) on every test. I configure NUnit to work with BDDfy in one base class for each test project.

    [TestFixture]
    public abstract class ScenarioFor<TSut, TStory> : Specify.ScenarioFor<TSut, TStory>
        where TSut : class
        where TStory : Story, new()
    {
         protected IDb Db => Container.Get<IDb>();
    
        [Test]
        public override void ExecuteScenario()
        {
            this.BDDfy();
        }
    }

    I then inherit all my tests from that class and NUnit is smart enough to discover all the tests. An example would look like this. The AysncApiDriver is the SUT (system under test) and is resolved from the application's IoC container.

    public class GetExistingToDo : ScenarioFor<AsyncApiDriver, ToDoStory>
    {
        private ApiResponse<ToDoItemDto> _result;
        private ToDoItem _existingItem;
    
        public void Given_I_have_created_a_to_do()
        {
            _existingItem = new ToDoItemBuilder().Persist();
        }
    
        public async Task When_I_attempt_to_view_it()
        {
             _result = await SUT.GetAsync<ToDoItemDto>(ApiRoutes.ToDo.GetFor(_existingItem.Id));
        }
    
        public void Then_I_should_see_all_the_things_I_have_to_do()
        {
            _result.StatusCode.Should().Be(HttpStatusCode.OK);
            _result.Model.Id.Should().Be(_existingItem.Id);
        }
    }

    If you want to see a bit more about some of the customisation hooks in BDDfy I wrote about some here and there are a few more posts under the BDDfy category. This is how I use BDDfy with my clients.