提交 336e5585 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(uts): android 自动化测试,心跳检测应用崩溃,输出日志

上级 9e36836e
......@@ -76,6 +76,10 @@ export function onMessage(msg: string) {
// @ts-ignore
const json = JSON.parse<Msg>(msg)!
const method = json.method
if ((method == 'ping')) {
send('pong')
return
}
const params = JSON.stringify(json.params)
const res = new Map<string, any | null>([['id', json.id]])
try {
......@@ -205,7 +209,9 @@ export function initAutomator() {
socketTask = uni.connectSocket({
url: wsEndpoint
});
socketTask!.onMessage((res) => { onMessage(res.data as string) })
socketTask!.onMessage((res) => {
onMessage(res.data as string)
})
socketTask!.onOpen((_) => {
console.warn("automator.onOpen")
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册