const PAGE_PATH = '/pages/component/view/view'
describe('view-test', () => {
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isAndroid = platformInfo.startsWith('android')
const isMP = platformInfo.startsWith('mp')
const isWeb = platformInfo.startsWith('web')
const isHarmony = platformInfo.startsWith('harmony')
if (isAndroid || isWeb || isMP) {
it('other platform', () => {
expect(1).toBe(1)
})
return
}
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(1000);
})
it('itemclick-event', async () => {
await program.tap({
x: 220,
y: 516,
duration: 100
})
await program.tap({
x: 220,
y: 546,
duration: 100
})
await program.tap({
x: 186,
y: 463,
duration: 100
})
expect(1).toBe(1)
})
if (isHarmony) {
it('hover-class', async () => {
await page.setData({
hover_class: true,
stay_time: 1000 * 10
})
await page.waitFor(100)
await program.tap({ x: 150, y: 325, duration: 2000 })
const viewChild1 = await page.$('#view-child1')
expect(await viewChild1.style('background-color')).toBe('#179b16')
})
}
})