提交 b496f0a3 编写于 作者: H hdx

feat: v-show:: style screenshot

上级 3a97f79b
const PAGE_PATH = '/pages/v-slot/v-slot'
const PAGE_PATH = '/pages/v-show/v-show'
describe('v-slot', () => {
describe('v-show', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
})
it('list-items-3', async () => {
const length = 3;
const elements = await page.$$('.list-item')
expect(elements.length).toBe(length)
it('style::display', async () => {
const element = await page.$('.hello')
expect(await element.style('display')).toBe('flex')
const toggle = await page.$('.toggle')
await toggle.tap()
expect(await element.style('display')).toBe('none')
await toggle.tap()
expect(await element.style('display')).toBe('flex')
})
it('screenshot', async () => {
const toggle = await page.$('.toggle')
const element = await page.$('.hello')
await program.screenshot({
path: "static/v-show/screenshot-show1.png"
})
await toggle.tap()
await toggle.tap()
await program.screenshot({
path: "static/v-show/screenshot-show2.png"
})
})
})
})
\ No newline at end of file
<template>
<view class="page">
<view class="split-title">v-show</view>
<button @click="onShowOrHide">show/hide</button>
<view v-show="show">hello</view>
<view class="split-title">button:click</view>
<button class="toggle" @click="onShowOrHide">show/hide</button>
<view class="hello" v-show="show">hello</view>
</view>
</template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册