提交 2d75a04a 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 修复 firefox 测试兼容问题

上级 caaca366
const PAGE_PATH = '/pages/directive/v-bind/v-bind-style' const PAGE_PATH = '/pages/directive/v-bind/v-bind-style'
describe('v-bind-style', () => { describe('v-bind-style', () => {
const isFirefox = process.env.uniTestPlatformInfo.indexOf('firefox') > -1
let page let page
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
...@@ -16,9 +17,9 @@ describe('v-bind-style', () => { ...@@ -16,9 +17,9 @@ describe('v-bind-style', () => {
} else { } else {
expect(await view.style('backgroundColor')).toBe('#008000') expect(await view.style('backgroundColor')).toBe('#008000')
} }
expect(await view.style('borderWidth')).toBe('2px') expect(await view.style(isFirefox ? 'borderTopWidth' : 'borderWidth')).toBe('2px')
if(process.env.uniTestPlatformInfo.startsWith('web')) { if (process.env.uniTestPlatformInfo.startsWith('web')) {
expect(await view.style('borderColor')).toBe('rgb(0, 0, 255)') expect(await view.style(isFirefox ? 'borderTopColor' : 'borderColor')).toBe('rgb(0, 0, 255)')
} else { } else {
expect(await view.style('borderColor')).toBe('#0000FF') expect(await view.style('borderColor')).toBe('#0000FF')
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册