How to run scenario tests in WSO2 API Manager?

Tharika Madurapperuma
3 min readJul 3, 2021

Is my product pack working fine in a real scenario?

Photo by Kevin Ku on Unsplash

Scenario tests are where we test an actual local deployment of the product. You can simply start a server in your local machine and run the scenario test cases from the repository and verify if a complete scenario or a use case works fine with that particular deployment.

Instead of writing a lot in this post, let me keep it short and simple. πŸ™‚

β†’ Repository containing scenario tests : product-apim

β†’ Branches containing scenario tests :

As in the following image, there is a scenario test branch for each product version starting from API Manager 3.0.0.

Branches containing scenario tests

Step 1 : Pick the branch of your choice from the above

Step 2 : Build the following modules of the repo without tests

  1. Move in to <product-apim>/modules/integration/tests-common module and build it using the following command, once without tests.

mvn clean install -Dmaven.test.skip=true

2. Now move into <product-apim>/product-scenarios/scenarios-common module and build it once without tests.

mvn clean install -Dmaven.test.skip=true

3. Then open the <product-apim>/product-scenarios/pom.xml file and comment out the scenarios-common module.

Comment out the scenarios-common module

4. Move into <product-apim>/product-scenarios module and build it without tests once.

mvn clean install -Dmaven.test.skip=true

Step 3 : Download, setup and start the product pack

Download the relevant product version. You can even use a WUM updated pack.

Now you can set up your pack with your preferred configurations, for example configure the pack with MySQL DB. Then start the server.

Step 4 : Run the tests

Go into product-scenarios module and run the following command

mvn clean install

This will run all the available scenario tests on your running deployment.

You can run a specific scenario test by going into the respective module and executing a mvn clean install. Use the relevant testng.xml file inside the folder, for example this, to manage the tests that are run.

Bonus Tip : πŸ˜‡

You can even debug the test cases by adding a debug configuration to your IDE. Use the normal process of debugging test cases. You can use the command below.

mvn clean install -Dmaven.surefire.debug

Thank you for reading the article!

If you find any outdated content or issues with this article, please feel free to create an issue at Developer Corner Git repository here. Let’s grow together and help others in their journey too!

If you like this article please give it a clap. πŸ™‚

Cheers!

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Tharika Madurapperuma
Tharika Madurapperuma

Responses (1)

Write a response