WSO2 is now Choreo LabsLearn more

Trusted AI Governance
Build

Create agents and AI apps with the tools and languages your teams already use.

Connect

Link agents securely to your APIs, data, models and business systems.

Run

Deploy, observe and operate agents and AI apps reliably at any scale.

Govern

Control identity, access, cost and policy for every agent in production.

Agent Management

Developer Platform

  • API Management Cloud

    Design, secure and publish APIs with governance and analytics built in.

    Sign Up Now
  • Integration Cloud

    Connect apps, data and AI agents with low-code and pro-code integration.

    Sign Up Now
  • Identity & Access Management Cloud

    Secure sign-in and access for customers, partners, workforce and agents.

    Sign Up Now
  • Agent Management Cloud

    Build, run and govern AI agents with full visibility and control.

    Sign Up Now
  • Developer Platform Cloud

    Ship cloud-native apps faster on an internal developer platform.

    Sign Up Now

Self-Hosted

Full control over your stack. Deploy directly to your own servers, bare metal, cloud, or Kubernetes environment. Your data never leaves your perimeter.

Product Downloads
Choreo Labs
AI Governance
Platform
Solutions
Resources
Article

Introduction of component test automation framework

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.