v-bind-style.test.js 874 字节
Newer Older
H
hdx 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
const PAGE_PATH = '/pages/directive/v-bind/v-bind-style'

describe('v-bind-style', () => {
  let page
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH)
    await page.waitFor(500)
  })
  it('basic', async () => {
    const text = await page.$('.text-font-size')
    const view = await page.$('.view-style')

    expect(await text.style('fontSize')).toBe('14px')
雪洛's avatar
雪洛 已提交
14 15 16 17 18
    if(process.env.uniTestPlatformInfo.startsWith('web')) {
      expect(await view.style('backgroundColor')).toBe('rgb(0, 128, 0)')
    } else {
      expect(await view.style('backgroundColor')).toBe('#008000')
    }
H
hdx 已提交
19
    expect(await view.style('borderWidth')).toBe('2px')
雪洛's avatar
雪洛 已提交
20 21 22 23 24
    if(process.env.uniTestPlatformInfo.startsWith('web')) {
      expect(await view.style('borderColor')).toBe('rgb(0, 0, 255)')
    } else {
      expect(await view.style('borderColor')).toBe('#0000FF')
    }
H
hdx 已提交
25 26
  })
})