Mobile Development 13 min read

Flybirds: An Open‑Source BDD UI Automation Framework for Mobile Testing

Flybirds is a BDD‑based, open‑source UI automation framework for mobile apps that provides a plug‑in architecture, CLI scaffolding, multilingual support, rich reporting, and seamless integration with CI pipelines, enabling developers to write natural‑language feature files and run them on Android and iOS devices.

Ctrip Technology
Ctrip Technology
Ctrip Technology
Flybirds: An Open‑Source BDD UI Automation Framework for Mobile Testing

Background : Since mid‑2018 Ctrip has adopted Behavior‑Driven Development (BDD) for its ticketing system, and Flybirds has become the internal default BDD‑UI testing framework for mobile apps.

Why open source : To share the BDD solution with the community and encourage deeper collaboration with peers using BDD.

Core components : Flybirds combines Behave for natural‑language test case mapping, Airtest for UI automation on Android/iOS, and Multiple‑cucumber‑html‑reporter for visual test reports.

Key features : BDD‑style syntax, support for automated app actions, form submission, UI element verification, keyboard input, Deeplink navigation, bilingual (English/Chinese) language support, plug‑in design for custom extensions, CLI scaffolding, and HTML reporting.

Environment setup :

Install the framework: pip3 install flybirds

Grant adb execution permission on macOS/Linux: cd {your_python_path}/site-packages/airtest/core/android/static/adb/mac && chmod +x adb cd {your_python_path}/site-packages/airtest/core/android/static/adb/linux && chmod +x adb

Create a project with the CLI: flybirds create

Quick start :

Run the demo feature set (Android/iOS) generated by the scaffolding.

Check device connection with adb devices (Android) or tidevice list (iOS).

Execute tests: flybirds run -P features/test/android

Project structure :

features/
  test/
    everything.feature
  steps/
    steps.py

Feature files are written in Gherkin language and serve both documentation and automation purposes.

Step templates and hooks : Common step templates are provided; users can add custom steps in pscript/dsl/steps . Hook functions such as before_step , after_scenario , before_all , etc., can be defined in pscript/dsl/step/hook.py to run code before/after steps, scenarios, features, or the entire test run.

Tags : Scenarios can be filtered by tags using flybirds run -T tag1,tag2 or excluded with a leading dash.

Pre‑run checks : Ensure devices are connected and USB debugging is enabled; install necessary drivers and, for iOS, set up WebDriverAgent.

Run parameters :

flybirds run -P ./features/test/demo.feature – specify path.

flybirds run -T tag1,tag2,-tag3 – filter by tags.

flybirds run --format=json – output format (default JSON).

Configuration : Mandatory fields are deviceId and packageName ; iOS also requires webDriverAgent and platform . Detailed config docs are linked in the source.

Reporting : The generated HTML report includes summary, feature and scenario results, and for failed scenarios, screenshots and videos.

Custom extensions : The plug‑in architecture allows adding web or additional app extensions by placing packages under plugins.default and updating plugin_info.json . Custom step files can be imported in features/steps/steps.py .

Continuous Integration : Flybirds can be invoked from CI tools such as Jenkins: # Inside the jenkins shell command cd {PATH_TO_PROJECT_FOLDER} flybirds run -P ./features/test/everything.feature cp -R reports $WORKSPACE

Release plan : The project follows SemVer, with weekly minor releases and an open contribution process on GitHub.

Recruitment notice : The article concludes with a brief invitation to join Ctrip’s ticketing R&D team, listing contact email and application instructions.

PythonCI/CDUI automationmobile testingBDDFlybirds
Ctrip Technology
Written by

Ctrip Technology

Official Ctrip Technology account, sharing and discussing growth.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.