nested-scroll-body.test.js 931 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isMP = platformInfo.startsWith('mp')

4
describe('component-native-nested-scroll-body', () => {
DCloud-WZF's avatar
DCloud-WZF 已提交
5 6 7 8 9 10 11
  if (isMP) {
  	it('skip mp', () => {
  		expect(1).toBe(1)
  	})
  	return
  }

12 13 14 15 16
  if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
    it('dummyTest', () => {
      expect(1).toBe(1)
    })
    return
17
  }
18 19

  let page
20
  beforeAll(async () => {
21 22 23
    //打开lnested-scroll-body测试页
    page = await program.reLaunch('/pages/component/nested-scroll-body/nested-scroll-body')
    await page.waitFor(600)
24 25 26 27 28 29
  })

  //检测横向scroll_into_view属性赋值
  it('check_scroll_into_view_left', async () => {
    await page.callMethod('testBodyScrollBy', 400)
    await page.waitFor(300)
30
    const image = await program.screenshot({fullPage: true});
31 32
    expect(image).toSaveImageSnapshot();
  })
33
})