提交 49d1183c 编写于 作者: 张磊

去掉placeholder测试例,改用截屏方式

上级 09a086d6
...@@ -73,50 +73,50 @@ describe('component-native-input', () => { ...@@ -73,50 +73,50 @@ describe('component-native-input', () => {
// }) // })
// }) // })
// 测试placeholder // 测试placeholder
it("placeholder", async () => { // it("placeholder", async () => {
const placeholder1 = await page.$('.uni-input-placeholder1'); // const placeholder1 = await page.$('.uni-input-placeholder1');
expect(await placeholder1.property("placeholder-style")).toMatchObject({ // expect(await placeholder1.property("placeholder-style")).toMatchObject({
"color": "red" // "color": "red"
}) // })
expect(await placeholder1.property("placeholder")).toEqual("占位符文字颜色为红色") // expect(await placeholder1.property("placeholder")).toEqual("占位符文字颜色为红色")
await page.setData({ // await page.setData({
inputPlaceHolderStyle: "color:#CC00CC", // inputPlaceHolderStyle: "color:#CC00CC",
}) // })
expect(await placeholder1.property("placeholder-style")).toMatchObject({ // expect(await placeholder1.property("placeholder-style")).toMatchObject({
"color": "#CC00CC" // "color": "#CC00CC"
}) // })
await page.setData({ // await page.setData({
inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0", // inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0",
}) // })
expect(await placeholder1.property("placeholder-style")).toMatchObject({ // expect(await placeholder1.property("placeholder-style")).toMatchObject({
"color": "#CC19CC", // "color": "#CC19CC",
"backgroundColor": "#00b1c0" // "backgroundColor": "#00b1c0"
}) // })
await page.setData({ // await page.setData({
inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0;text-align:center;font-size:44px;font-weight:900", // inputPlaceHolderStyle: "color:#CC19CC;background-color:#00b1c0;text-align:center;font-size:44px;font-weight:900",
}) // })
expect(await placeholder1.property("placeholder-style")).toEqual({ // expect(await placeholder1.property("placeholder-style")).toEqual({
"backgroundColor": "#00b1c0", // "backgroundColor": "#00b1c0",
"color": "#CC19CC", // "color": "#CC19CC",
"fontSize": "44px", // "fontSize": "44px",
"fontWeight": "900", // "fontWeight": "900",
"textAlign": "center" // "textAlign": "center"
}) // })
const placeholder2 = await page.$('.uni-input-placeholder2'); // const placeholder2 = await page.$('.uni-input-placeholder2');
expect(await placeholder2.property("placeholder-class")).toMatchObject({ // expect(await placeholder2.property("placeholder-class")).toMatchObject({
"backgroundColor": "#008000" // "backgroundColor": "#008000"
}) // })
await page.setData({ // await page.setData({
inputPlaceHolderClass: "uni-input-placeholder-class-ts", // inputPlaceHolderClass: "uni-input-placeholder-class-ts",
}) // })
expect(await placeholder2.property("placeholder-class")).toMatchObject({ // expect(await placeholder2.property("placeholder-class")).toMatchObject({
"backgroundColor": "#FFA500" // "backgroundColor": "#FFA500"
}) // })
expect(await placeholder2.property("placeholder")).toEqual("占位符背景色为绿色") // expect(await placeholder2.property("placeholder")).toEqual("占位符背景色为绿色")
}) // })
it("disable", async () => { it("disable", async () => {
const input = await page.$('.uni-input-disable'); const input = await page.$('.uni-input-disable');
...@@ -139,10 +139,10 @@ describe('component-native-input', () => { ...@@ -139,10 +139,10 @@ describe('component-native-input', () => {
// await page.waitFor(500) // await page.waitFor(500)
// }) // })
// it("afterAllTestScreenshot", async () => { it("afterAllTestScreenshot", async () => {
// const image = await program.screenshot({ const image = await program.screenshot({
// fullPage: true fullPage: true
// }) })
// expect(image).toMatchImageSnapshot() expect(image).toMatchImageSnapshot()
// }) })
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册