Discoverer - S41nz/TBTAF GitHub Wiki

TBTAF Discoverer

Overview

The Discoverer is the module in charge of parsing the TBTAF metadata embedded on source code (both test and production) and communicate the discovered data to the TBTAF Orchestrator.

API Specification

LoadTests

  • Inputs:

    1. String specifying the directory where the tests are contained or the complete filepath to a single test.
  • Outputs:

    • A collection of TBTestCase instances with their corresponding TBMetatadata instances of describing the metadata being discovered on the source code of each test within the provided location.
      • Any file which matches the following criteria will be ignored:
        • It contains no metadata or contains badly formed metadata.
        • It doesn't include a required field or the field is empty (i.e. <Tags></Tags> or <TestID></TestID>).
  • Exceptions:

    1. If the provided location is either null or inaccessible then a DataValue Exception will be thrown.

LoadCodeMetadata

  • Inputs:

    1. String specifying the directory where specific production source code files are contained or the complete filepath to a single file.
  • Outputs:

    • A collection of TBMetadata instances describing the metadata being discovered on the source code of each test within the provided locations.
      • Any file which matches the following criteria will be ignored:
        • It contains no metadata or contains badly formed metadata.
        • It doesn't include a required field or the field is empty (i.e. <Tags></Tags>).
  • Exceptions:

    1. If the provided locations are either null or non-existent then a DataValue Exception will be thrown.

TB Metadata Syntax

Test code

At the top of the file, within a mutli-line comment region, this must be inserted

<TBTAF>
<TestID>XXXX</TestID>
<Tags>Tag1,Tag2,etc</Tags>
<Priority>[1-5]</Priority> (Optional)
<Description>Description of my test</Description> (Optional)
</TBTAF>

Production code

At the top of the file, within a mutli-line comment region, this must be inserted

<TBTAF>
<Tags>Tag1,Tag2,etc</Tags>
</TBTAF>`
⚠️ **GitHub.com Fallback** ⚠️