Giter VIP home page Giter VIP logo

webdriver-phone-spec's Introduction

webdriver-phone-spec

WebDriver spec protocol for smart phone testing draft. For iOS and Android

Why make this project ?

One day I decide to make a phone manager platform and also decide to let this platform to support some REST API that can easily operate phone.

Then I google something relative, and found WebDriver spec, saddly this is decided for web testing, not for phone. Project facebook/WebDriverAgent is a good project that can reference, make some extension for WebDriver spec. So I decide to write it out as a draft, that will guide that phone manager platform develop in a right direction.

Reference

Queries

This is list of most common endpoints with some query examples using curl with pre-set environment variables:

  • DEVICE_URL set as device URL (eg. http://somehost/webdriver)
  • SESSION_ID set as session id. Returned by start session command e.g. D15E12F6-CA23-4CD4-89F9-E5C5EA6F4FAD
  • JSON_HEADER='-H "Content-Type: application/json"'

The RESTful API split into two part, session apis and without session apis.

Without Session APIs

APIs do not need a app started.

Get window size

GET /windows/size

Send Key Event

$ curl -X POST -d '{"key": "HOME"}' $DEVICE_URL/keyevent
{
	"status": 0,
	"value": "keyevent: HOME"
}

Android key can be the following string.

  • HOME
  • EDIT
  • BACK

more see here

iOS got only HOME works

Take screenshot

$ curl -X GET $DEVICE_URL/screenshot
{
	"status": 0,
	"value": "{base64 encoded data}"
}

Session APIs

Create a session

POST /session

GET /session

DELETE /session/{sessionId}

None WebDriver part

Most API reference openstf REST API

Authentication

TODO here.

Get infomation about yourself

$ curl -H "Authorization: Bearer YOUR-TOKEN-HERE" /api/user
{
	"email": "[email protected]",
	"name": "无名",
	"nickname": "unknown",
	"id": "https://login.netease.com/openid/unknown/"
}

Use a device

Attempts to add a device under the authenticated user's control. This is analogous to pressing "Use" in the UI.

$ curl -X POST --data '{"serial":"EP7351U3WQ"}' /api/user/devices
{
	"success": true
}

Stop using a device

$ curl -X DELETE /api/user/devices/{serial}
{
	"success": true
}

Remote Connect

Allows you to retrieve the remote debug URL(i.e. an adb connect able address)

$ curl -X POST /api/devices/{serial}/remoteConnect
{
	"success": true,
	"description": "Device connected",
	"remoteConnectUrl": "10.0.0.1:5555"
}

Disconnect a remote debugging session.

$ curl -X DELETE /api/devices/{serial}/remoteConnect
{
	"success": true
}

Install apk

$ curl -X POST --data '{"apkUrl":"https://static.dongqiudi.com/app/apk/dongqiudi_website.apk"}' /api/device/{serial}/installApk
{
	"success": true,
	"taskId": 1
}

LICENSE

Under GPL 3

webdriver-phone-spec's People

Contributors

codeskyblue avatar xinyu0601 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.