Hello World Guide

Preparation

Make sure that etr is installed. If not please follow the IFW Installation instructions.

Creating the Test Module

To create integration tests the following structure should be used, where everything relevant for a test is contained in one root directory, referred to as the integration test module:

helloworld              # integration test module root
|-- etr.yaml            # main configuration file
`-- src                 # source directory for test files

At this point the etr.yaml needs to be created to be a valid module. As the filename hints at this is a normal YAML file with a specific schema. The following example shows an empty, but valid configuration file:

version: "1.0"

At this point it’s also possible to run etr:

helloworld$ etr
----------------------------------------------------------------------
----------------------------------------------------------------------
Ran 0 tests in 0.0s

OK

Since we have not actually written any tests not much is happening. So let’s create a test.

Writing A Test

Here we will use Robot Framework as an example since it is natively supported by an etr provided plugin. We start by creating a Robot Framework test suite file helloworld/src/tests.robot:

*** Test Cases ***

Hello World
   Log  Hello World

Now we have to update the etr.yaml configuration to enable support for Robot Framework and configure the plugin to run our new test file:

version: "1.0"

plugins:
    # Load the built-in plugin that enables support for Robot Framework
    - etr.plugins.robot

# Configure the robot plugin to run tests in src/tests.robot
# Note: The path is relative to this configuration file.
robot:
    tests:
        - "src/tests.robot"

The tests in src/tests.robot will now be executed with etr:

helloworld$ etr
----------------------------------------------------------------------
running test suite "src/tests.robot"
Tests.Hello World ... OK
----------------------------------------------------------------------
Ran 1 tests in 0.0s

OK

Now at this point etr does not bring any additional value. It’s when additional plugins are used where it starts to pay off. More details are covered in the other chapters of this manual.