CTrip Flight App Frontend CI/CD and UI Automation Practices
This article details how CTrip's flight app transitioned to React Native and adopted BDD-driven CI/CD, introducing parallel linting, unit testing, automated publishing, a mock data platform, distributed UI automation, and multi‑process frameworks to achieve 95% test coverage, minute‑level execution times, and significantly reduced release costs.
CTrip's flight app migrated its entire front‑end from a native stack to React Native and introduced a BDD‑based agile development model, prompting the need for a robust CI/CD pipeline that could sustain rapid iteration while guaranteeing quality.
The original CI/CD workflow involved manual publishing, lengthy regression cycles, and limited UI automation, leading to excessive human intervention, high regression costs, and insufficient test coverage.
Improvements included adding ESLint and enhanced unit‑test checks, automating releases, and integrating early UI automation; CI stages such as TypeScript compilation, unit tests, and linting were run in parallel, cutting build time from 5 min 48 s to 1 min 59 s and halving overall pipeline duration from 8 min to 4 min.
A custom Mock platform was built to provide stable, server‑independent data for UI tests, and a distributed UI automation platform reduced execution time from roughly 4 hours to about 20 minutes while offering task, device, and project management with detailed reports.
The team also created the MEC framework (Macaca Eating Cucumber) based on Cucumber and Macaca, enabling QA engineers to write test scripts in natural language; an example script is shown below:
@p1
场景大纲:筛选航空公司
假如 启用MockCase[<caseID>]
当 跳转页面到[<列表页>]
并且 筛选[航空公司]为[选择条件东方航空]
那么 列表页航班按航空公司[东航]筛选
并且 移除MockCase
例子:
| caseID | 列表页 |
| 17470891 | 单程列表页上海-北京 |Comparative tests showed that the Airtest tool outperformed the Macaca tool, offering up to 75% faster execution and image‑comparison capabilities.
A multi‑process PAC framework (Puppeteer And Cucumber) was later introduced, allowing UI tests to run headlessly across iOS, Android, and H5 via the internal CRN‑WEB framework, cutting total runtime to minutes, eliminating device dependence, and preserving existing Cucumber scenarios without conversion.
Automatic packaging and UI testing were integrated into the CI pipeline as separate jobs; any commit triggers the pipeline, which now completes in roughly 7 minutes, ensuring code quality before merge.
As a result, UI test coverage reached 95%, execution time dropped from hours to minutes, and release costs fell dramatically, with manual regression eliminated and preparation time reduced to about two hours.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
