提交 43956da4 编写于 作者: shutao-dc's avatar shutao-dc

添加background-image动态修改测试例

上级 082ca144
describe('background-image-test', () => {
let page;
beforeAll(async () => {
page = await program.reLaunch('/pages/CSS/background/background-image');
await page.waitFor(600);
});
it('background-image-screenshot', async () => {
await page.waitFor(300);
const image = await program.screenshot();
expect(image).toSaveImageSnapshot();
});
it('background-image-select', async () => {
await page.callMethod('updateBackgroundSelect')
await page.waitFor(300);
const image = await program.screenshot();
expect(image).toSaveImageSnapshot();
});
});
......@@ -6,7 +6,7 @@
<text>不支持背景图片,仅支持linear-gradient方法</text>
<view v-for="(direction) in directionData">
<text>background-image: linear-gradient({{direction}}, red, yellow)</text>
<view class="common" :style="{'background-image': 'linear-gradient('+direction+', red, yellow)'}"></view>
<view class="common" :style="{'background-image': backgroundSelect ?'linear-gradient('+direction+', red, yellow)':''}"></view>
</view>
</view>
<!-- #ifdef APP -->
......@@ -18,8 +18,15 @@
export default {
data(){
return {
backgroundSelect : true,
directionData: ['to right', 'to left', 'to bottom', 'to top', 'to bottom left', 'to bottom right', 'to top left', 'to top right']
}
},
methods: {
//供自动化测试使用
updateBackgroundSelect() {
this.backgroundSelect = !this.backgroundSelect
}
}
}
</script>
......
......@@ -38,7 +38,6 @@ const pages = [
// CSS
'/pages/CSS/background/background-color',
'/pages/CSS/background/background-image',
'/pages/CSS/border/complex-border/complex-border',
'/pages/CSS/border/border-bottom',
'/pages/CSS/border/border-color',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册