From 49d1183cbf9fc72bc22d162aba24ab509687d024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A3=8A?= <1633537611@qq.com> Date: Mon, 30 Oct 2023 12:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89placeholder=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BE=8B=EF=BC=8C=E6=94=B9=E7=94=A8=E6=88=AA=E5=B1=8F=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/input/input.test.js | 94 ++++++++++++++--------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/pages/component/input/input.test.js b/pages/component/input/input.test.js index 92f24a45..d419ddcc 100644 --- a/pages/component/input/input.test.js +++ b/pages/component/input/input.test.js @@ -73,50 +73,50 @@ describe('component-native-input', () => { // }) // }) // 测试placeholder - it("placeholder", async () => { - const placeholder1 = await page.$('.uni-input-placeholder1'); - expect(await placeholder1.property("placeholder-style")).toMatchObject({ - "color": "red" - }) - expect(await placeholder1.property("placeholder")).toEqual("占位符文字颜色为红色") - await page.setData({ - inputPlaceHolderStyle: "color:#CC00CC", - }) - expect(await placeholder1.property("placeholder-style")).toMatchObject({ - "color": "#CC00CC" - }) + // it("placeholder", async () => { + // const placeholder1 = await page.$('.uni-input-placeholder1'); + // expect(await placeholder1.property("placeholder-style")).toMatchObject({ + // "color": "red" + // }) + // expect(await placeholder1.property("placeholder")).toEqual("占位符文字颜色为红色") + // await page.setData({ + // inputPlaceHolderStyle: "color:#CC00CC", + // }) + // expect(await placeholder1.property("placeholder-style")).toMatchObject({ + // "color": "#CC00CC" + // }) - await page.setData({ - inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0", - }) - expect(await placeholder1.property("placeholder-style")).toMatchObject({ - "color": "#CC19CC", - "backgroundColor": "#00b1c0" - }) + // await page.setData({ + // inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0", + // }) + // expect(await placeholder1.property("placeholder-style")).toMatchObject({ + // "color": "#CC19CC", + // "backgroundColor": "#00b1c0" + // }) - await page.setData({ - inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0;text-align:center;font-size:44px;font-weight:900", - }) - expect(await placeholder1.property("placeholder-style")).toEqual({ - "backgroundColor": "#00b1c0", - "color": "#CC19CC", - "fontSize": "44px", - "fontWeight": "900", - "textAlign": "center" - }) + // await page.setData({ + // inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0;text-align:center;font-size:44px;font-weight:900", + // }) + // expect(await placeholder1.property("placeholder-style")).toEqual({ + // "backgroundColor": "#00b1c0", + // "color": "#CC19CC", + // "fontSize": "44px", + // "fontWeight": "900", + // "textAlign": "center" + // }) - const placeholder2 = await page.$('.uni-input-placeholder2'); - expect(await placeholder2.property("placeholder-class")).toMatchObject({ - "backgroundColor": "#008000" - }) - await page.setData({ - inputPlaceHolderClass: "uni-input-placeholder-class-ts", - }) - expect(await placeholder2.property("placeholder-class")).toMatchObject({ - "backgroundColor": "#FFA500" - }) - expect(await placeholder2.property("placeholder")).toEqual("占位符背景色为绿色") - }) + // const placeholder2 = await page.$('.uni-input-placeholder2'); + // expect(await placeholder2.property("placeholder-class")).toMatchObject({ + // "backgroundColor": "#008000" + // }) + // await page.setData({ + // inputPlaceHolderClass: "uni-input-placeholder-class-ts", + // }) + // expect(await placeholder2.property("placeholder-class")).toMatchObject({ + // "backgroundColor": "#FFA500" + // }) + // expect(await placeholder2.property("placeholder")).toEqual("占位符背景色为绿色") + // }) it("disable", async () => { const input = await page.$('.uni-input-disable'); @@ -139,10 +139,10 @@ describe('component-native-input', () => { // await page.waitFor(500) // }) - // it("afterAllTestScreenshot", async () => { - // const image = await program.screenshot({ - // fullPage: true - // }) - // expect(image).toMatchImageSnapshot() - // }) + it("afterAllTestScreenshot", async () => { + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toMatchImageSnapshot() + }) }); -- GitLab