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

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

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