This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Architecture
TAF's main test engine is TestNG. TAF heavily uses the listener based test execution of the TestNG. The diagram below demonstrates the architectural overview of TAF.
Test Automation framework consists of the following modules:
Â
Automation Framework Engine
The core module of the Test Automation Framework. It uses TestNG test listeners to perform the tasks in the test execution flow. Test listener manager classes use the TestNG test listener interfaces to perform tasks in the test execution flow. All the configurations are categorized and stored in XML format in the automation.xml file.
Configuration Storage
Test Automation Framework provides a single location (automation.xml file) to store all configuration details related to the tests. Users can change the configuration related to the test in this file, and store this file under the resources of the tests. TAF looks for this configuration storage file at the beginning of the test execution and builds it using the native xpath based xml parsing implementation. It also provides an API to retrieve configurations from the automation.xml file. The automation.xml file consists of the categorized configuration context relevant to the test execution. This file is stored in the resources directory of the test end. It consists of the following elements:
- Configuration context
- User context
- Â Database context
- Platform context
- Tool context
- Feature management context
- Security context
- Environment context
- Extensions context
The automation configuration documentation  contains detailed explanation about each context element of the configuration file.
Configuration file validation
The automation.xml configuration file is validated with an embedded XSD file named automationSchema.xsd. The rules to be followed for the configuration context elements are defined in that XSD file. Users can add/edit the XSD file with the appropriate changes to the automation.xml file.
Pluggable utilities to the test execution (TestNG extensibility feature)
Test Automation Framework supports the execution of internal/external utility classes in various states of the TestNG listeners. Users can define the class paths in the automation.xml file under the desired TestNG listener states. For example: Class list stored under ExtensionContext -> TestExecutionListener - > onExecutionStart elements will be executed at the beginning of the test execution start. Automation Framework uses Java reflection to execute classes. Users are expected to use the interface provided by the framework to develop external utility classes to be executed in the test. There are 5 interfaces provided by TAF for different TestNG listeners. Those interfaces have specific methods defined explicitly to be inline with the corresponding TestNG listeners. The interfaces are:
Â
- ExecutionListenerExtension
ReportListenerExtension
SuiteListenerExtension
TestListenerExtension
TransformListenerExtension
Â
Automation Framework Extensions
This module consists of a set of default pluggable modules common to the platform. These pluggable modules can be executed in the test execution registering those in the test configuration file (automation.xml). TAF provides common modules such as the user management module (for user population/deletion operations), the server management module (for server startup, shutdown operations) etc. in extensions. Users can also add any platform wide common modules in to the Automation Framework Extensions. Test specific pluggable modules should be kept in the test side and those modules can also be used for the tests by registering it in the test configuration file.
Â
Â
Automation Framework API
Provides a test-friendly, unified approach for verification and assertion of each service. It includes the following functionality:
Â
Provides test-friendly wrapping of the back-end service stubs
Provides test-friendly functions for verification and assertion of functions
Updates with the relevant release version
Encapsulates the complexity of changing all available tests in case of a stub change
Maintains page object classes for Selenium automation
Â
Automation Framework Utils
Utility components that provide frequently used functionality, such as sending SOAP and REST requests to a known endpoint or monitoring a port to determine whether it's available. You can add the Utils module to your test case to get the functionality you need. Some sample utilities would be:
Â
Axis2 client
Wire message monitor
Custom server startup scenarios (Axis2, Tomcat, ActiveMQ)
Concurrency test scenarios