提交 022544f6 编写于 作者: W WOSHIMAHAIFENG

Merge branch 'dev' of https://gitcode.net/dcloud/hello-uni-app-x into dev-wx

...@@ -13,12 +13,25 @@ describe('text-props', () => { ...@@ -13,12 +13,25 @@ describe('text-props', () => {
}) })
it('empty text', async () => { it('empty text', async () => {
await page.setData({
autoTest: true
})
const element = await page.$('#empty-text') const element = await page.$('#empty-text')
if (element != null) { if (element != null) {
const { width, height } = await element.size() const { width, height } = await element.size()
expect(width).toBe(0) expect(width).toBe(0)
expect(height).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) { if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
......
...@@ -96,10 +96,12 @@ ...@@ -96,10 +96,12 @@
<text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text> <text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text>
</view> </view>
<view class="uni-row"> <view class="uni-row" v-if="autoTest">
<text id="empty-text"></text> <text id="empty-text"></text>
</view> </view>
<view class="uni-row" v-if="autoTest">
<text id="empty-text2" ref="empty-text2">test</text>
</view>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
...@@ -112,12 +114,17 @@ export default { ...@@ -112,12 +114,17 @@ export default {
multiLineText: multiLineText:
'HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言;HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言', 'HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言;HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言',
singleLineText: 'uni-app x,终极跨平台方案', singleLineText: 'uni-app x,终极跨平台方案',
// 自动化测试
autoTest: false
} }
}, },
methods: { methods: {
// 自动化测试 // 自动化测试
setTextNested() { 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.
先完成此消息的编辑!
想要评论请 注册