This article is a 12/20 article of Sumzap Advent Calendar 2019 # 1.
https://airtest.netease.com/ Cross platform UI automation IDE developed and published by NetEase. Here, we will call it a general term for IDEs and projects for automatic testing of mobile applications that use image recognition. By using this, you can create test code without knowing the code on the project directly. You can mass-produce the test as if it were an E2E test, or as an aging test, repeat the same actions endlessly. It is also suitable for such work.
https://github.com/AirtestProject/Poco Among the automated tests like Airtest, this library focuses on Unity's GUI. By incorporating Poco into your Unity project, you will be able to reference the UITree.
https://github.com/AirtestProject/Airtest/tree/master/airtest/core/android You can see the structure mainly by reading the source code group here.
We send minicaps on Android, receive images from minicaps, and send tap data. https://github.com/openstf/minicap https://openstf.io/ By the way, minicap is one of the projects published by CyberAgent, and it takes and sends high-speed screen captures in the Android device.
libimobiledevice(https://github.com/libimobiledevice) You can get images with this tool. This is a tool that is also used in Flutter's iOS build. Furthermore, tap information etc. goes through XcTest.
https://airtest.netease.com/docs/en/1_quick_start/3_get_started_with_iOS_test.html
For that purpose, we have prepared a test project. No, it's quite a skill. But with this method, you can control the terminal from the home screen, so it's quite a good E2E test.
https://github.com/AirtestProject/Poco-SDK/tree/master/Unity3D Install this and delete the unused GUI directory.
And if you attach a manager like this.
var pocoGameObject = new GameObject();
pocoGameObject.name = "Poco";
pocoGameObject.gameObject.AddComponent<PocoManager>();
Depending on the environment, the following APIs can help you with Android. The usage in UnitTest will support the implementation. https://github.com/AirtestProject/Airtest/blob/master/airtest/core/android/recorder.py
The operation tends to be particularly heavy on screens where the amount of GameObject is large and the parameters of location information change frequently (for example, displaying a character in Live2D). Consider using freeze. https://poco.readthedocs.io/en/latest/source/doc/poco-example/optimize_speed_by_freezing_UI.html
When freeze is used, the location of the UI at the moment when freeze () is used is retained, so communication with the application side does not occur. You can send input at high speed. However, if the location of the UI changes (scrolling or moving UI), it is necessary to consider the timing and location of freeze ().
self.freeze = self.poco.freeze()
#The button UI usually doesn't "move" so get it from freeze
#However, please note that it is not possible to judge "whether or not" on the screen.
self.attack_button = self.freeze("attack_button")
#Simply specify the number of terminals.
_serial = "Android:///hogehoge"
dev = connect_device(self._serial)
poco = UnityPoco(port, device=dev)
It can be used by QA who do not have programming knowledge. We have created a mechanism to describe the order of actions in CSV etc.
For example, change the battle to a specific rule. Check the parameters after using a specific technique. Etc. are as follows. The rest is the stage of mass-producing such CSV and automating the checks that QA used to do manually.
tag,param,param2
The end of the war,,ID
Rule change,,Four limits&Healing disturbance&Solo rendition&Angry hair revenge&Strategic Kojin&Shugo Hayashi&Heavenly power&Mysterious versatility
War begins,,IDvsID
Game transition,hoge,Transition from game start to battle start
Cheering,Unlucky return,1
Spreadsheet input,A2,none
Status change,,ID&0
Status change,,ID&20
Cheering,Unlucky return,1
Spreadsheet input,B2,none
That's why I sent you an introduction to Airtest and Poco. Depending on the idea, in combination with machine learning, you do not have to specify the buttons in detail Debugging proceeds. I think I can do anything, I would like to work on it. I hope you can exchange various information.
Tomorrow is an article by @mikami_akihisa.
Recommended Posts