How to run scenario tests in WSO2 API Manager?
Is my product pack working fine in a real scenario?

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.

Step 1 : Pick the branch of your choice from the above
Step 2 : Build the following modules of the repo without tests
- 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.

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!