/iOS-Tagent

iOS support agent for automation

Primary LanguageObjective-COtherNOASSERTION

iOS-Tagent Introduction

image

iOS-Tagent is a project based on facebook WebDriverAgent and intend to fit Airtest Project.

中文文档

To use Airtest and AirtestIDE on iOS, this project is required.

This Project is worked well in:

iOS Xcode
10.x-12.x 10.x
9.x 9.x

Other version of xcode and iOS version is not fully tested if you have problem with this project please goto issues

API status

This project intend to work with AirtestIDE and AirtestFramework

Common API in Airtest is supported

  • start_app: OK
  • stop_app: OK
  • snapshot: OK
  • home: OK
  • touch: OK
  • swipe: OK
  • text: OK
  • wait: OK
  • exists: OK
  • find_all: OK
  • assert_exists: OK
  • assert_not_exists: OK

except:

  • wake: Not supported now (may use 'home' instead)
  • keyevent: Only support 'home' event
  • clear_app: Not supported now
  • install: Not supported now
  • uninstall: Not supported now

Fast Hierarchy view

Now it can view device Hierarchy really fast

image

This feature work with Poco and AirtestIDE.

Getting Started

prerequisite

  1. iOS Provisioning Profile(Certificate) (free or paid)
  2. basic experience with xcode

You can simply open WebDriverAgent.xcodeproj and start WebDriverAgentRunner to test

and start do what you want with Airtest (with iOS http url)

Start manual

1. run the agent

1.1 set up an signing in WebDriverAgent -> WebDriverAgent-Runner-> General -> signing.

1.2 if a free personal certificate used

> This will manifest as something like an error that Xcode failed to
> create provisioning profile:
>
> ![image](./IntroductionPhoto/FailID.png)
>
> please change 'Build Settings' ->"Product Bundle Identifier" into
> somethings else. like 'com.xxx.webDriverAgent-test123'
>
> ![image](./IntroductionPhoto/bundleId.png)

2. perform test in a selected device

2.1 choose device first

image

2.2 choose schema next

image

2.3 finally: Product -> Test

image

or

image

2.4 also you need trust the application. You can go to Settings => General => Device Management on the device to trust the developer and allow the app to be run (see Apple documentation for mor information ) after that run 'test' again

2.5 start success

> when something like this show in log, it means webDricerAgent
> start success :
>
>     Test Suite 'All tests' started at 2017-01-23 15:49:12.585
>     Test Suite 'WebDriverAgentRunner.xctest' started at 2017-01-23 15:49:12.586
>     Test Suite 'UITestingUITests' started at 2017-01-23 15:49:12.587
>     Test Case '-[UITestingUITests testRunner]' started.
>     t =     0.00s     Start Test at 2017-01-23 15:49:12.588
>     t =     0.00s     Set Up

More about how to start WebDriverAgent here and another

3. Set up proxy

You need to set up proxy to forward request to real device via usb-forwarding as this may have something wrong, known Issues and detail

You can use iproxy

$ brew install libimobiledevice
$ iproxy 8100 8100

Then try to access http://127.0.0.1:8100/status in mac browser, is a json string shown, mean all start success

4. Finally

You can use iOS device in airtest with http://127.0.0.1:8100

Known Issues

https://github.com/AirtestProject/iOS-Tagent/issues

License

This project is based on WebDriverAgent :

WebDriverAgent is BSD-licensed . We also provide an additional patent grant.

Have fun with Airtest!