Table of Contents

End to End Tests

Features

Defines the set of features of the application that need to be tested. These features can be entered upstream of development, in which case the test will be written after the development of the feature. A feature groups together a set of test scenarios. These scenarios are of the Web API or UI type.

Warning

Web API is under development and is not yet available.

Feature group

Features are grouped into feature groups to facilitate their organization.

Scenarios

The scenario is described by the formula Given-When-Then.
It's a template intended to guide the writing of tests :

  • Given : Describes the state of the application before you begin the behavior you're specifying in this scenario. You can think of it as the pre-conditions to the test.
  • When : Some action is carried out
  • Then : A particular set of observable consequences should be obtained.

A scenario can be active or inactive. For the unit test to be created and executed it must be active.

Example

  • [Feature group : Order]
    • [Feature : Order creation]
      • [Web API Scenario : The customer should have a positive balance]
        • [Given : I create a order on a customer with a balance of -100€]
        • [When : I post this order]
        • [Then : I received an error response : 'Customer balance must be positive]
      • [UI Scenario : The customer should have a positive balance]
        • [Given : I create an order]
        • [When : I select a customer with a balance of -100€]
        • [Then : The input validation shown the error 'Customer balance must be positive]
      • [UI Scenario : A confirm message should be shown before validation]
        • [Given : I create a valid order]
        • [When : I validate the order with the "Save" button]
        • [Then : A message box is shown with message 'Do you confirm the creation of a new order?']

Write and run automation test

The test code is written in C# in an external editor. To open the test, use the "Open Test" button. By default the xUnit test class is opened in Visual Studio. An empty test method is created, you can modify it.

Note

You can add additional methods in the class or add usings statements. When opening the test class with Neos Studio or when using the neos sync uitests command the declaration of the test class, the constructor of the test class, the attributes of the test methods , the declaration of the test methods are modified according to the information entered in the scenario of the feature.

Warning

Do not modify the attributes (do not use a Theory or InlineData attribute) and declaration of a test method, these modifications are lost when opening the test class with Neos Studio or when using the neos sync uitests command.

To run the automation test just run the test method:

  • Via Visual Studio in development
  • Via the dotnet test command
Warning

When running a test, the Neos cluster must be running.