清空文本输入
parent
7ae47f8ef3
commit
8bc084459c
|
@ -662,9 +662,12 @@ public class IosAutomationHandler extends AbstractAutomationHandler {
|
||||||
}
|
}
|
||||||
boolean clear = (boolean) data.get(UpperParamKey.CLEAR);
|
boolean clear = (boolean) data.get(UpperParamKey.CLEAR);
|
||||||
if (clear) {
|
if (clear) {
|
||||||
logger.debug("步骤【{}】输入前清空数据",request.getStepToken());
|
String xpath = (String) data.get(UpperParamKey.NODE_TREE);
|
||||||
boolean clearSuccess = nkAgent.handleDeleteTextUiNode(Command.CLEAR.getCode());
|
logger.debug("步骤【{}】输入前清空数据,xpath:{}", request.getStepToken(),xpath);
|
||||||
logger.debug("步骤【{}】输入前清空数据结果:{}",request.getStepToken(),clearSuccess);
|
SearchUiNodeData searchUiNodeData = new SearchUiNodeData();
|
||||||
|
searchUiNodeData.setChain(xpath);
|
||||||
|
boolean clearSuccess = nkAgent.handleClearTextUiNode(searchUiNodeData,Command.CLEAR.getCode());
|
||||||
|
logger.debug("步骤【{}】输入前清空数据结果:{}", request.getStepToken(), clearSuccess);
|
||||||
}
|
}
|
||||||
String inputText = (String) data.get(UpperParamKey.INPUT_TEXT);
|
String inputText = (String) data.get(UpperParamKey.INPUT_TEXT);
|
||||||
Integer commandId = (Integer) data.get(UpperParamKey.COMMAND_ID);
|
Integer commandId = (Integer) data.get(UpperParamKey.COMMAND_ID);
|
||||||
|
@ -1637,7 +1640,7 @@ public class IosAutomationHandler extends AbstractAutomationHandler {
|
||||||
pointXpath[2] = xpathObject.getString("selector");
|
pointXpath[2] = xpathObject.getString("selector");
|
||||||
Integer num = (Integer) data.get(UpperParamKey.POINT_NUM);
|
Integer num = (Integer) data.get(UpperParamKey.POINT_NUM);
|
||||||
List<Integer> passPoint = (List<Integer>) data.get(UpperParamKey.SWIPE_POINT);
|
List<Integer> passPoint = (List<Integer>) data.get(UpperParamKey.SWIPE_POINT);
|
||||||
Integer waitTimeOut = (Integer) data.get(UpperParamKey.WAIT_TIME_OUT);
|
Integer waitTimeOut = (Integer) data.get(UpperParamKey.WAIT_TIMEOUT);
|
||||||
logger.debug("拿到的左上角的点:{}", pointXpath[0]);
|
logger.debug("拿到的左上角的点:{}", pointXpath[0]);
|
||||||
logger.debug("拿到的左上角的右边点:{}", pointXpath[1]);
|
logger.debug("拿到的左上角的右边点:{}", pointXpath[1]);
|
||||||
logger.debug("拿到的左上角的下边点:{}", pointXpath[2]);
|
logger.debug("拿到的左上角的下边点:{}", pointXpath[2]);
|
||||||
|
|
|
@ -146,10 +146,12 @@ public class AndroidScreenResponseThread extends ImageScreenResponse {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeScreenSize() {
|
public void changeScreenSize() {
|
||||||
|
if (null != this.asyncAgentSession) {
|
||||||
logger.info("改变设备【{}】屏幕的宽高..........................", adbDevice.getSerial());
|
logger.info("改变设备【{}】屏幕的宽高..........................", adbDevice.getSerial());
|
||||||
ScreenStreamCommand screenStreamCommand = new ScreenStreamCommand(true, catchParam.getRotation(), catchParam.getWidth(), catchParam.getHeight(), catchParam.getFrameRate(), catchParam.getQuality());
|
ScreenStreamCommand screenStreamCommand = new ScreenStreamCommand(true, catchParam.getRotation(), catchParam.getWidth(), catchParam.getHeight(), catchParam.getFrameRate(), catchParam.getQuality());
|
||||||
this.asyncAgentSession.send(screenStreamCommand);
|
this.asyncAgentSession.send(screenStreamCommand);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopFetchPic() {
|
public void stopFetchPic() {
|
||||||
|
|
|
@ -194,6 +194,16 @@ public final class NKAgent {
|
||||||
return bool.isSuccess();
|
return bool.isSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean handleClearTextUiNode(ICommandData data, int commandId) {
|
||||||
|
// System.out.println('删除');
|
||||||
|
ICommandPacket packet = packetTransfer.syncSend(commandId, data);
|
||||||
|
if (packet == null) return false;
|
||||||
|
BooleanCommandData bool = new BooleanCommandData();
|
||||||
|
packet.fillICommandData(bool);
|
||||||
|
return bool.isSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
设置JPEGServer的帧率
|
设置JPEGServer的帧率
|
||||||
rate 取值[0, 15]
|
rate 取值[0, 15]
|
||||||
|
|
|
@ -565,6 +565,18 @@ public class AutomationHandleUtil {
|
||||||
|
|
||||||
public static Boolean elementInput(ElementHandleParam param) throws Exception{
|
public static Boolean elementInput(ElementHandleParam param) throws Exception{
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
String xpath = null;
|
||||||
|
for (IStepTarget target : param.getTargets()) {
|
||||||
|
if (UsingType.SELECTOR.equals(target.getUsing())) {
|
||||||
|
JSONObject object = JSON.parseObject(target.getValue(), JSONObject.class);
|
||||||
|
xpath = object.getString(UsingType.Key.SELECTOR_KEY);
|
||||||
|
logger.info("拿到的nodeTree:{}", xpath);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(xpath)) {
|
||||||
|
throw new ExecuteException("只支持xpath的方式输入");
|
||||||
|
}
|
||||||
boolean clickSuccess = clickElement(param);
|
boolean clickSuccess = clickElement(param);
|
||||||
if (!clickSuccess) {
|
if (!clickSuccess) {
|
||||||
throw new ExecuteException("未找到控件");
|
throw new ExecuteException("未找到控件");
|
||||||
|
@ -574,6 +586,7 @@ public class AutomationHandleUtil {
|
||||||
paramMap.put(UpperParamKey.CLEAR, param.isClear());
|
paramMap.put(UpperParamKey.CLEAR, param.isClear());
|
||||||
paramMap.put(UpperParamKey.INPUT_TEXT, param.getInputTextValue());
|
paramMap.put(UpperParamKey.INPUT_TEXT, param.getInputTextValue());
|
||||||
paramMap.put(UpperParamKey.COMMAND_ID, CommandId.INPUT_TEXT.getCode());
|
paramMap.put(UpperParamKey.COMMAND_ID, CommandId.INPUT_TEXT.getCode());
|
||||||
|
paramMap.put(UpperParamKey.NODE_TREE, xpath);
|
||||||
CmdAutomationRequest builder = CmdAutomationRequest.builder(AutomationRequestCmd.INPUT_TEXT, token, paramMap);
|
CmdAutomationRequest builder = CmdAutomationRequest.builder(AutomationRequestCmd.INPUT_TEXT, token, paramMap);
|
||||||
Object o = sendUpperMessageAndWaitReturn(param.getDeviceDriver(), builder, token, param.getWaitTimeout());
|
Object o = sendUpperMessageAndWaitReturn(param.getDeviceDriver(), builder, token, param.getWaitTimeout());
|
||||||
logger.debug("控件输入的结果:{}", o);
|
logger.debug("控件输入的结果:{}", o);
|
||||||
|
|
Loading…
Reference in New Issue