提交 9e31c08f 编写于 作者: H hdx

fix(page-style): 自动化测试无法获取变量的问题

上级 3b9850b7
...@@ -23,27 +23,22 @@ describe('getCurrentPages', () => { ...@@ -23,27 +23,22 @@ describe('getCurrentPages', () => {
await page.waitFor(200) await page.waitFor(200)
const data = await page.data() const data = await page.data()
expect(data.checked).toBe(true) expect(data.checked).toBe(true)
}) })
it('getPageStyle', async () => { it('page-style', async () => {
const btn = await page.$('.btn-get-page-style') page = await program.navigateTo(PAGE_PATH)
await btn.tap()
await page.waitFor(100) await page.callMethod('getPageStyle')
await page.waitFor(200)
const { const isEnablePullDownRefresh1 = (await page.data()).currentPageStyle.enablePullDownRefresh
currentPageStyle expect(isEnablePullDownRefresh1).toBe(true)
} = await page.data()
// setPageStyle
expect(currentPageStyle['enablePullDownRefresh']).toBe(true) await page.callMethod('setPageStyle', false)
}) await page.waitFor(200)
it('setPageStyle', async () => {
const btn = await page.$('.btn-set-page-style-0') await page.callMethod('getPageStyle')
await btn.tap() await page.waitFor(200)
await page.waitFor(100) const isEnablePullDownRefresh2 = (await page.data()).currentPageStyle.enablePullDownRefresh
expect(isEnablePullDownRefresh2).toBe(false)
const {
currentPageStyle
} = await page.data()
expect(currentPageStyle['enablePullDownRefresh']).toBe(false)
}) })
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册