diff --git a/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.test.js b/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.test.js index 74a4c5f6f2af0700a5590befb68af464e7587ca5..6a33bdda881a805964e45a4aee230b2afa88b9cb 100644 --- a/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.test.js +++ b/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.test.js @@ -7,7 +7,12 @@ describe('set-page-backgroundColorContent', () => { it('check_backgroundColorContent_red', async () => { 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}); expect(image).toSaveImageSnapshot(); }) diff --git a/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue b/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue index a04d25ebe4a8f5d98f7386df7f077349f1608e91..889e173ad37297b39a4f04c877c8000cc7054d8a 100644 --- a/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue +++ b/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue @@ -8,7 +8,8 @@ export default { data() { return { - isChange : false + isChange : false, + currentBackgroundColorContent: "" } }, methods: { @@ -17,6 +18,11 @@ let page = pages[pages.length - 1] page.$setPageStyle({"backgroundColorContent" : this.isChange ? "" : "red"}) this.isChange = !this.isChange + + let pageJson = page.$getPageStyle() + this.currentBackgroundColorContent = pageJson.backgroundColorContent + + console.log(this.currentBackgroundColorContent) } } }