diff --git a/pages/CSS/background/background-image.test.js b/pages/CSS/background/background-image.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..2ed0a6c4f3a9a440deb058dff8126f0f6dcdb556
--- /dev/null
+++ b/pages/CSS/background/background-image.test.js
@@ -0,0 +1,21 @@
+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();
+ });
+});
diff --git a/pages/CSS/background/background-image.uvue b/pages/CSS/background/background-image.uvue
index bad58e8deaee7d6bd605064600287f821f1c21fc..c2a2a785b37d9ba354f39c80b3dfa97573a3f52b 100644
--- a/pages/CSS/background/background-image.uvue
+++ b/pages/CSS/background/background-image.uvue
@@ -6,7 +6,7 @@
不支持背景图片,仅支持linear-gradient方法
background-image: linear-gradient({{direction}}, red, yellow)
-
+
@@ -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
+ }
}
}
diff --git a/pages/pages.test.js b/pages/pages.test.js
index 1b1b1d75c2ae26dc4abbc6f6db811a457ec9e6b5..563f1850b4e15b08a7226e56c3f83062368cf958 100755
--- a/pages/pages.test.js
+++ b/pages/pages.test.js
@@ -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',