Interpreter - S41nz/TBTAF GitHub Wiki
TBTAF Interpreter
Overview
Parse and translate the TBTAF scripts into actual commands to either enable a TBTAF service, execute a set or single test or make a query about existing test content or test execution job.
API Specification
ParseScript
This method receives the path to a given TBTAFScript that requires to be parsed in order to be translated into direct TBTAF API commands from the TBTAF Orchestrator.
- Inputs:
- String containing the path to a given TBTAF script.
- Outputs:
- Result Object indicating the results of the parsing process, either reporting success, warnings and/or errors which if found, also include their corresponding locations within the script content.
- Exceptions:
- If null or invalid locations are provided then throw an Invalid Argument Exception.
SetOrchestratorReference
This method will be required in order to set the reference of the Orchestrator to a given Interpreter instance. This will be required in order to have the API at hand which the real commands translated from the script will be based on.
- Inputs:
- Reference to an instance of the TBTAF Orchestrator.
- Outputs: None
- Exceptions:
- If null reference is provided then throw an Invalid Argument Exception.
Script syntax example
myTestBed = create test_bed(Collection of URLs to the execution nodes)
myTestSuite = create test_suite(Location of test cases[,Collection of tags to test])
create_new_project( myTestSuite, myTestBed, "Hello World Project")
publish test_plan(Reference to the test suite object[,Location of the test plan])
myResult = execute (Reference to the created Test Suite,Reference to the created Test Bed)
publish test_results(Reference to the test result object[,Location of the test report])
//This is a comment line
get tests("Hello World Project", [ "Tag1", "Tag2"])
get tags("Hello World Project")