提交 505690a6 编写于 作者: shutao-dc's avatar shutao-dc

补充checkUniButtonElement自动化测试例

上级 6a1931f4
...@@ -77,4 +77,9 @@ describe('Button.uvue', () => { ...@@ -77,4 +77,9 @@ describe('Button.uvue', () => {
const newValue2 = await btn.property('disabled') const newValue2 = await btn.property('disabled')
expect(newValue2.toString()).toBe(true + '') expect(newValue2.toString()).toBe(true + '')
}) })
it(checkUniButtonElement, async () => {
const value = await page.callMethod('checkUniButtonElement')
expect(value).toBe(true)
})
}) })
...@@ -36,13 +36,21 @@ ...@@ -36,13 +36,21 @@
url: 'buttonstatus', url: 'buttonstatus',
}) })
}, },
//用于自动化测试
checkUniButtonElement(): boolean {
const button = uni.getElementById("testButton")
if(button != null && button instanceof UniButtonElement) {
return true
}
return false
}
} }
} }
</script> </script>
<template> <template>
<view class="main"> <view class="main">
<button :disabled="disabled_boolean" :size="size_enum[size_enum_current].name" <button id="testButton" :disabled="disabled_boolean" :size="size_enum[size_enum_current].name"
:type="type_enum[type_enum_current].name" :plain="plain_boolean" @click="button_click" :type="type_enum[type_enum_current].name" :plain="plain_boolean" @click="button_click"
@touchstart="button_touchstart" @touchmove="button_touchmove" @touchcancel="button_touchcancel" @touchstart="button_touchstart" @touchmove="button_touchmove" @touchcancel="button_touchcancel"
@touchend="button_touchend" @tap="button_tap" @longpress="button_longpress" class="btn" @touchend="button_touchend" @tap="button_tap" @longpress="button_longpress" class="btn"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册