AirtestProject / Airtest

UI Automation Framework for Games and Apps
http://airtest.netease.com/
Apache License 2.0
8.1k stars 1.28k forks source link

Is Airtest supporting this technology? (HTML and Cordova) #179

Open Srilekhak opened 5 years ago

Srilekhak commented 5 years ago

Hi Team,

I am working on a game testing which is developed using HTML5 and Cordova. Backend is Mysql.

Is Airtest supporting this technology.

Summary The game is developed by using the below technology: Registration : Android. Games : HTML5 and Cordova Backend: mysql.

rockywhisper commented 5 years ago

@Srilekhak Hi, if you look at the airtest homepage, you can find that we can use two kinds of script code. One is script lines with images in it (Airtest scripts), and another one is UI-script (Poco scripts). The total idea: find the UI position and then operate your device. Airtest and Poco are just 2 different ways to do this, but you can use them in one testing script.

If you want to use Airtest scripts which is based on image recognition, just download the IDE and use it. Because Airtest need no SDK plugin in your game,

If you want to use the Poco scripts which can get all the UI info from your game through an SDK-plugin. you need to implement an SDK following our data format and plugin it into your game. Here is the PocoSDK Integration Guide

Tell us at anytime if you need more help ;-)

Srilekhak commented 5 years ago

Thank you so much for this information. It helped me a lot.

I have few more questions:

  1. The SDK integration should be done from the Developers side or the Testers side?
  2. I tried with the UI elements, all the elements are not inspectable only a part of the UI we can inspect. Can you tell me how to work around this error?

-- Thanks, Srilekha K. ThoughtFrameworks Inc Mobile : +91 9880267189 Skype : srilekhak On 10/12/2018 1:21 PM, 王建军 wrote:

@Srilekhak https://github.com/Srilekhak Hi, if you look at the airtest homepage http://airtest.netease.com/, you can find that we can use two kinds of script code. One is script lines with images in it (Airtest scripts), and another one is UI-script (Poco scripts). The total idea: find the UI position and then operate your device. And |Airtest| and |Poco| are just 2 different ways to do this, but you can use them in one testing script.

If you want to use |Airtest scripts| which is based on image recognition, just download the IDE http://airtest.netease.com/changelog.html and use it. Because |Airtest| need no SDK plugin in your game,

If you want the |Poco scripts| which can get all the UI info from your game through an SDK-plugin. you need to implement an SDK following our data format and plugin it into your game. Here is the PocoSDK Integration Guide https://poco.readthedocs.io/en/latest/source/doc/integration.html

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AirtestProject/Airtest/issues/179#issuecomment-429237485, or mute the thread https://github.com/notifications/unsubscribe-auth/AWOrOnQxleW3sRcMLxC3r8zEgo7J5p-5ks5ukEnngaJpZM4XY7SV.

rockywhisper commented 5 years ago

@Srilekhak

  1. I think the developers would be more familiar with what should be done to implement the SDK.

  2. Actually, if you use an android native app, you may find AirtestIDE can get native UI info from it. It's based on Uiautomation thing. image So if you use an Android device and there're some android native UI elements in your app, you can actually get the native UI info. But the UI in your game (Assuming there's an area that shows your game.) cannot be accessed by the android Uiautomation, so there's no info about these UIs.

As for what you can do about this problem, I think @adolli can offer some help on it. :-)

adolli commented 5 years ago

hi @Srilekhak, I understand your scenario. As js in html5 cannot set up a server, you have to use a broker. The following diagram shows the connection relationship.

-----------            ----------             -------------------
|  html5  |    ---->  |  broker  |   < ----   |  poco (python)  |  
-----------            ----------             -------------------

broker is a server listens on 2 endpoints. If you are not going to use native js in html5, you can set up a server in java(Android native environment) and invoke it in js via Cordova bindings.

Secondly, you have to implement the poco-sdk in for your game by yourself. Because we do not know any of your games. This is a rough guide about implementation. You can also take a look at other poco-sdk implementation in github repo as a reference.

Summary

  1. Implement the poco-sdk for your game.
  2. Start a broker on your PC with the command. python -m poco.utils.net.stdbroker ws://*:5003 tcp://*:15004
  3. Run poco test. (following is a snippet to test the connectivity)
    
    from poco.drivers.std import StdPoco
    from poco.utils.device import VirtualDevice

dev = VirtualDevice('localhost') poco = StdPoco(15004, dev) for n in poco(): print(n.get_name())