dynamic-border.test.js 1.4 KB
Newer Older
1 2 3 4 5 6
describe('css-dynamic-border', () => {
  let page
  beforeAll(async () => {
    page = await program.reLaunch('/pages/CSS/border/dynamic-border')
    await page.waitFor(600);
  })
7

8 9
  // 左上、右上设置圆角
  it('check_topleft_topright', async () => {
10 11 12
    const image = await program.screenshot({
      fullPage: true
    });
13 14
    expect(image).toSaveImageSnapshot();
  })
15

16
  // 取消圆角
17
  it('check_none', async () => {
18
    await page.callMethod('changeIndex', 2)
19
    await page.waitFor(100)
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    const image = await program.screenshot({
      fullPage: true
    });
    expect(image).toSaveImageSnapshot();
  })

  // 左下,右下设置圆角
  it('check_bottomleft_bottomright', async () => {
    await page.callMethod('changeIndex', 10)
    await page.waitFor(100)
    const image = await program.screenshot({
      fullPage: true
    });
    expect(image).toSaveImageSnapshot();
  })

  it('动态切换为空值', async () => {
    await page.callMethod('setBorderBlank')
    await page.waitFor(100)
    const image = await program.screenshot({
      fullPage: true
    });
42
    expect(image).toSaveImageSnapshot();
43 44 45 46 47 48 49 50 51
  })
  it('动态切换空值为有值', async () => {
    await page.callMethod('setBorderBlank')
    await page.waitFor(100)
    const image = await program.screenshot({
      fullPage: true
    });
    expect(image).toSaveImageSnapshot();
  })
52

53
})