Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:增加获取控件属性到自定义变量的能力 #259

Merged
merged 1 commit into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/components/StepShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,21 @@ const getNotes = (text, type) => {
>
获取到变量:{{ step.content }}
</span>
<span
v-if="
step.stepType === 'obtainElementAttr' ||
step.stepType === 'obtainPocoElementAttr'
"
>
<el-tag size="small">获取{{ getEleResult(step.stepType) }}控件属性</el-tag>
<el-tag
type="info"
size="small"
style="margin-left: 10px; margin-right: 10px"
>{{ step.elements[0]['eleName'] }}</el-tag
>
的 {{ step.text }} 属性到变量:{{ step.content }}
</span>
<span v-if="step.stepType === 'getClipperByKeyboard'">
<el-tag size="small">获取剪切板文本</el-tag>
获取到变量:{{ step.content }}
Expand Down
60 changes: 56 additions & 4 deletions src/components/StepUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ const androidOptions = ref([
value: 'clear',
label: '清空输入框',
},
{
value: 'obtainElementAttr',
label: '获取控件属性',
},
{
value: 'getElementAttr',
label: '验证控件属性',
Expand Down Expand Up @@ -711,6 +715,10 @@ const androidOptions = ref([
value: 'closePocoDriver',
label: '关闭PocoDriver',
},
{
value: 'obtainPocoElementAttr',
label: '获取控件属性',
},
{
value: 'getPocoElementAttr',
label: '验证控件属性',
Expand Down Expand Up @@ -959,6 +967,10 @@ const iOSOptions = ref([
value: 'clear',
label: '清空输入框',
},
{
value: 'obtainElementAttr',
label: '获取控件属性',
},
{
value: 'getElementAttr',
label: '验证控件属性',
Expand Down Expand Up @@ -1051,6 +1063,10 @@ const iOSOptions = ref([
value: 'closePocoDriver',
label: '关闭PocoDriver',
},
{
value: 'obtainPocoElementAttr',
label: '获取控件属性',
},
{
value: 'getPocoElementAttr',
label: '验证控件属性',
Expand Down Expand Up @@ -2367,7 +2383,15 @@ onMounted(() => {
</el-form-item>
</div>

<div v-if="step.stepType === 'getElementAttr'">
<div v-if="step.stepType === 'getElementAttr' || step.stepType === 'obtainElementAttr'">
<el-alert
v-show="step.stepType === 'obtainElementAttr'"
show-icon
style="margin-bottom: 10px"
close-text="Get!"
type="info"
title="TIPS: 可以将获取的控件属性放入临时变量中"
/>
<element-select
label="控件元素"
place="请选择控件元素"
Expand Down Expand Up @@ -2431,15 +2455,33 @@ onMounted(() => {
<el-option value="visible"></el-option>
</el-select>
</el-form-item>
<el-form-item label="期望值" prop="content">
<el-form-item
v-if="step.stepType === 'getElementAttr'"
label="期望值" prop="content">
<el-input
v-model="step.content"
placeholder="请输入期望值"
></el-input>
</el-form-item>
<el-form-item
v-else
label="变量名" prop="content">
<el-input
v-model="step.content"
placeholder="请输入变量名"
></el-input>
</el-form-item>
</div>

<div v-if="step.stepType === 'getPocoElementAttr'">
<div v-if="step.stepType === 'getPocoElementAttr' || step.stepType === 'obtainPocoElementAttr'">
<el-alert
v-show="step.stepType === 'obtainPocoElementAttr'"
show-icon
style="margin-bottom: 10px"
close-text="Get!"
type="info"
title="TIPS: 可以将获取的控件属性放入临时变量中"
/>
<element-select
label="控件元素"
place="请选择控件元素"
Expand Down Expand Up @@ -2481,12 +2523,22 @@ onMounted(() => {
<el-option value="clickable"></el-option>
</el-select>
</el-form-item>
<el-form-item label="期望值" prop="content">
<el-form-item
v-if="step.stepType === 'getPocoElementAttr'"
label="期望值" prop="content">
<el-input
v-model="step.content"
placeholder="请输入期望值"
></el-input>
</el-form-item>
<el-form-item
v-else
label="变量名" prop="content">
<el-input
v-model="step.content"
placeholder="请输入变量名"
></el-input>
</el-form-item>
</div>

<div v-if="step.stepType === 'siriCommand'">
Expand Down