Automated Testing of Algorithm Interfaces Using TestNG, Maven, Allure, Excel, and Jenkins
This article details how to build an automated testing framework for algorithm interfaces with TestNG, Maven, Allure Report, Excel data-driven inputs, and Jenkins integration, covering project setup, plugin configuration, test execution, and report generation to streamline repetitive testing tasks.
Recently the author developed a tool for automated testing of algorithm interfaces, leveraging TestNG, Maven, Allure Report, Excel, and Jenkins to eliminate repetitive testing after logic changes and to generate attractive HTML test reports.
1. Project and Plugin Configuration
Create a Maven test project ensuring that the main and test directories correspond; place TestNG dependencies in the pom.xml and keep the testng.xml file alongside the pom. Add the Allure TestNG plugin to the pom as well.
2. TestNG + Excel for Batch Interface Testing
Configure the project to read Excel files and a config.properties file. Use a DataProvider to convert Excel data into a two‑dimensional array (XSSF is used for reading). TestNG then runs tests based on this data, performing assertions and recording results back into the Excel sheet if needed.
Multiple server hosts can also be specified in the Excel file, allowing flexible request routing.
3. Jenkins Integration
Set up Maven and Allure (and Git if required) in Jenkins, add the project's pom.xml, and ensure the Jenkins job name matches the Java project name. Configure the Allure report output directory; after each build Jenkins will produce an Allure HTML report displaying test results.
Finally, the author notes that the entire workflow—project setup, data‑driven testing, and CI reporting—significantly improves testing efficiency and encourages further learning.
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.