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

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

上级 fe609ed2
......@@ -22,7 +22,7 @@ describe('text-props', () => {
expect(width).toBe(0)
expect(height).toBe(0)
}
await page.callMethod("setTextEmpty")
await page.callMethod("setEmptyText")
await page.waitFor(100)
const element2 = await page.$('#empty-text2')
if (element2 != null) {
......@@ -35,15 +35,30 @@ describe('text-props', () => {
})
})
it('text nested', async () => {
it('nested text', async () => {
await page.setData({
autoTest: true
})
await page.callMethod("setTextNested")
await page.callMethod("setNestedText")
await page.waitFor(100)
const element = await page.$('#text-nested')
const element = await page.$('#nested-text')
if (element != null) {
expect(await element.text()).toBe("修改三级节点")
expect(await element.text()).toBe("修改三级节点文本")
}
await page.setData({
autoTest: false
})
})
it('height text', async () => {
await page.setData({
autoTest: true
})
await page.callMethod("setHeightText")
await page.waitFor(100)
const element = await page.$('#height-text')
if (element != null) {
expect(await element.text()).toBe("修改设置高度文本")
}
await page.setData({
autoTest: false
......
......@@ -104,12 +104,13 @@
<text id="empty-text2">{{emptyText}}</text>
</view>
<text
>一级节点
>一级节点文本
<text
>二级节点
<text id="text-nested">{{nestedText}}</text>
>二级节点文本
<text id="nested-text">{{nestedText}}</text>
</text>
</text>
<text id="height-text" style="height: 50px;">{{heightText}}</text>
</view>
</view>
</scroll-view>
......@@ -125,17 +126,21 @@ export default {
singleLineText: 'uni-app x,终极跨平台方案',
// 自动化测试
autoTest: false,
nestedText: '三级节点',
emptyText: 'empty'
nestedText: '三级节点文本',
emptyText: '空文本',
heightText: '设置高度文本'
}
},
methods: {
// 自动化测试
setTextNested() {
this.nestedText = "修改三级节点";
setNestedText() {
this.nestedText = "修改三级节点文本";
},
setTextEmpty() {
setEmptyText() {
this.emptyText = "";
},
setHeightText() {
this.heightText = "修改设置高度文本";
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册