Introduction of Component test automation framework

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Chamara Silva
  • 1 Nov, 2010

 

What is the Test Automation Framework?

          "A Test Automation Framework is a set of assumptions, concepts and tools that provide support for automated software testing"

 What is the requirement for a Carbon Test Automation framework?

The WSO2 carbon platform is a fully componentized SOA platform and it contain many Carbon components to provide amazing functionalities. As for the QA perspective, it's difficult to test all the functionalities manually and it take a huge amount of time to cover all the functionality tests. To overcome this issue and to reduce time on testing, the Carbon Test Automation Framework was implemented.

Applies to: 

Currently component test framework covers only WSO2 ESB  components and its functionalities, but in the future it will be available for all other Carbon products

How does the Test Framework work?

Most of the Carbon components have particular admin services to control their functionalities. For a example, when you are logging into the WSO2 ESB console, the ESB UI invokes "AuthenticationAdmin" admin service in ESB backend. Carbon test automation framework was implemented using the same pattern. Test framework structure is very similar to the WSO2 Carbon platform module structure. It was built using Apache Maven. Every test module has a junit source files and pom.xml. Junit source files are used to invoke the admin service. Each of the functionalities are tested by invoking admin service operation. Module pom.xml contain all dependency files to run test automation module and test resulting plug-ins. Every test automation module representing each of the Carbon components or functional group. As an example, 'proxy service test module' is using for 'ESB proxy service module' testing.

 

 

 Users can run the test automation framework in two different patterns. If you want to run all the test modules at once, you need to run parent pom by specifying a maven profile.

Eg: mvn clean install -Dproduct=esb

Or else you can run individual test modules by running each of the pom.xml

Eg:  Inside the module, use "mvn clean install" command.

 

 

The following sequence diagram describes how the Carbon Test Automation Framework is running.

 

 

 

 1. User executes parent pom or module pom.xml

 2. Pom.xml calls the Junit  test suite to execute test case classes

 3. In test case class follow test execution template. Every test scenario executed is based on the following three main test cases. 

  • Before login to the console (Non authenticated session)
  • After login to the server (With authenticated session)
  • After logout from the server (Without authenticated session)

   Based on the above pattern test template class has following template methods.

  • init() =  test initialization steps running here
  • runFailureCase() = running test scenario without login session
  • runSuccessCase() = running test scenario with login session
  • cleanup() = resetting server to the default mode 

   4. The test report will be created after running test scenario. 

For more information download test framework source from here.

Author : Chamara Silva, Senior Software Engineer, Quality Assurence, WSO2 Inc.