const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isAndroid = platformInfo.startsWith("android")
const isIos = platformInfo.startsWith("ios")
const isWeb = platformInfo.startsWith("web")
const isMP = platformInfo.startsWith('mp')
let page
describe("css-custom-variable", () => {
if (isMP) {
it('skip mp', () => {
expect(1).toBe(1)
})
return
}
it("screenshot", async () => {
page = await program.reLaunch("/pages/CSS/variable/custom_variable")
await page.waitFor("view")
const image = await program.screenshot({
fullPage: true,
})
expect(image).toSaveImageSnapshot()
})
it("test-v-if", async () => {
await page.waitFor("view")
const element = await page.$(".test-v-if")
const {
height: height1
} = await element.size()
expect(height1).toBe(0)
const button = await page.$(".test-v-if-button")
await button.tap()
await page.waitFor(500)
const {
height: height2
} = await element.size()
expect(height2).toBe(30)
})
it("test-change-var", async () => {
const element = await page.$("#chanageVarBox")
const {
height: height1
} = await element.size()
expect(height1 > 0).toBe(true)
const button = await page.$("#changeVarButton")
await button.tap()
await page.waitFor(500)
const {
height: height2
} = await element.size()
expect(height2 == height1).toBe(false)
})
})