From a71eac3a353e7f6d315fd0717b581382f6202da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A3=8A?= <1633537611@qq.com> Date: Tue, 28 May 2024 20:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85transform=E5=92=8Ctransition?= =?UTF-8?q?=E6=88=AA=E5=9B=BE=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/CSS/transform/rotate.test.js | 16 +++++++++++++ pages/CSS/transform/scale.test.js | 16 +++++++++++++ pages/CSS/transform/translate.test.js | 16 +++++++++++++ pages/CSS/transition/transition.test.js | 31 +++++++++++++++++++++++++ pages/pages.test.js | 2 +- 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 pages/CSS/transform/rotate.test.js create mode 100644 pages/CSS/transform/scale.test.js create mode 100644 pages/CSS/transform/translate.test.js create mode 100644 pages/CSS/transition/transition.test.js diff --git a/pages/CSS/transform/rotate.test.js b/pages/CSS/transform/rotate.test.js new file mode 100644 index 00000000..7a1a5960 --- /dev/null +++ b/pages/CSS/transform/rotate.test.js @@ -0,0 +1,16 @@ +// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('/pages/CSS/transform/rotate.uvue', () => { + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/CSS/transform/rotate') + await page.waitFor(1000); + }); + + it("snap rotate", async () => { + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toSaveImageSnapshot() + }) +}); diff --git a/pages/CSS/transform/scale.test.js b/pages/CSS/transform/scale.test.js new file mode 100644 index 00000000..b3de428e --- /dev/null +++ b/pages/CSS/transform/scale.test.js @@ -0,0 +1,16 @@ +// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('/pages/CSS/transform/scale.uvue', () => { + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/CSS/transform/scale') + await page.waitFor(1000); + }); + + it("snap scale", async () => { + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toSaveImageSnapshot() + }) +}); diff --git a/pages/CSS/transform/translate.test.js b/pages/CSS/transform/translate.test.js new file mode 100644 index 00000000..a9d2ffd9 --- /dev/null +++ b/pages/CSS/transform/translate.test.js @@ -0,0 +1,16 @@ +// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('/pages/CSS/transform/translate.uvue', () => { + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/CSS/transform/translate') + await page.waitFor(1000); + }); + + it("snap translate", async () => { + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toSaveImageSnapshot() + }) +}); diff --git a/pages/CSS/transition/transition.test.js b/pages/CSS/transition/transition.test.js new file mode 100644 index 00000000..65ca9ae8 --- /dev/null +++ b/pages/CSS/transition/transition.test.js @@ -0,0 +1,31 @@ +// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('/pages/CSS/transition/transition.uvue', () => { + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/CSS/transition/transition') + await page.waitFor(2000); + }); + + it("snap transition finish", async () => { + await page.callMethod('changeWidthOrHeight') + await page.callMethod('changeWidthProgress') + await page.callMethod('changeMargin') + await page.callMethod('changePadding') + await page.callMethod('changeBackground') + await page.callMethod('changeBackground2') + await page.callMethod('changeStyleOpacity') + await page.callMethod('propertyChangeBackground') + await page.callMethod('changeTransform') + await page.callMethod('changeTransformTranslate') + await page.callMethod('changeTransformWithWidth') + await page.callMethod('changeTransformWithOrigin') + await page.callMethod('changeBorder') + await page.callMethod('changestylePosition') + await page.waitFor(3000) + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toSaveImageSnapshot() + }) +}); diff --git a/pages/pages.test.js b/pages/pages.test.js index 289793c1..5e8d19db 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -91,7 +91,7 @@ const pages = [ '/pages/CSS/transform/rotate', '/pages/CSS/transform/scale', '/pages/CSS/transform/translate', - // '/pages/CSS/transition/transition', + '/pages/CSS/transition/transition', '/pages/CSS/pointer-events/pointer-events', // tabBar //改动频繁,不再测试 -- GitLab