Ctrip's Platform-Based API Automated Testing Solution
The article presents Ctrip's platform-driven API automated testing solution, detailing the challenges of traditional script-based testing, the proposed lightweight online test authoring and execution system, its key implementation features, technical architecture using Vue, Java, and MongoDB, and the resulting efficiency gains for development teams.
Author Introduction: Tony, senior test development manager at Ctrip, is responsible for automated testing frameworks and platform tools.
Introduction: Traditional interface automated testing relies on code projects, third‑party frameworks, and external schedulers like Jenkins, leading to cumbersome test case data management, high technical barriers, and maintenance difficulties.
The existing approach also creates redundant code, complex dependencies with other systems, and is unsuitable for teams transitioning from manual to automated testing.
Solution: Platformize automated testing to provide a lightweight, easy‑to‑use online authoring and execution system, addressing configuration complexity and improving accessibility.
Key Implementation Points:
Move API automated testing to a platform for convenient test case management, execution, and reporting.
Simplify test case configuration with online script authoring.
Support message‑based validation points, reducing or eliminating custom scripts.
Directly associate automated cases with Mock cases to enhance stability.
Provide AB experiment, QConfig, and Redis data configurations.
Enable database queries and operations for dependent service validation.
Integrate continuous integration, pipeline, and code coverage statistics.
Offer test design management with mind‑map import/export and data linkage.
Support various execution strategies, including performance testing.
Provide intuitive statistical reports and extensible external APIs.
Technical Implementation: Frontend built with Vue, backend with Java, data stored in MongoDB, and integration with Mom, Paas, QConfig, Redis, CI, Mock, PTest, etc. Test scripts are written in JavaScript calling Java‑implemented backend methods.
Execution is handled by a distributed Java service; scripts are interpreted, eliminating compilation and third‑party scheduler dependencies.
The platform integrates with Mock, QConfig, Redis to provide data shielding, enhancing test stability, and connects with CI/Paas for automatic deployment and test execution triggered by merge requests, leveraging GitLab pipelines for quality checks.
Additional integrations with performance testing and project management tools expose APIs for broader reuse of test data.
Ease of Use: The platform emphasizes simplicity, offering a clear workflow: Test Design → Test Case Configuration → Test Suite Creation → Project Configuration → Execution & Reporting.
Key steps include optional test design (mind‑map), test case creation with service request and validation configuration, suite assembly, project setup with execution plans, and final execution with reporting and retry capabilities.
Conclusion: Platformizing API automated testing significantly improves convenience, reduces manual effort, shortens test case authoring time by over 60%, accelerates report generation to seconds/minutes, and cuts project execution time by more than 90%.
上线时间
应用
服务
用例
项目
执行次数
9个月
239
798
4195
241
33962
The platform also lowers technical requirements for testers, enabling rapid adoption and higher test coverage across development cycles.
Ctrip Technology
Official Ctrip Technology account, sharing and discussing growth.
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.