Skip to content

Commit

Permalink
Merge pull request #284 from YeungHoiChiu/feat-android-step-add-dragA…
Browse files Browse the repository at this point in the history
…ndDrop

feat: `Android`自动化测试步骤中新增拖拽操作以及拖拽动作拆分的三个独立事件操作
  • Loading branch information
ZhouYixun authored Aug 8, 2024
2 parents 7e8eb05 + 05c30bc commit c4c5316
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 10 deletions.
26 changes: 26 additions & 0 deletions src/components/StepShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,32 @@ const getNotes = (text, type) => {
}}</el-tag>
<el-tag type="info" size="small">{{ step.elements[1]['eleName'] }}</el-tag>
</span>
<span v-if="step.stepType === 'drag2' || step.stepType === 'drag'">
<el-tag size="small" style="margin-right: 10px">
{{ $t('stepDetail.dragUp') }}</el-tag
>
<el-tag type="info" size="small">{{ step.elements[0]['eleName'] }}</el-tag>
<el-tag size="small" style="margin-left: 10px; margin-right: 10px">{{
$t('stepDetail.dragMove')
}}</el-tag>
<el-tag type="info" size="small">{{ step.elements[1]['eleName'] }}</el-tag>
<el-tag size="small" style="margin-left: 10px; margin-right: 10px">
{{ $t('stepDetail.dragDown') }}</el-tag
>
</span>
<span
v-if="
step.stepType === 'motionEvent' || step.stepType === 'motionEventByPoint'
"
>
<el-tag size="small" type="info">{{ step.elements[0]['eleName'] }}</el-tag>
<el-tag size="small" style="margin-left: 10px; margin-right: 10px">{{
$t('stepDetail.motionType.Exec')
}}</el-tag>
<el-tag type="info" size="small" style="margin-right: 10px">
{{ step.text.toUpperCase() }}</el-tag
>
</span>
<span
v-if="step.stepType === 'longPress' || step.stepType === 'pocoLongPress'"
>
Expand Down
96 changes: 94 additions & 2 deletions src/components/StepUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,14 @@ const androidOptions = ref([
value: 'swipe2',
label: $t('stepDetail.label.androidOptions.element.uiEle.swipe2'),
},
{
value: 'drag2',
label: $t('stepDetail.label.androidOptions.element.uiEle.drag2'),
},
{
value: 'motionEvent',
label: $t('stepDetail.label.androidOptions.element.uiEle.motion'),
},
{
value: 'scrollToEle',
label: $t(
Expand Down Expand Up @@ -668,6 +676,18 @@ const androidOptions = ref([
'stepDetail.label.androidOptions.element.coordinate.swipe'
),
},
{
value: 'drag',
label: $t(
'stepDetail.label.androidOptions.element.coordinate.drag'
),
},
{
value: 'motionEventByPoint',
label: $t(
'stepDetail.label.androidOptions.element.coordinate.motion'
),
},
],
},
{
Expand Down Expand Up @@ -1567,7 +1587,7 @@ onMounted(() => {
</el-form-item>
</div>

<div v-if="step.stepType === 'swipe'">
<div v-if="step.stepType === 'swipe' || step.stepType === 'drag'">
<element-select
:label="$t('stepDetail.fromControl')"
:place="
Expand Down Expand Up @@ -2349,7 +2369,7 @@ onMounted(() => {
</el-form-item>
</div>

<div v-if="step.stepType === 'swipe2'">
<div v-if="step.stepType === 'swipe2' || step.stepType === 'drag2'">
<element-select
:label="$t('stepDetail.fromControl')"
:place="
Expand All @@ -2372,6 +2392,78 @@ onMounted(() => {
/>
</div>


<div v-if="step.stepType === 'motionEvent'">
<element-select
:label="$t('stepDetail.control.element')"
:place="
$t('stepDetail.msg.select') + $t('stepDetail.control.element')
"
:index="0"
:project-id="projectId"
type="normal"
:step="step"
/>
<el-form-item
:label="$t('stepDetail.motionType.self')"
:rules="[
{
required: true,
message:
$t('stepDetail.msg.select') + $t('stepDetail.motionType.self'),
trigger: 'change',
},
]"
prop="text"
>
<el-select
v-model="step.text"
:placeholder="
$t('stepDetail.msg.select') + $t('stepDetail.motionType.self')
"
>
<el-option lable="DOWN" value="down"></el-option>
<el-option lable="UP" value="up"></el-option>
<el-option lable="MOVE" value="move"></el-option>
</el-select>
</el-form-item>
</div>
<div v-if="step.stepType === 'motionEventByPoint'">
<element-select
:label="$t('stepDetail.label.androidOptions.element.coordinate.self')"
:place="
$t('stepDetail.msg.select') +
$t('stepDetail.label.androidOptions.element.coordinate.self')
"
:index="0"
:project-id="projectId"
type="point"
:step="step"
/>
<el-form-item
:label="$t('stepDetail.motionType.self')"
:rules="[
{
required: true,
message:
$t('stepDetail.msg.select') + $t('stepDetail.motionType.self'),
trigger: 'change',
},
]"
prop="text"
>
<el-select
v-model="step.text"
:placeholder="
$t('stepDetail.msg.select') + $t('stepDetail.motionType.self')
"
>
<el-option lable="DOWN" value="down"></el-option>
<el-option lable="UP" value="up"></el-option>
<el-option lable="MOVE" value="move"></el-option>
</el-select>
</el-form-item>
</div>
<div v-if="step.stepType === 'scrollToEle'">
<el-alert
show-icon
Expand Down
13 changes: 12 additions & 1 deletion src/locales/lang/en_US.js
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,9 @@ const stepDetail = {
delete: 'Delete ',
detect: 'Detect ',
dragTo: 'Drag To ',
dragUp: 'Analog long press',
dragMove: 'Then drag to',
dragDown: 'And drop',
display: 'Display ',
downwards: 'Downwards ',
exception: {
Expand Down Expand Up @@ -1264,6 +1267,8 @@ const stepDetail = {
sendKeys: 'Enter Text',
sendKeysByActions: 'Enter Text(Actions)',
swipe2: 'Drag Control Element',
drag2: 'Drag And Drop Control Element',
motion: 'Motion Event',
scrollToEle: 'Drag to Control Element',
longPress: 'Long Press Control Element',
clear: 'Clear InputBox',
Expand All @@ -1279,6 +1284,8 @@ const stepDetail = {
tap: 'Tap Coordinate',
longPressPoint: 'Long Press Point',
swipe: 'Swipe',
drag: 'Drag And Drop',
motion: 'Motion Event',
},
webView: {
self: 'WebView Control',
Expand Down Expand Up @@ -1348,7 +1355,7 @@ const stepDetail = {
self: 'Runtime Settings',
stepHold: 'Step Interval setting',
switchTouchMode: 'Touch Mode Setting',
},
},
},
iOSOptions: {
system: {
Expand Down Expand Up @@ -1483,6 +1490,10 @@ const stepDetail = {
maxTries: 'Max Tries ',
multiWindowMode: 'Multi Window Mode',
mode: 'Mode',
motionType: {
self: 'Motion Type',
Exec: 'Touch action',
},
maxDepth: 'Max Depth',
maxScroll: 'Max Scroll',
msg: {
Expand Down
17 changes: 14 additions & 3 deletions src/locales/lang/ja_JP.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ const common = {
copy: '复制',
inuse: '使用済み',
inidle: 'アイドル状態',

};
// 路由
const routes = {
Expand Down Expand Up @@ -1074,6 +1074,9 @@ const stepDetail = {
delete: '删除',
detect: '检测',
dragTo: '滑动拖拽至',
dragUp: '模拟长按',
dragMove: '后拖拽移动到',
dragDown: '松手',
display: '显示',
downwards: '向下',
exception: {
Expand Down Expand Up @@ -1181,6 +1184,8 @@ const stepDetail = {
sendKeys: '输入文本',
sendKeysByActions: '输入文本(Actions)',
swipe2: '拖拽控件元素',
drag2: '(长按)控件元素拖拽移动',
motion: '触控动作事件(MotionEvent)',
scrollToEle: '滚动到控件元素',
longPress: '长按控件元素',
clear: '清空输入框',
Expand All @@ -1196,6 +1201,8 @@ const stepDetail = {
tap: '点击坐标',
longPressPoint: '长按坐标',
swipe: '滑动拖拽',
drag: '(长按)坐标拖拽滑动',
motion: '触控动作事件(MotionEvent)',
},
webView: {
self: 'WebView控件',
Expand Down Expand Up @@ -1265,7 +1272,7 @@ const stepDetail = {
self: '运行设置',
stepHold: '步骤间隔设置',
switchTouchMode: '触控模式设置',
},
},
},
iOSOptions: {
system: {
Expand Down Expand Up @@ -1399,6 +1406,10 @@ const stepDetail = {
maxTries: '最大尝试',
multiWindowMode: '多窗口模式',
mode: '模式',
motionType: {
self: '动作类型',
Exec: '执行触控动作',
},
maxDepth: '最大深度',
maxScroll: '最多滚动',
msg: {
Expand Down Expand Up @@ -1436,7 +1447,7 @@ const stepDetail = {
'TIPS: 传递Android应用的App包名,该步骤可实现自动授权目标App所需要的所有权限',
focus: 'TIPS: 在文本框需要先获取焦点,才能进行输入时,使用此方式。',
sysKey:
'TIPS: 本功能需要先唤醒系统键盘。需要临时变量或全局变量时,可以添加',
'TIPS: 本功能需要先唤醒系统键盘。需要临时变量或全局变量时,可以添加',
table: 'TIPS: 长列表的场景下,可通过该方法连续滚动,尝试让目标元素可见',
text: 'TIPS: 可以将获取的文本放入临时变量中',
controlAttribute: 'TIPS: 可以将获取的控件属性放入临时变量中',
Expand Down
15 changes: 13 additions & 2 deletions src/locales/lang/zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@ const stepDetail = {
delete: '删除',
detect: '检测',
dragTo: '滑动拖拽至',
dragUp: '模拟长按',
dragMove: '后拖拽移动到',
dragDown: '松手',
display: '显示',
downwards: '向下',
exception: {
Expand Down Expand Up @@ -1241,6 +1244,8 @@ const stepDetail = {
sendKeys: '输入文本',
sendKeysByActions: '输入文本(Actions)',
swipe2: '拖拽控件元素',
drag2: '(长按)控件元素拖拽移动',
motion: '触控动作事件(MotionEvent)',
scrollToEle: '滚动到控件元素',
longPress: '长按控件元素',
clear: '清空输入框',
Expand All @@ -1256,6 +1261,8 @@ const stepDetail = {
tap: '点击坐标',
longPressPoint: '长按坐标',
swipe: '滑动拖拽',
drag: '(长按)坐标拖拽滑动',
motion: '触控动作事件(MotionEvent)',
},
webView: {
self: 'WebView控件',
Expand Down Expand Up @@ -1325,7 +1332,7 @@ const stepDetail = {
self: '运行设置',
stepHold: '步骤间隔设置',
switchTouchMode: '触控模式设置',
},
},
},
iOSOptions: {
system: {
Expand Down Expand Up @@ -1459,6 +1466,10 @@ const stepDetail = {
maxTries: '最大尝试',
multiWindowMode: '多窗口模式',
mode: '模式',
motionType: {
self: '动作类型',
Exec: '执行触控动作',
},
maxDepth: '最大深度',
maxScroll: '最多滚动',
msg: {
Expand Down Expand Up @@ -1496,7 +1507,7 @@ const stepDetail = {
'TIPS: 传递Android应用的App包名,该步骤可实现自动授权目标App所需要的所有权限',
focus: 'TIPS: 在文本框需要先获取焦点,才能进行输入时,使用此方式。',
sysKey:
'TIPS: 本功能需要先唤醒系统键盘。需要临时变量或全局变量时,可以添加',
'TIPS: 本功能需要先唤醒系统键盘。需要临时变量或全局变量时,可以添加',
table: 'TIPS: 长列表的场景下,可通过该方法连续滚动,尝试让目标元素可见',
text: 'TIPS: 可以将获取的文本放入临时变量中',
controlAttribute: 'TIPS: 可以将获取的控件属性放入临时变量中',
Expand Down
15 changes: 13 additions & 2 deletions src/locales/lang/zh_TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,9 @@ const stepDetail = {
delete: '删除',
detect: '检测',
dragTo: '滑动拖拽至',
dragUp: '模拟长按',
dragMove: '后拖拽移动到',
dragDown: '松手',
display: '显示',
downwards: '向下',
exception: {
Expand Down Expand Up @@ -1178,6 +1181,8 @@ const stepDetail = {
sendKeys: '输入文本',
sendKeysByActions: '输入文本(Actions)',
swipe2: '拖拽控件元素',
drag2: '(长按)控件元素拖拽移动',
motion: '触控动作事件(MotionEvent)',
scrollToEle: '滚动到控件元素',
longPress: '长按控件元素',
clear: '清空输入框',
Expand All @@ -1193,6 +1198,8 @@ const stepDetail = {
tap: '点击坐标',
longPressPoint: '长按坐标',
swipe: '滑动拖拽',
drag: '(长按)坐标拖拽滑动',
motion: '触控动作事件(MotionEvent)',
},
webView: {
self: 'WebView控件',
Expand Down Expand Up @@ -1262,7 +1269,7 @@ const stepDetail = {
self: '运行设置',
stepHold: '步骤间隔设置',
switchTouchMode: '触控模式设置',
},
},
},
iOSOptions: {
system: {
Expand Down Expand Up @@ -1396,6 +1403,10 @@ const stepDetail = {
maxTries: '最大尝试',
multiWindowMode: '多窗口模式',
mode: '模式',
motionType: {
self: '动作类型',
Exec: '执行触控动作',
},
maxDepth: '最大深度',
maxScroll: '最多滚动',
msg: {
Expand Down Expand Up @@ -1433,7 +1444,7 @@ const stepDetail = {
'TIPS: 传递Android应用的App包名,该步骤可实现自动授权目标App所需要的所有权限',
focus: 'TIPS: 在文本框需要先获取焦点,才能进行输入时,使用此方式。',
sysKey:
'TIPS: 本功能需要先唤醒系统键盘。需要临时变量或全局变量时,可以添加',
'TIPS: 本功能需要先唤醒系统键盘。需要临时变量或全局变量时,可以添加',
table: 'TIPS: 长列表的场景下,可通过该方法连续滚动,尝试让目标元素可见',
text: 'TIPS: 可以将获取的文本放入临时变量中',
controlAttribute: 'TIPS: 可以将获取的控件属性放入临时变量中',
Expand Down

0 comments on commit c4c5316

Please sign in to comment.