NUnit.ManualTest


NUnit integrated manual testing

NUnit.ManualTest is designed to include manual tests in the NUnit Framework infrastructure. The developer simply can add manual test scenarios to an NUnit test that guides a manual tester step-by-step through the testing scenario. The benefit is a NUnit compliant report. Furthermore it offers the possibility that non-programmers e.g. product owners, product managers or marketing can define manual test cases through YAML files.

1: 
//let source = YamlTestBuilder.BuildFrom("demo.yaml")

Installation

Install with nuget

1: 
nuget install NUnit.ManualTest

Examples

Generating tests from YAML files

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
[TestFixture]
public class SomeWorkflowSpec : ManualTestBase
{
  public static IEnumerable Source()
  {
    return YamlTestBuilder.BuildFrom("demo.yaml");
  }

  [Test, TestCaseSource("Source")]
  public void SomeScenario(TestScenario scenario)
  {
    RunScenario(scenario);
  }
}

Choosing the presentation type

For each test fixture:

1: 
2: 
3: 
4: 
[TestFixture, UserPresenter(typeof(ConsoleUserPresenter))]
public class SomeSpec : ManualTestBase
{
}

Assembly-wide setup:

1: 
[assembly: UserPresenter(typeof(ConsoleUserPresenter))]

The default presenter is the console presenter.

Specifying presentation type

There are three types defined the tester is guided through the different test steps (preparation, execution and validation).

  1. SingleStep: Each preparation, execution and verification step must be committed by the tester. This could be useful whenever single steps of complex testing scenarios might fail and should be reported in test report.
  2. Grouped: Each group (preparation, execution and verification) must be committed by the tester.
  3. Once: (default) The complete testing scenario is presented to the user and must be committed only once.

The presentation type can be specified:

  1. in YAML file: using the type attribute inside the scenario.
1: 
2: 
3: 
4: 
- scenario:
    name: When pressing 'print' button should open print dialog with pre-selected current page.
    description: printing single page.
    type: SingleStep
  1. globally for whole test fixture: passing to the type to base ctor.
1: 
2: 
3: 
4: 
5: 
6: 
public class SomeSpec : ManualTestBase
{
  public SomeSpec() : base(PresentationType.Grouped)
  {
  }
}
  1. in coded tests: by setting up the test builder.
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
public void When_doing_something_should_result_in_something()
{
  Test()
    .Prepare("Prepare something")
    .Do("Execute something")
    .Verify("Verify somthing happened")
    .AsGroupedUserInteraction()
    .Go();
}

This overrules the 'higher-level' setups.

Fork me on GitHub