Skip to content

Commit

Permalink
Merge pull request #255 from caofengbin/feature/input_method
Browse files Browse the repository at this point in the history
feat: H5端与iOS端,实现先获取焦点,再输入文本的能力,对齐Android端
  • Loading branch information
ZhouYixun committed Jun 4, 2023
2 parents ed2bcc2 + f58b117 commit 71b2840
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 32 deletions.
5 changes: 3 additions & 2 deletions src/components/StepShow.vue
Expand Up @@ -402,8 +402,9 @@ const getNotes = (text, type) => {
<el-tag size="small" style="margin-right: 10px">输入法输入</el-tag>
{{ step.content }}
</span>
<span v-if="step.stepType === 'sendKeysByActions'">
<el-tag type="info" size="small">{{ step.elements[0]['eleName'] }}</el-tag>
<span v-if="step.stepType === 'sendKeysByActions' || step.stepType === 'webViewSendKeysByActions'">
<el-tag size="small">{{ getEleResult(step.stepType) }}控件元素</el-tag>
<el-tag type="info" size="small" style="margin-left: 10px">{{ step.elements[0]['eleName'] }}</el-tag>
<el-tag size="small" style="margin-left: 10px; margin-right: 10px"
>输入文本(Actions)</el-tag
>
Expand Down
51 changes: 21 additions & 30 deletions src/components/StepUpdate.vue
Expand Up @@ -292,6 +292,10 @@ const summitStep = () => {
}
});
};
// 当前步骤类型,是否需要展示ByActions的 alert 提示
const shouldShowByActionsTip = (stepType) => {
return stepType === 'sendKeysByActions' || stepType === 'webViewSendKeysByActions';
}
const getPublicStepList = () => {
axios
.get('/controller/publicSteps/findNameByProjectId', {
Expand Down Expand Up @@ -618,6 +622,10 @@ const androidOptions = ref([
value: 'webViewSendKeys',
label: '输入文本',
},
{
value: 'webViewSendKeysByActions',
label: '输入文本(Actions)',
},
{
value: 'webViewClear',
label: '清空输入框',
Expand Down Expand Up @@ -924,6 +932,10 @@ const iOSOptions = ref([
value: 'sendKeys',
label: '输入文本',
},
{
value: 'sendKeysByActions',
label: '输入文本(Actions)',
},
{
value: 'swipe2',
label: '拖拽控件元素',
Expand Down Expand Up @@ -1901,16 +1913,22 @@ onMounted(() => {

<div
v-if="
step.stepType === 'sendKeys' || step.stepType === 'webViewSendKeys'
step.stepType === 'sendKeys' || step.stepType === 'webViewSendKeys' || step.stepType === 'sendKeysByActions' || step.stepType === 'webViewSendKeysByActions'
"
>
<el-alert
show-icon
style="margin-bottom: 10px"
close-text="Get!"
type="info"
title="TIPS: 需要临时变量或全局变量时,可以添加{{变量名}}的形式"
/>
>
<template #title>
<div v-if="shouldShowByActionsTip(step.stepType)">
TIPS: 在文本框需要先获取焦点,才能进行输入时,使用此方式。
</div>
<div>需要临时变量或全局变量时,可以添加&#123;&#123; 变量名 &#125;&#125;的形式。</div>
</template>
</el-alert>
<element-select
label="控件元素"
place="请选择控件元素"
Expand Down Expand Up @@ -1942,33 +1960,6 @@ onMounted(() => {
</el-form-item>
</div>

<div v-if="step.stepType === 'sendKeysByActions'">
<el-alert
show-icon
style="margin-bottom: 10px"
close-text="Get!"
type="info"
>
<template #title>
<div>
TIPS: 使用Android Driver在Flutter页面输入文本时使用此方式。
</div>
<div>需要临时变量或全局变量时,可以添加{{ 变量名 }}的形式。</div>
</template>
</el-alert>
<element-select
label="控件元素"
place="请选择控件元素"
:index="0"
:project-id="projectId"
type="normal"
:step="step"
/>
<el-form-item label="输入值">
<el-input v-model="step.content" placeholder="请输入值"></el-input>
</el-form-item>
</div>

<div v-if="step.stepType === 'swipe2'">
<element-select
label="从控件"
Expand Down

0 comments on commit 71b2840

Please sign in to comment.