Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
eb6cb318
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6022
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
eb6cb318
编写于
4月 29, 2024
作者:
taohebin@dcloud.io
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: input增加自动化测试例
上级
b1c6cee3
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
54 addition
and
2 deletion
+54
-2
pages.json
pages.json
+7
-0
pages/component/input/blank-for-test.uvue
pages/component/input/blank-for-test.uvue
+22
-0
pages/component/input/input.test.js
pages/component/input/input.test.js
+20
-0
pages/component/input/input.uvue
pages/component/input/input.uvue
+5
-2
未找到文件。
pages.json
浏览文件 @
eb6cb318
...
@@ -1312,6 +1312,13 @@
...
@@ -1312,6 +1312,13 @@
{
{
"navigationBarTitleText"
:
"overflow-visible-event"
"navigationBarTitleText"
:
"overflow-visible-event"
}
}
},
{
"path"
:
"pages/component/input/blank-for-test"
,
"style"
:
{
"navigationBarTitleText"
:
"测试空白页面"
}
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
...
...
pages/component/input/blank-for-test.uvue
0 → 100644
浏览文件 @
eb6cb318
<template>
<view style="justify-content: center;align-items: center;">
<text>测试空白页面</text>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
pages/component/input/input.test.js
浏览文件 @
eb6cb318
...
@@ -172,6 +172,26 @@ describe('component-native-input', () => {
...
@@ -172,6 +172,26 @@ describe('component-native-input', () => {
})
})
})
})
it
(
"
keyboard height changed after page back
"
,
async
()
=>
{
await
program
.
navigateTo
(
"
/pages/component/input/blank-for-test
"
)
await
page
.
waitFor
(
2000
);
await
program
.
navigateBack
()
await
page
.
waitFor
(
1000
);
await
page
.
setData
({
focusedForKeyboardHeightChangeTest
:
true
})
await
page
.
waitFor
(
500
);
const
keyboardHeight
=
await
page
.
data
(
'
keyboardHeight
'
);
console
.
log
(
"
keyboardHeight :
"
,
keyboardHeight
);
expect
(
keyboardHeight
).
toBeGreaterThan
(
25
)
//reset
await
page
.
setData
({
focusedForKeyboardHeightChangeTest
:
false
,
keyboardHeight
:
0
})
})
it
(
"
afterAllTestScreenshot
"
,
async
()
=>
{
it
(
"
afterAllTestScreenshot
"
,
async
()
=>
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
...
...
pages/component/input/input.uvue
浏览文件 @
eb6cb318
...
@@ -213,7 +213,7 @@
...
@@ -213,7 +213,7 @@
v-if="keyboardHeightChangeEventDetail">{{keyboardHeightChangeEventDetail}}</text>
v-if="keyboardHeightChangeEventDetail">{{keyboardHeightChangeEventDetail}}</text>
</view>
</view>
<view class="input-wrapper">
<view class="input-wrapper">
<input class="uni-input" @keyboardheightchange="onKeyborardHeightChange" />
<input class="uni-input" @keyboardheightchange="onKeyborardHeightChange"
:focus="focusedForKeyboardHeightChangeTest"
/>
</view>
</view>
</view>
</view>
...
@@ -270,6 +270,8 @@
...
@@ -270,6 +270,8 @@
inputPasswordValue: "cipher",
inputPasswordValue: "cipher",
inputFocusKeyBoardChangeValue: true,
inputFocusKeyBoardChangeValue: true,
holdKeyboard: false,
holdKeyboard: false,
keyboardHeight: 0,
focusedForKeyboardHeightChangeTest: false,
}
}
},
},
methods: {
methods: {
...
@@ -328,6 +330,7 @@
...
@@ -328,6 +330,7 @@
onKeyborardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {
onKeyborardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {
console.log("键盘高度发生变化", JSON.stringify(event.detail));
console.log("键盘高度发生变化", JSON.stringify(event.detail));
this.keyboardHeightChangeEventDetail = JSON.stringify(event.detail);
this.keyboardHeightChangeEventDetail = JSON.stringify(event.detail);
this.keyboardHeight = event.detail.height;
},
},
test_check_input_value() : number {
test_check_input_value() : number {
return this.onMaxLengthInputValue.length
return this.onMaxLengthInputValue.length
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录