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

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

上级 1ab11e66
describe('css-font-size', () => {
let page;
beforeAll(async () => {
page = await program.reLaunch('/pages/CSS/text/font-size');
});
it('screenshot', async () => {
await page.callMethod("setFontSize");
await page.waitFor(100);
const image = await program.screenshot({ fullPage: true });
expect(image).toMatchImageSnapshot();
});
});
<template>
<view style="flex-grow: 1;">
<view style="height: 250px;background-color: gray;justify-content: center;align-items: center;">
<text style="font-size: 15px;">font-size: 15px</text>
<text ref="text" style="font-size: 15px;">{{fontSize}}</text>
<text style="font-size: 30px;">font-size: 30px</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
fontSize: 'font-size: 15px'
}
},
methods: {
// 自动化测试
setFontSize() {
this.fontSize = 'font-size: 30px';
(this.$refs['text'] as UniElement).style.setProperty('font-size', '30px');
}
}
}
</script>
<style>
</style>
\ No newline at end of file
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册