1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00

Implement device screen.

This commit is contained in:
Simo Kinnunen 2014-02-06 22:45:19 +09:00
parent a2dd5ad0c7
commit d17e86bc57
9 changed files with 317 additions and 1 deletions

View file

@ -355,27 +355,51 @@ module.exports = function(options) {
})
.on(wire.TouchDownMessage, function(channel, message) {
services.input.touchDownAsync(message.x, message.y)
.catch(function(err) {
log.error('touchDown failed', err.stack)
})
})
.on(wire.TouchMoveMessage, function(channel, message) {
services.input.touchMoveAsync(message.x, message.y)
.catch(function(err) {
log.error('touchMove failed', err.stack)
})
})
.on(wire.TouchUpMessage, function(channel, message) {
services.input.touchUpAsync(message.x, message.y)
.catch(function(err) {
log.error('touchUp failed', err.stack)
})
})
.on(wire.TapMessage, function(channel, message) {
services.input.tapAsync(message.x, message.y)
.catch(function(err) {
log.error('tap failed', err.stack)
})
})
.on(wire.TypeMessage, function(channel, message) {
services.monkey.typeAsync(message.text)
.catch(function(err) {
log.error('type failed', err.stack)
})
})
.on(wire.KeyDownMessage, function(channel, message) {
services.monkey.keyDownAsync(message.key)
.catch(function(err) {
log.error('keyDown failed', err.stack)
})
})
.on(wire.KeyUpMessage, function(channel, message) {
services.monkey.keyUpAsync(message.key)
.catch(function(err) {
log.error('keyUp failed', err.stack)
})
})
.on(wire.KeyPressMessage, function(channel, message) {
services.monkey.pressAsync(message.key)
.catch(function(err) {
log.error('keyPress failed', err.stack)
})
})
.on(wire.ShellCommandMessage, function(channel, message) {
log.info('Running shell command "%s"', message.command.join(' '))