Author: Liang, senior development expert at Ctrip, author of open source projects, focusing on DevOps, automation frameworks, tool platforms, etc. 1. BackgroundMulti-terminal R&D is an unavoidable topic for front-end development in today's era. In order to solve these problems, many development solutions have been launched in the industry, but there are not many solutions for cross-terminal UI automation testing. Flybirds has been open source for more than three months since the beginning of 2022. Through communication and feedback from active users in the community, it has launched the v0.2 version of the cross-terminal and cross-framework testing solution. A set of scripts can run on multiple terminals, and the plug-in architecture design also makes it convenient for community developers to freely join in the expansion and grow together. 2. New features in v0.2
3. What kind of multi-terminal testing solution do we need?In recent years, many new development frameworks have appeared every once in a while, which have brought better development experience and performance, but also created many challenges for automated testing. What kind of multi-terminal testing solution do we really need? From Flybirds' perspective, we hope that multi-terminal testing will not become an obstacle in the R&D process, especially when the multi-terminal ecosystem as a whole is thriving, the automated testing solution should grow together with the development solution. Whether it is the Web, React Native, or Native side, the ideal solution should be multi-end adaptation, retain good extensions, take into account more frameworks, and be jointly built by the community to promote the prosperity of the overall ecology. Therefore, Flybirds provides the community with a cross-end and cross-framework testing solution. 4. Plug-in architectureThe plug-in architecture helps us separate the capabilities of each end. The plug-in provides the components, APIs, and configurations required for runtime, and Flybirds injects them into the corresponding life cycle respectively. 4.1 File Structure├─ cli scaffolding 4.2 DSL step listOf course, in this architecture, each end is slightly different, mainly due to the platform differences of each end. The following is a list of DSL steps supported by each end. Most steps can be applied to multiple ends. 5. Multi-terminal application examples5.1 Test CasesFunction : Passenger module 5.2 Page Object ManagementPage object management in multi-terminal projects is unified through json files. There are usually two situations: 1) When the two ends are the same, refer to the following configuration // Element positioning configuration ele_locator.json 2) Different terminals can be distinguished by Android, iOS, and web // scheme configuration schema_url.json 6. Data-driven parameterizationIn actual projects, most automated tests are based on data-driven parameterization, so they also need to be used in conjunction with "scenario outline + examples". Here we modify the above example: Function : Passenger module 7. Multi-browser concurrencyRelying on PlayWright's cross-browser capabilities, Flybirds supports all modern rendering engines, including Chromium, WebKit and Firefox. Flybirds supports multi-browser concurrent mode, which makes browser compatibility testing convenient and efficient. 7.1 Configuration Parameters// browserType: configure browser kernel 7.2 Executing commands#You can specify the browser kernel through parameters 8. Pre-operation inspectionNext, before starting to run, please check the running environment 8.1 Android, iOS1) Make sure the configured test device can be connected normally
2) Download and install the test package Android: The framework will automatically download and install the test package through the packagePath configured in config (make sure that the phone has turned on "Allow installation from unknown sources"). You can also download and install it manually. iOS:
8.2 WebBefore executing the Web project, check whether the browser environment has been installed #View supported browsers IX. OperationYou can easily switch execution environments, filter cases, and control the number of concurrent operations through the cli. Some common commands are listed below. #View the operations supported when running the project 10. ConfigurationThe following are the configuration items required before each end runs
11. Custom Framework ExtensionFlybirds' plug-in design mode retains good expansion, and we will open more in the future. 11.1 Modifying ExtensionsIf you want to modify the current extension in your project, you can replace the (app, device, element, app, step, screen, screen_record) below plugin with your local files and make corresponding configuration in "plugin_info.json". For example, if you want to modify the screen.py file in the web:
"screen" : { {local_path} is the local path, "ns" is the package name, pay attention to the uniqueness of the package name (the above package names are just examples and are not mandatory) 12. Internal Enhancement PackageFor custom functions commonly used within the team, you can consider creating an extend package. Flybirds supports dynamic loading, and the package name contains "-flybirds-plugin". Ctrip Air Ticket has internally connected various DevOps tools in the enhancement package, which can be used after installation. 13. Continuous IntegrationThe command line execution mode provided by cli makes it very convenient to add various continuous integration tools. Take Jenkins as an example: # Inside the jenkins shell command 14. Release PlanWe will release according to the SemVer version control specification. We will gradually add new features and optimize the code. You are very welcome to join our co-construction plan and put forward your valuable suggestions on GitHub, as well as any problems you encounter during use. We will also iterate a small version every week. You can also give us spiritual support here by clicking a Star. |
<<: Apple officially announced: iOS 16 has these powerful new features
>>: Apple iOS 15.5 is officially released. Learn what’s new in this article
[[142542]] If we want to explore the meaning of J...
Produced by | 51CTO Technology Stack (WeChat ID: ...
Li Miao: Introduction to Physics Resources in The...
Report highlights Facebook videos have the highes...
Yesterday, two red hot spots appeared: the spread...
Here, we have collected common SEO problems and c...
This is an era of the Internet, and even more so ...
Products are the bond that maintains the relation...
What exactly is user operation ? What abilities a...
Just like the main hard disk of new PCs has been ...
If you are working on new media in an APP, then c...
There are many debates online about "raising...
In the past half month, the rankings of many APP ...
Course Catalog ├──AECC2019 Software | └──After Ef...
Videos of African children holding up signs and R...