0.0.34 • Published 12 months ago

@mpflow/plugin-e2e-test v0.0.34

Weekly downloads
20
License
MIT
Repository
github
Last release
12 months ago

@mpflow/plugin-e2e-test

Mpflow 的 e2e 测试支持插件

说明

该插件用于给 Mpflow 的构架提供 e2e 测试功能的集成,使用 jest 为测试执行器,miniprogram-automator 为自动化执行器

e2e 测试代码请按照 ${name}.test.js 的命名形式,放置在项目的 tests/e2e/ 目录下

测试文件默认注入了一个全局 miniProgram 对象,可以直接操纵小程序开发者工具,使用方法请参考 miniprogram-automator 文档

安装

mpflow add e2e-test
# 或
mpflow add @mpflow/plugin-e2e-test

使用

在项目的 tests/e2e 文件夹下添加测试文件,如:

// page-index.test.js

describe('page index', () => {
  let page

  beforeAll(async () => {
    page = await miniProgram.reLaunch('/pages/index/index')
    await page.waitFor(500)
  }, 30 * 1000)

  test('wxml', async () => {
    const element = await page.$('page')
    expect(await element.wxml()).toMatchSnapshot()
  })
})

然后执行命令启动 e2e 测试

npm run test:e2e
# 或
yarn test:e2e

也可以通过 --coverage 参数来获取代码覆盖率报告

npm run test:e2e -- --coverage
# 或
yarn test:e2e --coverage
0.0.34

12 months ago

0.0.33

2 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.25

3 years ago

0.0.26

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago