page-scroll-to.test.js 781 字节
Newer Older
1
const PAGE_PATH = '/pages/API/page-scroll-to/page-scroll-to'
H
hdx 已提交
2

3
describe('page-scroll-to', () => {
H
hdx 已提交
4 5 6 7 8 9
  let page
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH)
    await page.waitFor(500)
  })
  // TODO
10
  it('scroll-to', async () => {
11
    const btnScrollTo = await page.$('.btn-scrollTo')
H
hdx 已提交
12

13 14 15 16 17
    await btnScrollTo.tap()
    await page.waitFor(50)
    // const scrollTop = await page.scrollTop()
    // expect(scrollTop).toBe(100)
  })
18
  // it('scroll-to-element', async () => {
H
hdx 已提交
19 20 21 22 23 24 25 26 27
  //   const btnScrollTo = await page.$('.btn-scrollToElement')
  //   const scrollToElement = await page.$('.custom-element')

  //   await btnScrollTo.tap()
  //   await page.waitFor(50)
  //   const offset = await scrollToElement.offset()
  //   expect(offset.top).toBe(0)
  // })
})