提交 cee77e24 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

添加测试例

上级 b3029f21
...@@ -7,7 +7,12 @@ describe('set-page-backgroundColorContent', () => { ...@@ -7,7 +7,12 @@ describe('set-page-backgroundColorContent', () => {
it('check_backgroundColorContent_red', async () => { it('check_backgroundColorContent_red', async () => {
await page.callMethod('changeColor', "") await page.callMethod('changeColor', "")
page.waitFor(100) page.waitFor(200)
const color = (await page.data()).currentBackgroundColorContent
expect(color).toBe("red")
const image = await program.screenshot({fullPage: true}); const image = await program.screenshot({fullPage: true});
expect(image).toSaveImageSnapshot(); expect(image).toSaveImageSnapshot();
}) })
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
export default { export default {
data() { data() {
return { return {
isChange : false isChange : false,
currentBackgroundColorContent: ""
} }
}, },
methods: { methods: {
...@@ -17,6 +18,11 @@ ...@@ -17,6 +18,11 @@
let page = pages[pages.length - 1] let page = pages[pages.length - 1]
page.$setPageStyle({"backgroundColorContent" : this.isChange ? "" : "red"}) page.$setPageStyle({"backgroundColorContent" : this.isChange ? "" : "red"})
this.isChange = !this.isChange this.isChange = !this.isChange
let pageJson = page.$getPageStyle()
this.currentBackgroundColorContent = pageJson.backgroundColorContent
console.log(this.currentBackgroundColorContent)
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册