AirtestProject / AirtestIDE

223 stars 38 forks source link

did AirTest support IOS simulator? #454

Open peileenf opened 5 years ago

peileenf commented 5 years ago

Remove any following parts if does not have details about

Describe the bug the air test case is failed when the device is IOS simulator

Screenshots A screenshot is strongly recommended. Please include both AirtestIDE window and the black console window.

To Reproduce Steps to reproduce the behaviour:

  1. start the IOS simulator
  2. run the test.py
  3. Pop errors: File "/usr/local/lib/python3.7/site-packages/poco/proxy.py", line 872, in _do_query self._nodes = self.poco.agent.hierarchy.select(self.query, multiple) File "/usr/local/lib/python3.7/site-packages/poco/freezeui/hierarchy.py", line 90, in select return self.selector.select(query, multiple) File "/usr/local/lib/python3.7/site-packages/poco/sdk/Selector.py", line 78, in select return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True) File "/usr/local/lib/python3.7/site-packages/poco/sdk/Selector.py", line 71, in getRoot return self.dumper.getRoot() File "/usr/local/lib/python3.7/site-packages/poco/freezeui/hierarchy.py", line 35, in getRoot root = Node(self.dumpHierarchy()) File "/usr/local/lib/python3.7/site-packages/poco/utils/simplerpc/utils.py", line 12, in new_func cb = func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/poco/drivers/std/dumper.py", line 13, in dumpHierarchy return self.rpcclient.call("Dump", onlyVisibleNode) File "/usr/local/lib/python3.7/site-packages/poco/utils/simplerpc/rpcclient.py", line 58, in call self.conn.send(msg) File "/usr/local/lib/python3.7/site-packages/poco/utils/simplerpc/transport/tcp/main.py", line 32, in send self.c.send(msg_bytes) File "/usr/local/lib/python3.7/site-packages/poco/utils/simplerpc/transport/tcp/safetcp.py", line 32, in send sent = self.sock.send(msg[totalsent:]) BrokenPipeError: [Errno 32] Broken pipe

Expected behaviour air test can open the app by poco setup

Platform: Mac

Smartphone (please complete the following information):

Additional context

EraChen233 commented 5 years ago

IOS simulator is supported. Have you started iOS-Tagent and connected to Airtest IDE with IP address? What does browser show when you open URL http://127.0.0.1:8100/inspector on your Mac? Proxy is no required for the iOS simulator.

EraChen233 commented 5 years ago

And what's the version of your xcode?

peileenf commented 5 years ago

my xcode is 10.1 the ios-target is running successfully. I can open the url : http://127.0.0.1:8100/status and inspector { "value" : { "state" : "success", "os" : { "name" : "iOS", "version" : "12.0" }, "ios" : { "simulatorVersion" : "12.0", "ip" : "10.128.60.107" }, "build" : { "time" : "Sep 28 2018 15:37:41" } }, "sessionId" : "477630B4-680C-4F28-8C24-A73ECD93B92E", "status" : 0 }

my sample code is: poco = UnityPoco() button = poco('submit')

button.exists() // the error pops when run any function of the poco object. the same scripts can run successfully in really device.

EraChen233 commented 5 years ago

Can you see the iOS simulator screen projected on the IDE device window? Have you opened proxy? What's the IP address you use on Airtest IDE?

peileenf commented 5 years ago

http://127.0.0.1:8100 this is the ip address Yes, I can see the simulator screen in Airtest IDE

EraChen233 commented 5 years ago

Not this one. It should be the IP showing in the xcode log viewer after you start Test

peileenf commented 5 years ago

http://10.128.60.107:8100 this is the ip after I run the ios-target test in xcode. how should I open the proxy?

EraChen233 commented 5 years ago

No need for proxy. IDE can connect to your iPhone with ip http://10.128.60.107:8100 directly.

peileenf commented 5 years ago

I tried. but the issue is not fixed. seems it issue related socket send message: https://stackoverflow.com/questions/12591760/flask-broken-pipe-with-requests :(. but I still don't know how to fix....

peileenf commented 5 years ago

it might be related the unity app build is not correct.

EraChen233 commented 5 years ago

Please show screenshots instead of text