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

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

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