提交 723fe5a8 编写于 作者: H hdx

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

上级 d5293058
......@@ -24,26 +24,21 @@ describe('getCurrentPages', () => {
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()
it('page-style', async () => {
page = await program.navigateTo(PAGE_PATH)
expect(currentPageStyle['enablePullDownRefresh']).toBe(true)
})
it('setPageStyle', async () => {
const btn = await page.$('.btn-set-page-style-0')
await btn.tap()
await page.waitFor(100)
await page.callMethod('getPageStyle')
await page.waitFor(200)
const isEnablePullDownRefresh1 = (await page.data()).currentPageStyle.enablePullDownRefresh
expect(isEnablePullDownRefresh1).toBe(true)
const {
currentPageStyle
} = await page.data()
// setPageStyle
await page.callMethod('setPageStyle', false)
await page.waitFor(200)
expect(currentPageStyle['enablePullDownRefresh']).toBe(false)
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.
先完成此消息的编辑!
想要评论请 注册