diff --git a/pages/API/action-sheet/action-sheet.test.js b/pages/API/action-sheet/action-sheet.test.js index 0d32a1333759d9f0d3bb30b589b54cce9e10554b..056865cd4995c07770f9c6c39ef4d4cb7c867762 100644 --- a/pages/API/action-sheet/action-sheet.test.js +++ b/pages/API/action-sheet/action-sheet.test.js @@ -27,13 +27,13 @@ describe('API-loading', () => { }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -67,13 +67,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -109,13 +109,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -150,13 +150,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -191,13 +191,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -232,13 +232,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -276,13 +276,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -317,13 +317,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -358,13 +358,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -399,13 +399,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -441,13 +441,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -482,13 +482,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } @@ -523,13 +523,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) diff --git a/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.test.js b/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.test.js index c8126a1988b19af4e557399a2f0193c4fb547cd9..e0ec97bea0f0baca88f0232822506fbec7bfe864 100644 --- a/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.test.js +++ b/pages/API/get-element-by-id/get-element-by-id-multiple-root-node.test.js @@ -2,7 +2,7 @@ const PAGE_PATH = "/pages/API/get-element-by-id/get-element-by-id-multiple-root-node"; let page; -describe("getElementByIdForMultipleRootNode", () => { +describe("getElementByIdForMultipleRootNode", () => { beforeAll(async () => { page = await program.reLaunch(PAGE_PATH); await page.waitFor('view'); @@ -17,6 +17,6 @@ describe("getElementByIdForMultipleRootNode", () => { await page.callMethod("changeViewStyle"); await page.waitFor(500); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); -}); +}); diff --git a/pages/API/get-element-by-id/get-element-by-id.test.js b/pages/API/get-element-by-id/get-element-by-id.test.js index a04f1b1ded90c1768b20e19bb357570782d5d6be..3f7933f331a37b6e878eca853e87f138076bfd79 100644 --- a/pages/API/get-element-by-id/get-element-by-id.test.js +++ b/pages/API/get-element-by-id/get-element-by-id.test.js @@ -16,6 +16,6 @@ describe("getElementById", () => { await page.callMethod("changeViewStyle"); await page.waitFor(500); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/API/load-font-face/load-font-face.test.js b/pages/API/load-font-face/load-font-face.test.js index 928c0391586a6e15dbdd74729fff40474b6c714b..0f78bfb92bfb02221f843deb72d50e5de06ca044 100644 --- a/pages/API/load-font-face/load-font-face.test.js +++ b/pages/API/load-font-face/load-font-face.test.js @@ -8,12 +8,12 @@ describe("loadFontFace", () => { }); it("parent screenshot", async () => { const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); it("child screenshot", async () => { const page = await program.navigateTo(CHILD_PAGE_PATH); await page.waitFor(3000); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/API/modal/modal.test.js b/pages/API/modal/modal.test.js index 8f278b74ec9eda724390fad3f50eb6487a4f1b7a..b7f7af265ce7049a093a5cf6a0645c44d8270d9a 100644 --- a/pages/API/modal/modal.test.js +++ b/pages/API/modal/modal.test.js @@ -28,13 +28,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -68,13 +68,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -109,13 +109,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -150,13 +150,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -191,13 +191,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -231,13 +231,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -271,13 +271,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -311,13 +311,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -351,13 +351,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -392,13 +392,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -433,13 +433,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -474,13 +474,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -515,13 +515,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -556,13 +556,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -597,13 +597,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -638,13 +638,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -679,13 +679,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -719,13 +719,13 @@ describe('API-loading', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) diff --git a/pages/API/navigator/new-page/onLoad.test.js b/pages/API/navigator/new-page/onLoad.test.js index 6d83e3f237d1a9c632f87294d6683f6f002c5e19..124eb4b0ec0c945b462c24bb152a0a1b9581c104 100644 --- a/pages/API/navigator/new-page/onLoad.test.js +++ b/pages/API/navigator/new-page/onLoad.test.js @@ -11,7 +11,7 @@ describe("onLoad", () => { await page.callMethod("navigateToOnLoadWithType", "adjustData"); await page.waitFor(1000); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); it("navigateTo", async () => { page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); @@ -68,7 +68,7 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot({ + expect(image).toSaveImageSnapshot({ failureThreshold: 0.05, failureThresholdType: "percent", }); @@ -86,7 +86,7 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot({ + expect(image).toSaveImageSnapshot({ failureThreshold: 0.05, failureThresholdType: "percent", }); @@ -104,7 +104,7 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot({ + expect(image).toSaveImageSnapshot({ failureThreshold: 0.05, failureThresholdType: "percent", }); @@ -122,7 +122,7 @@ describe("onLoad", () => { height: 2140, }, }); - expect(image).toMatchImageSnapshot({ + expect(image).toSaveImageSnapshot({ failureThreshold: 0.05, failureThresholdType: "percent", }); diff --git a/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js b/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js index 455947abd9aad6a7f347f5d7d3ffa0726ecf6aa0..c4373a46bd674be18bcc7d5e6e609fd1ac511d1b 100644 --- a/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js +++ b/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js @@ -19,14 +19,14 @@ describe('setNavigationBarColor', () => { it("setNavigationBarColor1", async () => { await page.callMethod("setNavigationBarColor1"); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); const lifeCycleNum = await page.callMethod("getLifeCycleNum"); expect(lifeCycleNum - originLifeCycleNum).toBe(2); }); it("setNavigationBarColor2", async () => { await page.callMethod("setNavigationBarColor2"); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); const lifeCycleNum = await page.callMethod("getLifeCycleNum"); expect(lifeCycleNum - originLifeCycleNum).toBe(4); }); diff --git a/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js b/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js index 1694c811a1104dc9dfafe8ecab95930329c6a0ef..698bf80997c4b2de39513ff07af50a468c232f24 100644 --- a/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js +++ b/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js @@ -19,13 +19,13 @@ describe("setNavigationBarColor", () => { it("setNavigationBarNewTitle", async () => { await page.callMethod("setNavigationBarNewTitle"); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); const lifeCycleNum = await page.callMethod("getLifeCycleNum"); expect(lifeCycleNum - originLifeCycleNum).toBe(2); }); it("setNavigationBarLongTitle", async () => { await page.callMethod("setNavigationBarLongTitle"); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/API/toast/toast.test.js b/pages/API/toast/toast.test.js index 5164f86b6c0cf04bb388ec3c6350697079833b7b..00236da7d7c0a7a1a890bf5ceff0c64938cb83df 100644 --- a/pages/API/toast/toast.test.js +++ b/pages/API/toast/toast.test.js @@ -31,13 +31,13 @@ describe('API-toast', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -62,13 +62,13 @@ describe('API-toast', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -91,13 +91,13 @@ describe('API-toast', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -118,13 +118,13 @@ describe('API-toast', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -151,13 +151,13 @@ describe('API-toast', () => { width:windowWidth }, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }else{ const image = await program.screenshot({ deviceShot: true, fullPage: true }); - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() } }) @@ -178,13 +178,13 @@ describe('API-toast', () => { // width:windowWidth // }, // }); - // expect(image).toMatchImageSnapshot(); + // expect(image).toSaveImageSnapshot(); // }else{ // const image = await program.screenshot({ // deviceShot: true, // fullPage: true // }); - // expect(image).toMatchImageSnapshot() + // expect(image).toSaveImageSnapshot() // } // }) diff --git a/pages/CSS/overflow/overflow.test.js b/pages/CSS/overflow/overflow.test.js index dd7f5ae3af25bd068be88e78378a3b7e9f8a5755..9c5bb296cbd4a1ec419c94e326e032923e81b1ea 100644 --- a/pages/CSS/overflow/overflow.test.js +++ b/pages/CSS/overflow/overflow.test.js @@ -20,6 +20,6 @@ describe('component-native-overflow', () => { const image = await program.screenshot({ fullPage: true, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) }) diff --git a/pages/CSS/text/font-family.test.js b/pages/CSS/text/font-family.test.js index 34eee55eece42a3b50a267a45873c4ec0f98e394..06ec578e6cbccc4eb890a22acb204d8418f4592c 100644 --- a/pages/CSS/text/font-family.test.js +++ b/pages/CSS/text/font-family.test.js @@ -11,6 +11,6 @@ describe('css-font-family', () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }); }); diff --git a/pages/CSS/text/font-size.test.js b/pages/CSS/text/font-size.test.js index 90046beaf3b608cc8e656c6c33b254c7a2ff01ce..e20bd0cd0a755db09dd0d2f027c9bb9935c5426b 100644 --- a/pages/CSS/text/font-size.test.js +++ b/pages/CSS/text/font-size.test.js @@ -8,6 +8,6 @@ describe('css-font-size', () => { await page.callMethod("setFontSize"); await page.waitFor(100); const image = await program.screenshot({ fullPage: true }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/CSS/variable/variable.test.js b/pages/CSS/variable/variable.test.js index 5891aaa337067877caba1c636c4f4694f01823a3..e323f516a199c792223b1d0e8f49f04fc5771359 100644 --- a/pages/CSS/variable/variable.test.js +++ b/pages/CSS/variable/variable.test.js @@ -9,6 +9,6 @@ describe('css-variable', () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }); }); diff --git a/pages/component/general-attribute/general-attribute.test.js b/pages/component/general-attribute/general-attribute.test.js index 290b16a577a9149b69d37540c2f0e5075aeefc5a..0bce1aefc63377478d7d97135275292f8fda6b15 100644 --- a/pages/component/general-attribute/general-attribute.test.js +++ b/pages/component/general-attribute/general-attribute.test.js @@ -9,7 +9,7 @@ describe('general attribute', () => { }) it("class & style", async () => { const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); it('validateGeneralAttributes', async () => { const button = await page.$(".btn-style"); @@ -22,6 +22,6 @@ describe('general attribute', () => { await button.tap(); await page.waitFor(500); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }); }) diff --git a/pages/component/image/image.test.js b/pages/component/image/image.test.js index 03378d848e0a45d37fe205b06686e52e734f7401..b9535cc8abdbb911f7311d336e0c8e24064dcde8 100644 --- a/pages/component/image/image.test.js +++ b/pages/component/image/image.test.js @@ -55,7 +55,7 @@ describe('component-native-image', () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }); it('mode-screenshot', async () => { @@ -65,6 +65,6 @@ describe('component-native-image', () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }); }); diff --git a/pages/component/input/input.test.js b/pages/component/input/input.test.js index e7716c95c30991b50ccd28083bd89e88c7997fd8..e2b9cf87cbe73bf60d5bc46da5a29fa6d9162e38 100644 --- a/pages/component/input/input.test.js +++ b/pages/component/input/input.test.js @@ -12,7 +12,7 @@ describe('component-native-input', () => { // const image = await program.screenshot({ // fullPage: true // }) - // expect(image).toMatchImageSnapshot() + // expect(image).toSaveImageSnapshot() // }) // 测试焦点及键盘弹起 it('focus', async () => { @@ -176,6 +176,6 @@ describe('component-native-input', () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }) }); diff --git a/pages/component/list-view/list-view-multiplex.test.js b/pages/component/list-view/list-view-multiplex.test.js index dc065795463d9cca3ece54a83062fb0e3bf16d60..402f80bf5176c657da9308172237a156a05534a0 100644 --- a/pages/component/list-view/list-view-multiplex.test.js +++ b/pages/component/list-view/list-view-multiplex.test.js @@ -1,16 +1,16 @@ -describe('component-native-list-view', () => { - let page - beforeAll(async () => { - //打开list-view-multiplex测试页 - page = await program.reLaunch('/pages/component/list-view/list-view-multiplex') - await page.waitFor('list-view') - }) - - //滚动list-view到底部 加载更多 如果异常则直接闪退 - it('check_list_item_multiplex', async () => { - await page.callMethod('listViewScrollByY', 5000) - await page.waitFor(400) - await page.callMethod('listViewScrollByY', 100) +describe('component-native-list-view', () => { + let page + beforeAll(async () => { + //打开list-view-multiplex测试页 + page = await program.reLaunch('/pages/component/list-view/list-view-multiplex') + await page.waitFor('list-view') + }) + + //滚动list-view到底部 加载更多 如果异常则直接闪退 + it('check_list_item_multiplex', async () => { + await page.callMethod('listViewScrollByY', 5000) + await page.waitFor(400) + await page.callMethod('listViewScrollByY', 100) }) //检测延迟显示listv-view后list-item是否正常显示 @@ -21,7 +21,7 @@ describe('component-native-list-view', () => { }); await page.waitFor(200) const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) //检测修改item子元素后,item是否正常调整高度 @@ -32,6 +32,6 @@ describe('component-native-list-view', () => { }); await page.waitFor(600) const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); - }) + expect(image).toSaveImageSnapshot(); + }) }) diff --git a/pages/component/list-view/list-view-refresh.test.js b/pages/component/list-view/list-view-refresh.test.js index ff0a07ab4dc57e6a529d7d1df0d2c1ca9599ba72..146c00ab6c73746ee7b50fd00c6c4be2c7720648 100644 --- a/pages/component/list-view/list-view-refresh.test.js +++ b/pages/component/list-view/list-view-refresh.test.js @@ -1,15 +1,15 @@ describe('component-native-list-view-refresh', () => { if (process.env.uniTestPlatformInfo.startsWith('web')) { - it('dummyTest', async () => { - expect(1).toBe(1) + it('dummyTest', async () => { + expect(1).toBe(1) }) return - } - let page + } + let page beforeAll(async () => { - //打开list-view测试页 - page = await program.reLaunch('/pages/component/list-view/list-view-refresh') - await page.waitFor(600) + //打开list-view测试页 + page = await program.reLaunch('/pages/component/list-view/list-view-refresh') + await page.waitFor(600) }) it('check_list_view_refresh', async () => { @@ -19,6 +19,6 @@ describe('component-native-list-view-refresh', () => { //等待下拉刷新结束 await page.waitFor(500) const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); - }) + expect(image).toSaveImageSnapshot(); + }) }) diff --git a/pages/component/nested-scroll-body/nested-scroll-body.test.js b/pages/component/nested-scroll-body/nested-scroll-body.test.js index a3b80a3996cc6bd37319dc0526d126544c692fd1..f6f62db0c4e363707b6705b387795fde9430f287 100644 --- a/pages/component/nested-scroll-body/nested-scroll-body.test.js +++ b/pages/component/nested-scroll-body/nested-scroll-body.test.js @@ -1,16 +1,16 @@ describe('component-native-nested-scroll-body', () => { - if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { - it('dummyTest', () => { - expect(1).toBe(1) - }) - return + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { + it('dummyTest', () => { + expect(1).toBe(1) + }) + return } - - let page + + let page beforeAll(async () => { - //打开lnested-scroll-body测试页 - page = await program.reLaunch('/pages/component/nested-scroll-body/nested-scroll-body') - await page.waitFor(600) + //打开lnested-scroll-body测试页 + page = await program.reLaunch('/pages/component/nested-scroll-body/nested-scroll-body') + await page.waitFor(600) }) //检测横向scroll_into_view属性赋值 @@ -18,6 +18,6 @@ describe('component-native-nested-scroll-body', () => { await page.callMethod('testBodyScrollBy', 400) await page.waitFor(300) const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); - }) + expect(image).toSaveImageSnapshot(); + }) }) diff --git a/pages/component/nested-scroll-header/nested-scroll-header.test.js b/pages/component/nested-scroll-header/nested-scroll-header.test.js index c3982468b594d27ad017d73c52ac27432131adad..f8ce29762e90c97b306a0759af8e8a574bb48c0b 100644 --- a/pages/component/nested-scroll-header/nested-scroll-header.test.js +++ b/pages/component/nested-scroll-header/nested-scroll-header.test.js @@ -16,6 +16,6 @@ describe('component-native-nested-scroll-header', () => { it('check_nested-scroll-header', async () => { const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) -}) +}) diff --git a/pages/component/scroll-view/scroll-view-props.test.js b/pages/component/scroll-view/scroll-view-props.test.js index e4066d0f0af568e58598474e5aeedec85b462cd3..f124bd91b6f24ef86acec4cfc13df1464a6bd08b 100644 --- a/pages/component/scroll-view/scroll-view-props.test.js +++ b/pages/component/scroll-view/scroll-view-props.test.js @@ -90,7 +90,7 @@ describe('component-native-scroll-view-props', () => { }) await page.waitFor(300); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) }); diff --git a/pages/component/scroll-view/scroll-view-refresher.test.js b/pages/component/scroll-view/scroll-view-refresher.test.js index 2cb57d0b886adf6d794e73f0495581df0c1d17f2..07e550344764a4aad72df7d37708fdbb1250147f 100644 --- a/pages/component/scroll-view/scroll-view-refresher.test.js +++ b/pages/component/scroll-view/scroll-view-refresher.test.js @@ -15,7 +15,7 @@ describe('component-native-scroll-view-refresher', () => { }) await page.waitFor(300); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) it('check_refresher', async () => { diff --git a/pages/component/scroll-view/scroll-view.test.js b/pages/component/scroll-view/scroll-view.test.js index cc85304be14e4360d22e9f7f533a1254b1c4d57a..a2cdadded59d31ca76f3d837c359e3bbac835e5c 100644 --- a/pages/component/scroll-view/scroll-view.test.js +++ b/pages/component/scroll-view/scroll-view.test.js @@ -1,4 +1,4 @@ -describe('component-native-scroll-view', () => { +describe('component-native-scroll-view', () => { let page; beforeAll(async () => { page = await program.reLaunch('/pages/component/scroll-view/scroll-view'); @@ -13,6 +13,6 @@ describe('component-native-scroll-view', () => { }) await page.waitFor(300); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); - }); + expect(image).toSaveImageSnapshot(); + }); }); diff --git a/pages/component/sticky-header/sticky-header.test.js b/pages/component/sticky-header/sticky-header.test.js index 17e3d41a3e8b9d48fb3143388f530c977f22bd47..212f7f59b80b81e0a99fd31444b41e496cfbea28 100644 --- a/pages/component/sticky-header/sticky-header.test.js +++ b/pages/component/sticky-header/sticky-header.test.js @@ -9,6 +9,6 @@ describe('component-native-sticky-header', () => { it('check_sticky_header', async () => { await page.callMethod('confirm_scroll_top_input', 600) const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) -}) +}) diff --git a/pages/component/sticky-section/sticky-section.test.js b/pages/component/sticky-section/sticky-section.test.js index 720f93d24096afea249e6a33a0ccb03afb324e4c..8312b3b1f5c76d981cda315dcd70f4e7aa5e29a4 100644 --- a/pages/component/sticky-section/sticky-section.test.js +++ b/pages/component/sticky-section/sticky-section.test.js @@ -9,11 +9,11 @@ describe('component-native-sticky-section', () => { it('check_sticky_section', async () => { await page.callMethod('listViewScrollByY', 1000) const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); - }) - - if (process.env.uniTestPlatformInfo.startsWith('web')) { - return + expect(image).toSaveImageSnapshot(); + }) + + if (process.env.uniTestPlatformInfo.startsWith('web')) { + return } it('check_goto_sticky_header', async () => { @@ -31,6 +31,6 @@ describe('component-native-sticky-section', () => { return await page.data('scrolling') === false; }); const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); }) -}) +}) diff --git a/pages/component/text/text-props.test.js b/pages/component/text/text-props.test.js index 0b41c2c276eeb6677a31577ba84411b473786c0e..b98840ee86529863bce74e425a0099bd476106d2 100644 --- a/pages/component/text/text-props.test.js +++ b/pages/component/text/text-props.test.js @@ -9,7 +9,7 @@ describe('text-props', () => { it('screenshot', async () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }) it('empty text', async () => { diff --git a/pages/component/web-view-local/web-view-local.test.js b/pages/component/web-view-local/web-view-local.test.js index 37c9e2c2bdd327ba9186b8643e7b29f2d6c61872..bc1fdd29b2eacabf8191200e5d2afc791354a2f8 100644 --- a/pages/component/web-view-local/web-view-local.test.js +++ b/pages/component/web-view-local/web-view-local.test.js @@ -19,7 +19,7 @@ describe('component-native-web-view', () => { const image = await program.screenshot({ fullPage: true }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); } }); }); \ No newline at end of file diff --git a/pages/pages.test.js b/pages/pages.test.js index 3eff5ba91cc7ec66ac34673a4b6eb3fe28b80a7f..1b1b1d75c2ae26dc4abbc6f6db811a457ec9e6b5 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -169,10 +169,10 @@ describe("page screenshot test", () => { const image = await program.screenshot({ fullPage: fullPage }); - expect(image).toMatchImageSnapshot({ - customSnapshotIdentifier() { - return `__pages_test__/${pages[pageIndex].replace(/\//g, "-").substring(1)}` - } + expect(image).toSaveImageSnapshot({ + customSnapshotIdentifier() { + return `__pages_test__/${pages[pageIndex].replace(/\//g, "-").substring(1)}` + } }) await page.waitFor(500); }); diff --git a/pages/template/list-news/list-news.test.js b/pages/template/list-news/list-news.test.js index 78f6d5f5036450e6ee965254f158326779206cf4..045cd9ea3252d7ae9d33b3731cb80ff11b11ce72 100644 --- a/pages/template/list-news/list-news.test.js +++ b/pages/template/list-news/list-news.test.js @@ -11,6 +11,6 @@ describe('template-list-news', () => { const image = await program.screenshot({ fullPage: true }) - expect(image).toMatchImageSnapshot() + expect(image).toSaveImageSnapshot() }); }); diff --git a/pages/template/navbar-lite/navbar-lite.test.js b/pages/template/navbar-lite/navbar-lite.test.js index 5d7550015c6937f874da24e5ec4daf00f882f8e9..c5d678ccb8d22eea285c30fc47ff7c4302ca1cc0 100644 --- a/pages/template/navbar-lite/navbar-lite.test.js +++ b/pages/template/navbar-lite/navbar-lite.test.js @@ -40,7 +40,7 @@ describe("setCustomNavigationBarColor", () => { deviceShot: true, area: adbScreenShotArea, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); } const lifeCycleNum = await page.callMethod("getLifeCycleNum"); expect(lifeCycleNum - originLifeCycleNum).toBe(2); @@ -54,7 +54,7 @@ describe("setCustomNavigationBarColor", () => { deviceShot: true, area: adbScreenShotArea, }); - expect(image).toMatchImageSnapshot(); + expect(image).toSaveImageSnapshot(); } const lifeCycleNum = await page.callMethod("getLifeCycleNum"); expect(lifeCycleNum - originLifeCycleNum).toBe(4); diff --git a/pages/webview-screenshot/webview-screenshot.test.js b/pages/webview-screenshot/webview-screenshot.test.js index 061a80b54ac344525e6fc47251f734e04ea5d3e2..34d23bed25f23d20aae73e21a540bd8a2ea6b695 100644 --- a/pages/webview-screenshot/webview-screenshot.test.js +++ b/pages/webview-screenshot/webview-screenshot.test.js @@ -328,7 +328,7 @@ describe("shot-compare", () => { ...screenshotParams, offsetY: `${isCustomNavigation ? 0 : headerHeight}` }); - expect(webSnapshot).toMatchImageSnapshot({ + expect(webSnapshot).toSaveImageSnapshot({ customSnapshotIdentifier() { return screenshotPath; },