From a559c02334222382f39957c1e207aacc202fb2b9 Mon Sep 17 00:00:00 2001 From: Eason <291028775@qq.com> Date: Fri, 26 May 2023 00:16:53 +0800 Subject: [PATCH] feat: set snapshot --- src/components/StepShow.vue | 6 ++++- src/components/StepUpdate.vue | 31 +++++++++++++++++++------- src/locales/lang/en_US.js | 1 + src/locales/lang/ja_JP.js | 1 + src/locales/lang/zh_CN.js | 1 + src/locales/lang/zh_TW.js | 1 + src/views/RemoteEmulator/IOSRemote.vue | 13 ++++++++++- 7 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/components/StepShow.vue b/src/components/StepShow.vue index 14ba5208..21756baf 100644 --- a/src/components/StepShow.vue +++ b/src/components/StepShow.vue @@ -485,7 +485,7 @@ const getNotes = (text, type) => { size="small" style="margin-left: 10px; margin-right: 10px" >{{ step.elements[0]['eleName'] }} 期望: + > 期望: {{ getAssertTextOpe(step.content) }}{{ step.text }} @@ -620,6 +620,10 @@ const getNotes = (text, type) => { 强制等待 等待 {{ step.content }} ms + + 设置控件获取最大遍历深度 + 最大 {{ step.content }} 层 + { step.value.stepType === 'setDefaultFindPocoElementInterval' || step.value.stepType === 'setDefaultFindWebViewElementInterval' || step.value.stepType === 'longPress' || - step.value.stepType === 'checkImage' + step.value.stepType === 'checkImage' || + step.value.stepType === 'setSnapshotMaxDepth' ) { step.value.content = parseInt(step.value.content); } @@ -358,7 +359,7 @@ const getStepInfo = (id) => { } if ( step.value.stepType === 'assertText' || - step.value.stepType === 'assertWebViewText' || + step.value.stepType === 'assertWebViewText' || step.value.stepType === 'assertPocoText' ) { step.value.content = JSON.parse(step.value.content); @@ -955,6 +956,10 @@ const iOSOptions = ref([ value: 'iteratorIOSElement', label: '迭代控件列表', }, + { + value: 'setSnapshotMaxDepth', + label: '设置控件获取最大遍历深度', + }, ], }, { @@ -1508,7 +1513,7 @@ onMounted(() => { placeholder="输入数量" :min="0" style="width: 150px; margin-left: 10px;" - prop="text" + prop="text" > @@ -1763,7 +1768,7 @@ onMounted(() => {
{ placeholder="输入数量" :min="0" style="width: 150px; margin-left: 10px;" - prop="text" + prop="text" >
@@ -1983,6 +1988,16 @@ onMounted(() => { /> +
+ + + +
+
{
{
{ - diff --git a/src/locales/lang/en_US.js b/src/locales/lang/en_US.js index aa55963c..117c8ff6 100644 --- a/src/locales/lang/en_US.js +++ b/src/locales/lang/en_US.js @@ -963,6 +963,7 @@ const usersTS = { }, }; const IOSRemote = { + depth: "Snapshot Max Depth", driverStatus: { success: 'Init WebDriverAgent successful!', fail: 'Init WebDriverAgent failed!', diff --git a/src/locales/lang/ja_JP.js b/src/locales/lang/ja_JP.js index 7128c88c..02d6bf30 100644 --- a/src/locales/lang/ja_JP.js +++ b/src/locales/lang/ja_JP.js @@ -940,6 +940,7 @@ const usersTS = { }, }; const IOSRemote = { + depth: "最大遍历深度", driverStatus: { success: '初始化 WebDriverAgent 完成!', fail: '初始化 WebDriverAgent 失败!', diff --git a/src/locales/lang/zh_CN.js b/src/locales/lang/zh_CN.js index 143bb91c..81027ae8 100644 --- a/src/locales/lang/zh_CN.js +++ b/src/locales/lang/zh_CN.js @@ -938,6 +938,7 @@ const usersTS = { }, }; const IOSRemote = { + depth: "最大遍历深度", driverStatus: { success: '初始化 WebDriverAgent 完成!', fail: '初始化 WebDriverAgent 失败!', diff --git a/src/locales/lang/zh_TW.js b/src/locales/lang/zh_TW.js index 71417664..2b2c0023 100644 --- a/src/locales/lang/zh_TW.js +++ b/src/locales/lang/zh_TW.js @@ -938,6 +938,7 @@ const usersTS = { }, }; const IOSRemote = { + depth: "最大遍历深度", driverStatus: { success: '初始化 WebDriverAgent 完成!', fail: '初始化 WebDriverAgent 失败!', diff --git a/src/views/RemoteEmulator/IOSRemote.vue b/src/views/RemoteEmulator/IOSRemote.vue index 42012b81..67fc9952 100644 --- a/src/views/RemoteEmulator/IOSRemote.vue +++ b/src/views/RemoteEmulator/IOSRemote.vue @@ -101,6 +101,7 @@ const directionStatus = { }; let moveX = 0; let moveY = 0; +const depth = ref(50); const isFixTouch = false; const isPress = false; let loop = null; @@ -1181,6 +1182,7 @@ const getElement = () => { type: 'debug', detail: 'tree', needImg: oldBlob == null, + depth: depth.value }) ); }; @@ -2558,15 +2560,24 @@ const checkAlive = () => { margin-bottom: 15px; display: flex; align-items: center; - justify-content: space-between; " > + {{ $t('IOSRemote.depth') }}: +