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

更新font-family示例和自动化测试用例

上级 78ac8b68
// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('css-font-family-icon', () => {
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase();
const isMP = platformInfo.startsWith('mp');
const isWeb = platformInfo.startsWith('web');
let page;
if (isWeb || isMP || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
it('other platform', () => {
expect(1).toBe(1);
});
return;
}
beforeAll(async () => {
page = await program.reLaunch('/pages/CSS/text/font-family-icon');
await page.waitFor(1000);
});
it('screenshot', async () => {
const image = await program.screenshot({
fullPage: true
});
expect(image).toSaveImageSnapshot();
});
it('screenshot after changeStyle', async () => {
await page.callMethod('changeStyle');
await page.waitFor(500);
const image = await program.screenshot({
fullPage: true
});
expect(image).toSaveImageSnapshot();
});
});
......@@ -5,7 +5,7 @@
<view style="align-items: center;align-self: center;">
<view class="iconContainer">
<view class="iconItem" v-for="item in uniIcons">
<text class="icon">{{String.fromCharCode(parseInt(item.code,16))}}</text>
<text class="icon" :style="{'font-weight': fontWeight, 'font-style': fontStyle}">{{String.fromCharCode(parseInt(item.code,16))}}</text>
<text class="code">\u{{item.code}}</text>
<text class="name">{{item.name}}</text>
</view>
......@@ -106,8 +106,18 @@
'name':'search',
'code':'EA23',
}
] as Icon[],
] as Icon[],
// 自动化测试
fontWeight: 'normal',
fontStyle: 'normal'
}
},
methods: {
// 自动化测试
changeStyle() {
this.fontWeight = 'bold';
this.fontStyle = 'italic';
}
}
}
</script>
......
......@@ -307,8 +307,7 @@ if (isApp && !isAppWebview) {
'/pages/API/request-payment/request-payment',
'/pages/API/theme-change/theme-change',
'/pages/API/share-with-system/share-with-system',
'/pages/template/scroll-sticky/scroll-sticky',
'/pages/CSS/text/font-family-icon',
'/pages/template/scroll-sticky/scroll-sticky'
)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册