Giter VIP home page Giter VIP logo

nscenario's Issues

Option to create md based report

For smooth communication with the business stakeholders, it could be useful to be able to generate from the test output a .md file per scenario. A build server task could publish then the md material to a place where it has valuable meaning for stakeholders.

XUnit: Assert in action is not failing test

Provided that my step action is non-async Step is always succeeding, even when Assert located in it is triggered.

I believe it is not a bug in NScenario but somehow related to xUnit way to implement assertions.
(I tried to debug through implementation but I do not see anything wrong)

Here are more detailed steps to reproduce an issue.
Let's start from defining faulty action with Assert in it:

private Action _AssertAction = () =>
{
    Assert.True(false);
};

I am expecting step which is using such action to fail. Unfortunately, it is succeeding:

[Fact]
public async Task Assert_in_step_action_not_throwing_exception()
{
    var scenario = TestScenarioFactory.Default();
    await scenario.Step("I am assert which should fail", _AssertAction);
}

Again, it is not your fault but I would be curious to hear your feedback, maybe it is easy to fix
Full source code: https://github.com/Osypchuk/NScenario/blob/AssertBug/src/NScenario.XUnitDemo/UnitTest1.cs

Generate report for complex test structure

          HI Cezary,

I trust you are fine.
Imagine you have a set of tests structured in folder and subfolders, which could provide together with the test class names semantic meaning to the report.
What would be the way to proceed to incorporate these structural elements in the md report?
Thanks !
paul.

Originally posted by @paulvanbladel in #10 (comment)

Scenario name resets when using child functions

Readme is a bit obsolete - TestScenario do not exist anymore so maybe I am a bit off.

Provided I am building test scenario using TestScenarioFactory.Default() my expectation is that scenario definition is completed. Thus I am expecting the Name to be defined exactly at this moment.

Consider following example:

public class NScenarioDemo
    {
        [Fact]
        public async Task Main_Test_Function()
        {
            var scenario = TestScenarioFactory.Default();
            var response = await scenario.Step("First step", () => { 
                return new HttpResponseMessage(); });
         
            await HelperFunction(scenario, response);
            await scenario.Step("3rd step", () => { });
        }

        private async Task HelperFunction(ITestScenario scenario, HttpResponseMessage result)
        {
            await scenario.Step("Assert result code valid", () => { });
            await scenario.Step("Assert result content is valid", () => { });
        }
    }

My expected result would be something like:
SCENARIO Main_Test_function
STEP 1 First Step
STEP 2 Assert Result code valid
STEP 3 Assert result content is valid
STEP 4 3rd step

However, the actual result is
SCENARIO Main Test Function

STEP 1: First step
SCENARIO HelperFunction

STEP 1: Assert result code valid
STEP 2: Assert result content is valid
STEP 2: 3rd step

as you see:

  • new scenario added out of the blue
  • nesting is not happening.

xunit - issue with output

Hi, I checked you code samples, saw that you passed nothing different to your scenario when using xunit, but unfortunately I'm not being able to see the output shown in the readme.

I setup the nunit framework to test it and it worked fine.

Is there any other thing that is need to be passed to the TestScenarioFactory when using xunit?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.