slider-100.test.js 719 字节
Newer Older
H
hdx 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
const PAGE_PATH = '/pages/component/slider-100/slider-100'

describe('slider', () => {
  let page
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH)
    await page.waitFor(500)
  })
  it('value', async () => {
    const sliderValue = 80
    await page.setData({
      sliderValue: sliderValue,
    })
    await page.waitFor(100)

    // TODO 暂时仅获取第一个
    const slider1 = await page.$('.slider')
雪洛's avatar
雪洛 已提交
18
    expect(await slider1.attribute('value')).toBe(sliderValue)
H
hdx 已提交
19 20 21 22

    // const slider100 = await page.$$('.slider')
    // for (let i = 0; i < slider100.length; i++) {
    //   const slider = slider100[i];
雪洛's avatar
雪洛 已提交
23
    //   expect(await slider.attribute('value')).toBe(sliderValue)
H
hdx 已提交
24 25 26
    // }
  })
})