提交 1be31cee 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新text示例和自动化测试用例

上级 67326bd4
......@@ -13,12 +13,25 @@ describe('text-props', () => {
})
it('empty text', async () => {
await page.setData({
autoTest: true
})
const element = await page.$('#empty-text')
if (element != null) {
const { width, height } = await element.size()
expect(width).toBe(0)
expect(height).toBe(0)
}
page.callMethod("setTextEmpty")
const element2 = await page.$('#empty-text2')
if (element2 != null) {
const { width, height } = await element2.size()
expect(width).toBe(0)
expect(height).toBe(0)
}
await page.setData({
autoTest: false
})
})
if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
......
......@@ -96,10 +96,12 @@
<text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text>
</view>
<view class="uni-row">
<view class="uni-row" v-if="autoTest">
<text id="empty-text"></text>
</view>
<view class="uni-row" v-if="autoTest">
<text id="empty-text2" ref="empty-text2">test</text>
</view>
</view>
</scroll-view>
</template>
......@@ -112,12 +114,17 @@ export default {
multiLineText:
'HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言;HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言',
singleLineText: 'uni-app x,终极跨平台方案',
// 自动化测试
autoTest: false
}
},
methods: {
// 自动化测试
setTextNested() {
(this.$refs["text-nested"] as UniTextElement).value = "二级节点文字红色且背景色黄色";
(this.$refs["text-nested"] as UniElement).setAttribute("value", "二级节点文字红色且背景色黄色");
},
setTextEmpty() {
(this.$refs["empty-text2"] as UniElement).setAttribute("value", "");
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册