提交 03fdc43e 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

feat: input增加maxlength默认值 自动化测试例

上级 50790911
......@@ -147,6 +147,22 @@ describe('component-native-input', () => {
expect(await (await page.$('#uni-input-cursor-color')).attribute("cursor-color")).toBe("red")
})
it("maxlength default", async () => {
const input = await page.$('#uni-input-disable');
let str = "";
for(let i = 0;i < 200;i++){
str += `${i}`
}
await page.setData({
disableValue: str
})
let length = (await input.attribute("value")).length
expect(length).toBe(140)
await page.setData({
disableValue: ""
})
})
it("afterAllTestScreenshot", async () => {
const image = await program.screenshot({
fullPage: true
......
......@@ -59,7 +59,7 @@
<text class="uni-title-text">设置禁用输入框</text>
</view>
<view class="input-wrapper">
<input id="uni-input-disable" class="uni-input" :disabled="true" />
<input id="uni-input-disable" class="uni-input" :disabled="true" :value="disableValue"/>
</view>
</view>
......@@ -265,7 +265,8 @@
inputMaxLengthFocus: false,
inputPasswordValue: "",
inputFocusKeyBoardChangeValue: true,
holdKeyboard: false
holdKeyboard: false,
disableValue: ""
}
},
methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册