list.test.js 1.1 KB
Newer Older
Anne_LXM's avatar
Anne_LXM 已提交
1
describe('list', () => {
Anne_LXM's avatar
Anne_LXM 已提交
2
  let page, containsVite, isApp;
Anne_LXM's avatar
Anne_LXM 已提交
3 4 5 6 7 8 9 10 11
  containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite')
  isApp = process.env.UNI_PLATFORM.includes('app')
  if (containsVite && isApp) {
    it('vue3', async () => {
      expect(1).toBe(1)
    })
    return
  }
  beforeAll(async () => {
Anne_LXM's avatar
Anne_LXM 已提交
12
    page = await program.switchTab('/pages/list/list')
Anne_LXM's avatar
Anne_LXM 已提交
13 14 15 16 17 18 19 20 21 22 23 24
    await page.waitFor('view')
    await page.setData({
      'isTest': true
    })
  })
  it('检测标题', async () => {
    expect.assertions(1);
    await page.waitFor(5000)
    const getTitle = await page.data('dataList')
    console.log('getTitle: ', getTitle);
    expect(getTitle.title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务')
  })
Anne_LXM's avatar
Anne_LXM 已提交
25 26 27 28 29 30 31 32 33
  // it('点击搜索跳转详情页', async () => {
  //   const items = await page.$('.uni-list-item')
  //   await items.tap()
  //   await page.waitFor(3000)
  //   await page.waitFor('view')
  //   currentPage = await program.currentPage()
  //   console.log('currentPage: ', currentPage);
  //   expect(currentPage.path).toBe('pages/list/detail')
  // })
study夏羽's avatar
study夏羽 已提交
34
})