提交 00836d0a 编写于 作者: Anne_LXM's avatar Anne_LXM

test(picker-view):某些测试例跳过APP_WEBVIEW测试

上级 5378a764
...@@ -85,49 +85,45 @@ describe('PickerView.uvue', () => { ...@@ -85,49 +85,45 @@ describe('PickerView.uvue', () => {
return return
} }
if (process.env.UNI_AUTOMATOR_APP_WEBVIEW) { if (process.env.UNI_AUTOMATOR_APP_WEBVIEW !== 'true') {
it('platform APP WEBVIEW', () => { it('mask-top-bottom-style', async () => {
expect(1).toBe(1) // App端动态设置mask-top-style、mask-bottom-style无效
const linearToTop = "background-image: linear-gradient(to bottom, #f4ff73, rgba(216, 229, 255, 0));"
const linearToBottom = "background-image: linear-gradient(to top, #f4ff73, rgba(216, 229, 255, 0));"
await page.setData({
maskTopStyle: linearToTop,
maskBottomStyle: linearToBottom,
})
await page.waitFor(500)
expect(await pickerViewEl.attribute('mask-top-style')).toBe(linearToTop)
expect(await pickerViewEl.attribute('mask-bottom-style')).toBe(linearToBottom)
await page.waitFor(2000)
await toScreenshot('picker-view-app-mask-top-bottom-style')
}) })
return
}
it('mask-top-bottom-style', async () => { it('reopen-picker-view-page', async () => {
// App端动态设置mask-top-style、mask-bottom-style无效 page = await program.switchTab('/pages/tabBar/component')
const linearToTop = "background-image: linear-gradient(to bottom, #f4ff73, rgba(216, 229, 255, 0));" await page.waitFor(500)
const linearToBottom = "background-image: linear-gradient(to top, #f4ff73, rgba(216, 229, 255, 0));" page = await program.navigateTo(PAGE_PATH)
await page.setData({ await page.waitFor(500)
maskTopStyle: linearToTop, const date = new Date()
maskBottomStyle: linearToBottom, const {
year,
month,
day
} = await page.data()
expect(year).toEqual(date.getFullYear())
expect(month).toEqual(date.getMonth() + 1)
expect(day).toEqual(date.getDate())
}) })
await page.waitFor(500)
expect(await pickerViewEl.attribute('mask-top-style')).toBe(linearToTop)
expect(await pickerViewEl.attribute('mask-bottom-style')).toBe(linearToBottom)
await page.waitFor(2000)
await toScreenshot('picker-view-app-mask-top-bottom-style')
})
it('reopen-picker-view-page', async () => { it('trigger UniPickerViewChangeEvent', async () => {
page = await program.switchTab('/pages/tabBar/component') await page.callMethod('setValue')
await page.waitFor(500) await page.waitFor(1500)
page = await program.navigateTo(PAGE_PATH) const eventCallbackNum = await page.callMethod('getEventCallbackNum')
await page.waitFor(500) // 3 times 3*3
const date = new Date() expect(eventCallbackNum).toBe(9)
const { })
year, }
month,
day
} = await page.data()
expect(year).toEqual(date.getFullYear())
expect(month).toEqual(date.getMonth() + 1)
expect(day).toEqual(date.getDate())
})
it('trigger UniPickerViewChangeEvent', async () => {
await page.callMethod('setValue')
await page.waitFor(1500)
const eventCallbackNum = await page.callMethod('getEventCallbackNum')
// 3 times 3*3
expect(eventCallbackNum).toBe(9)
})
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册