scroll-view-refresher.test.js 1.0 KB
Newer Older
1 2
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/

3
describe('component-native-scroll-view-refresher', () => {
4
  if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
5 6 7 8 9
    let page;
    beforeAll(async () => {
      page = await program.reLaunch('/pages/component/scroll-view/scroll-view-refresher');
      await page.waitFor(300);
    });
10 11 12 13 14 15 16 17 18

    it('scroll-view-refresher-screenshot', async () => {
      //禁止滚动条
      await page.setData({
          showScrollbar: false
      })
      await page.waitFor(300);
      const image = await program.screenshot();
      expect(image).toMatchImageSnapshot();
19
    })
20 21 22 23 24 25 26 27 28 29 30 31 32

    it('check_refresher', async () => {
      await page.setData({
        refresherTriggered: true
      })
      await page.waitFor(2000);
      expect(await page.data('refresherrefresh')).toBe(true)
    });
  } else {
    it('other platform', () => {
      expect(1).toBe(1)
    })
  }
33
});