Skip to content

Test Harness & Suites

Test Harness XML

The Test Harness is the top-level container. Every app must have at least one harness file.

xml

<TestHarness>
    <Name>Main Application Test Harness</Name>
    <TestSuiteFiles>
        <TestSuiteFile path="path/to/ui_tests.suite" />
        <TestSuiteFile path="path/to/api_tests.suite" />
    </TestSuiteFiles>
    <TestHarnessFiles>
        <TestHarnessFile path="path/to/another_harness.harness" />
    </TestHarnessFiles>
</TestHarness>
ElementDescription
&lt;Name&gt;Identifies the test harness
&lt;TestSuiteFiles&gt;List of suite files to execute
&lt;TestHarnessFiles&gt;Optional nested harnesses

Test Suite XML

Each suite groups test scripts for a specific app:

xml

<TestSuite>
    <Name>UI Test Suite</Name>
    <AppName>com.example.myapp</AppName>
    <Description>User Interface tests</Description>
    <TestScripts>
        <TestScript prefix="LP">
            <Path>tests/ui/login_page_tests.py</Path>
        </TestScript>
        <TestScript prefix="SM">
            <Path>tests/ui/message_sending_tests.py</Path>
        </TestScript>
    </TestScripts>
</TestSuite>
ElementDescription
&lt;Name&gt;Suite identifier
&lt;AppName&gt;Target application package name
&lt;Description&gt;Suite purpose
&lt;TestScript prefix&gt;Unique prefix for test case IDs
&lt;Path&gt;Path to test script file

Test cases are identified as &lt;Prefix&gt;:&lt;ID&gt; (e.g., LP:1, SM:10).

Test Execution Configuration (TEC)

xml

<TestExecutionConfiguration>
    <Target>
        <Type>Harness</Type>
        <FilePath>path/to/mainHarness.harness</FilePath>
    </Target>
    <LogConfiguration>
        <ReportLogPath>report.log</ReportLogPath>
        <ExecutionLogPath>test.log</ExecutionLogPath>
    </LogConfiguration>
    <StartTime>2024-04-10T08:00:00</StartTime>
    <Devices>
        <Device name="Pixel 4"/>
        <Device androidVersion="10" count="10"/>
        <Device groupName="group1"/>
    </Devices>
    <Iterations>5</Iterations>
    <TestRun>
        <Include>LP:1</Include>
        <Include>LP:2-4</Include>
        <Include>SM:10</Include>
    </TestRun>
</TestExecutionConfiguration>

TEC Elements

ElementDescription
&lt;Target&gt;Harness or Suite to execute
&lt;LogConfiguration&gt;Report and execution log paths
&lt;StartTime&gt;Scheduled execution time
&lt;Devices&gt;Target devices (by name, version, group, count)
&lt;Iterations&gt;Number of repetitions (default: 1)
&lt;TestRun&gt;Selective test execution filter

Device Selection Rules

SpecificationBehavior
name="Pixel 4"First device matching name
androidVersion="10"Match by Android version
count="10"Number of devices needed
groupName="group1"All devices in group
Empty &lt;Device/&gt;Any available device

Constraint

groupName and count cannot coexist on the same &lt;Device&gt; element.

TestRun Filtering

PatternRuns
&lt;Include&gt;LP&lt;/Include&gt;All tests with LP prefix
&lt;Include&gt;LP:1&lt;/Include&gt;Only LP test case 1
&lt;Include&gt;LP:2-4&lt;/Include&gt;LP cases 2, 3, and 4
No &lt;TestRun&gt; definedEntire harness runs

Output

When a TEC run completes, two files are created:

  1. Result file (JSON) — test outcomes
  2. Log file — execution details

The framework includes a primitive report generator. Custom report generators can be used to process the JSON results.

Sigma RT Total Control Documentation