parent
1363de0a83
commit
e87632e127
|
@ -462,7 +462,14 @@ public class IosAutomationHandler extends AbstractAutomationHandler {
|
|||
Map<String, Object> data = request.getData();
|
||||
String ocrText = (String) data.get(UpperParamKey.OCR_TEXT);
|
||||
logger.debug("拿到的截图参数----->>>>>查找的文本:{}", ocrText);
|
||||
File file = ScreenShotUtils.getIOSMobileScreenShot(serial);
|
||||
// File file = ScreenShotUtils.getIOSMobileScreenShot(serial);
|
||||
Integer x = data.containsKey(UpperParamKey.X) ? (Integer) data.get(UpperParamKey.X) : null;
|
||||
Integer y = data.containsKey(UpperParamKey.Y) ? (Integer) data.get(UpperParamKey.Y) : null;
|
||||
Integer screenWidth = data.containsKey(UpperParamKey.SCREEN_WIDTH) ? (Integer) data.get(UpperParamKey.SCREEN_WIDTH) : null;
|
||||
Integer screenHeight = data.containsKey(UpperParamKey.SCREEN_HEIGHT) ? (Integer) data.get(UpperParamKey.SCREEN_HEIGHT) : null;
|
||||
Integer cutWidth = data.containsKey(UpperParamKey.WIDTH) ? (Integer) data.get(UpperParamKey.WIDTH) : null;
|
||||
Integer cutHeight = data.containsKey(UpperParamKey.HEIGHT) ? (Integer) data.get(UpperParamKey.HEIGHT) : null;
|
||||
File file = deviceHandleHelper.getScreenShotFile(serial, x, y, cutWidth, cutHeight, screenWidth, screenHeight);
|
||||
logger.debug("执行步骤token:{},ocr截图:{}", request.getStepToken(), file.getAbsolutePath());
|
||||
return getFileBase64(file);
|
||||
}
|
||||
|
|
|
@ -95,8 +95,12 @@ public class MacIosHandleHelper extends IosDeviceHandleHelper {
|
|||
} else {
|
||||
logger.debug("设备【{}】截图的结果:{}",deviceId,screenShotFile.getAbsolutePath());
|
||||
}
|
||||
file = cutImageFile(screenShotFile, deviceId, startX, startY, cutWidth, cutHeight, screenWidth, screenHeight);
|
||||
logger.debug("截取出来的图像为:{}",file.getAbsolutePath());
|
||||
if (null != startX || null != startY) {
|
||||
file = cutImageFile(screenShotFile, deviceId, startX, startY, cutWidth, cutHeight, screenWidth, screenHeight);
|
||||
logger.debug("截取出来的图像为:{}", file.getAbsolutePath());
|
||||
} else {
|
||||
file = screenShotFile;
|
||||
}
|
||||
} finally {
|
||||
if (null != screenShotFile) {
|
||||
//删除
|
||||
|
|
Loading…
Reference in New Issue