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 e0ec97bea0f0baca88f0232822506fbec7bfe864..daa1d2cf71356d75a22c90404fd7d4b8d99b3484 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 @@ -16,7 +16,7 @@ describe("getElementByIdForMultipleRootNode", () => { await page.callMethod("changeTextColor"); await page.callMethod("changeViewStyle"); await page.waitFor(500); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 3f7933f331a37b6e878eca853e87f138076bfd79..80cf91855ab6ccc2a00805ad20282b7b2c2780b6 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 @@ -15,7 +15,7 @@ describe("getElementById", () => { await page.callMethod("changeTextColor"); await page.callMethod("changeViewStyle"); await page.waitFor(500); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 0f78bfb92bfb02221f843deb72d50e5de06ca044..e0b3d124c70a8f005617fc6b26dae6d598cb7070 100644 --- a/pages/API/load-font-face/load-font-face.test.js +++ b/pages/API/load-font-face/load-font-face.test.js @@ -7,13 +7,13 @@ describe("loadFontFace", () => { await page.waitFor(4000); }); it("parent screenshot", async () => { - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); it("child screenshot", async () => { const page = await program.navigateTo(CHILD_PAGE_PATH); await page.waitFor(3000); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/API/navigator/new-page/onLoad.test.js b/pages/API/navigator/new-page/onLoad.test.js index 124eb4b0ec0c945b462c24bb152a0a1b9581c104..f2d2188fd723bd8c2c9675f53e39f47c4d8832b1 100644 --- a/pages/API/navigator/new-page/onLoad.test.js +++ b/pages/API/navigator/new-page/onLoad.test.js @@ -10,7 +10,7 @@ describe("onLoad", () => { await page.waitFor('view'); await page.callMethod("navigateToOnLoadWithType", "adjustData"); await page.waitFor(1000); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); it("navigateTo", async () => { diff --git a/pages/CSS/background/background-image.test.js b/pages/CSS/background/background-image.test.js index 2ed0a6c4f3a9a440deb058dff8126f0f6dcdb556..e2a60d208ff7518c64256f69df8c26e68bcbef84 100644 --- a/pages/CSS/background/background-image.test.js +++ b/pages/CSS/background/background-image.test.js @@ -8,14 +8,14 @@ describe('background-image-test', () => { it('background-image-screenshot', async () => { await page.waitFor(300); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); it('background-image-select', async () => { await page.callMethod('updateBackgroundSelect') await page.waitFor(300); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/component/general-attribute/general-attribute.test.js b/pages/component/general-attribute/general-attribute.test.js index 0bce1aefc63377478d7d97135275292f8fda6b15..9e5ec5df7dbe3d697fb8cf88f32aca5c5fa41b17 100644 --- a/pages/component/general-attribute/general-attribute.test.js +++ b/pages/component/general-attribute/general-attribute.test.js @@ -8,7 +8,7 @@ describe('general attribute', () => { await page.waitFor('view') }) it("class & style", async () => { - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); it('validateGeneralAttributes', async () => { @@ -21,7 +21,7 @@ describe('general attribute', () => { const button = await page.$(".btn-ref"); await button.tap(); await page.waitFor(500); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 402f80bf5176c657da9308172237a156a05534a0..ae8aded5ceeed5da253c5132bbd9124dd97c1222 100644 --- a/pages/component/list-view/list-view-multiplex.test.js +++ b/pages/component/list-view/list-view-multiplex.test.js @@ -20,7 +20,7 @@ describe('component-native-list-view', () => { return await page.data('list_show') === true; }); await page.waitFor(200) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }) @@ -31,7 +31,7 @@ describe('component-native-list-view', () => { return await page.data('displayArrow') === true; }); await page.waitFor(600) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 146c00ab6c73746ee7b50fd00c6c4be2c7720648..09699044e74e099aceae6688078d991b51cc9075 100644 --- a/pages/component/list-view/list-view-refresh.test.js +++ b/pages/component/list-view/list-view-refresh.test.js @@ -18,7 +18,7 @@ describe('component-native-list-view-refresh', () => { }); //等待下拉刷新结束 await page.waitFor(500) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 f6f62db0c4e363707b6705b387795fde9430f287..a39a235819ff936882d59fca73375d59063ac90a 100644 --- a/pages/component/nested-scroll-body/nested-scroll-body.test.js +++ b/pages/component/nested-scroll-body/nested-scroll-body.test.js @@ -17,7 +17,7 @@ describe('component-native-nested-scroll-body', () => { it('check_scroll_into_view_left', async () => { await page.callMethod('testBodyScrollBy', 400) await page.waitFor(300) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 f8ce29762e90c97b306a0759af8e8a574bb48c0b..d4eb2bb7855b9f7b39cb9a1bdc703b1f60cbb9c6 100644 --- a/pages/component/nested-scroll-header/nested-scroll-header.test.js +++ b/pages/component/nested-scroll-header/nested-scroll-header.test.js @@ -15,7 +15,7 @@ describe('component-native-nested-scroll-header', () => { it('check_nested-scroll-header', async () => { - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 f124bd91b6f24ef86acec4cfc13df1464a6bd08b..d54c3bd0c804632d8975f798174e23f94b2e41e2 100644 --- a/pages/component/scroll-view/scroll-view-props.test.js +++ b/pages/component/scroll-view/scroll-view-props.test.js @@ -89,7 +89,7 @@ describe('component-native-scroll-view-props', () => { showScrollbar: false }) await page.waitFor(300); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); 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 07e550344764a4aad72df7d37708fdbb1250147f..ee54b2e6399648983aa02e994cc40944f1791ca8 100644 --- a/pages/component/scroll-view/scroll-view-refresher.test.js +++ b/pages/component/scroll-view/scroll-view-refresher.test.js @@ -14,7 +14,7 @@ describe('component-native-scroll-view-refresher', () => { showScrollbar: false }) await page.waitFor(300); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }) diff --git a/pages/component/scroll-view/scroll-view.test.js b/pages/component/scroll-view/scroll-view.test.js index a2cdadded59d31ca76f3d837c359e3bbac835e5c..646710a3b99d130125bc171424850e4dfafc1305 100644 --- a/pages/component/scroll-view/scroll-view.test.js +++ b/pages/component/scroll-view/scroll-view.test.js @@ -12,7 +12,7 @@ describe('component-native-scroll-view', () => { showScrollbar: false }) await page.waitFor(300); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }); }); diff --git a/pages/component/sticky-header/sticky-header.test.js b/pages/component/sticky-header/sticky-header.test.js index 212f7f59b80b81e0a99fd31444b41e496cfbea28..2f56803ab812c0bbf02efc9542b177cee1a52895 100644 --- a/pages/component/sticky-header/sticky-header.test.js +++ b/pages/component/sticky-header/sticky-header.test.js @@ -8,7 +8,7 @@ describe('component-native-sticky-header', () => { //检测吸顶效果 it('check_sticky_header', async () => { await page.callMethod('confirm_scroll_top_input', 600) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }) }) diff --git a/pages/component/sticky-section/sticky-section.test.js b/pages/component/sticky-section/sticky-section.test.js index ca55a242871e3762f943c98f5375608f387ebd30..2e2d47be5a3505aa723444675a53f890478b7c33 100644 --- a/pages/component/sticky-section/sticky-section.test.js +++ b/pages/component/sticky-section/sticky-section.test.js @@ -8,7 +8,7 @@ describe('component-native-sticky-section', () => { //检测吸顶上推效果 it('check_sticky_section', async () => { await page.callMethod('listViewScrollByY', 1000) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }) @@ -30,7 +30,7 @@ describe('component-native-sticky-section', () => { await page.waitFor(async () => { return await page.data('scrolling') === false; }); - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }) }) diff --git a/pages/toSaveSnapshot-toSaveImageSnapshot-template.test1.js b/pages/toSaveSnapshot-toSaveImageSnapshot-template.test1.js index bfd7db8ce36a853b0080d65789801b290fec616b..17762981773cbe432d2322be1fdd35871a68a24f 100644 --- a/pages/toSaveSnapshot-toSaveImageSnapshot-template.test1.js +++ b/pages/toSaveSnapshot-toSaveImageSnapshot-template.test1.js @@ -29,15 +29,15 @@ describe('toSaveSnapshot & toSaveImageSnapshot template', () => { }) it('test toSaveImageSnapshot 1', async () => { - const img1 = await program.screenshot(); + const img1 = await program.screenshot({fullPage: true}); expect(img1).toSaveImageSnapshot() - const img2 = await program.screenshot(); + const img2 = await program.screenshot({fullPage: true}); expect(img2).toSaveImageSnapshot() }) it('test toSaveImageSnapshot 2', async () => { - const img1 = await program.screenshot(); + const img1 = await program.screenshot({fullPage: true}); expect(img1).toSaveImageSnapshot({ customSnapshotsDir: './customDir/__image_snapshots__', customSnapshotIdentifier() { @@ -45,16 +45,16 @@ describe('toSaveSnapshot & toSaveImageSnapshot template', () => { }, }) - const img2 = await program.screenshot(); + const img2 = await program.screenshot({fullPage: true}); expect(img2).toSaveImageSnapshot({ customSnapshotsDir: './customDir/__image_snapshots__', }) - const img3 = await program.screenshot(); + const img3 = await program.screenshot({fullPage: true}); expect(img3).toSaveImageSnapshot({ customSnapshotIdentifier() { return 'test-toSaveImageSnapshot-2-3'; }, }) }) -}); +});