diff --git a/pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js b/pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js index 36220b036dcd46a457f20fdba456c2cdc56ddca5..72aed05c060a04850c7f264a8e805cf0a4628191 100644 --- a/pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js +++ b/pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js @@ -192,12 +192,12 @@ const pages = [ // "pages/component/sticky-section/sticky-section", // pages/API/facial-recognition-verify/facial-recognition-verify // pages/API/get-file-system-manager/get-file-system-manager - // "pages/API/install-apk/install-apk", - // "pages/template/scroll-sticky/scroll-sticky", - // "pages/API/exit/exit", + // "pages/API/install-apk/install-apk", + // "pages/template/scroll-sticky/scroll-sticky", + // "pages/API/exit/exit", // "pages/API/element-takesnapshot/element-takesnapshot", - // 仅 web + // 仅 web // pages/template/browser-canvas/browser-canvas // pages/template/schema/schema // pages/template/share/share @@ -210,8 +210,8 @@ const childToParentPagesMap = new Map([ ]); const customNavigationPages = [ - "pages/template/navbar-lite/navbar-lite", - "pages/template/pull-zoom-image/pull-zoom-image", + "pages/template/navbar-lite/navbar-lite", + "pages/template/pull-zoom-image/pull-zoom-image", "pages/template/scroll-fold-nav/scroll-fold-nav" ] @@ -267,7 +267,7 @@ describe("shot-compare", () => { test.each(pages)("%s", async () => { const isNeedAdbScreenshot = needAdbScreenshot(pages[pageIndex]); - const isCustomNavigation = customNavigationPages.includes(pages[pageIndex]); + const isCustomNavigationBar = customNavigationPages.includes(pages[pageIndex]); const { headerHeight, devicePixelRatio @@ -299,7 +299,7 @@ describe("shot-compare", () => { await page.setData({ src: `${baseSrc}${pages[pageIndex]}`, isLoaded: false, - needRemoveWebHead: !isNeedAdbScreenshot, + isCustomNavigationBar, }); const startTime = Date.now(); @@ -315,7 +315,8 @@ describe("shot-compare", () => { // web 端非 adb 截图时设置 offsetY 移除导航栏 const webSnapshot = await program.screenshot({ ...screenshotParams, - offsetY: `${isCustomNavigation ? 0 : headerHeight}` + id: 'webview-screenshot-comparison', + offsetY: `${isCustomNavigationBar ? 0 : 44}` }); expect(webSnapshot).toMatchImageSnapshot({ customSnapshotIdentifier() { @@ -344,4 +345,4 @@ describe("shot-compare", () => { expect(1).toBe(1); }); } -}); +}); diff --git a/pages/webview-screenshot-comparison/webview-screenshot-comparison.uvue b/pages/webview-screenshot-comparison/webview-screenshot-comparison.uvue index c25418f7788b585cd8e51dd61b1036499153f3a8..bd9e698a5f13a6080f080bf1c583c3fa3302cb9e 100644 --- a/pages/webview-screenshot-comparison/webview-screenshot-comparison.uvue +++ b/pages/webview-screenshot-comparison/webview-screenshot-comparison.uvue @@ -1,4 +1,5 @@