const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isMP = platformInfo.startsWith('mp')
const isWeb = platformInfo.startsWith('web')
const isIOS = platformInfo.startsWith('ios')
const isHarmony = platformInfo.startsWith('harmony')
const isAppWebView = process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true'
describe('get-native-view', () => {
if (isMP || isHarmony || isWeb || isAppWebView) {
it('skip mp', () => {
expect(1).toBe(1)
})
return
}
if (
isIOS &&
(
platformInfo.indexOf('14.5') != -1 ||
platformInfo.indexOf('13.7') != -1 ||
platformInfo.indexOf('12.4') != -1
)
) {
it('14.5 13.7 12.4 测试异常', () => {
expect(1).toBe(1)
})
return
}
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/API/get-native-view/element-getnativeview')
await page.waitFor('web-view')
})
it('check_view_native_view', async () => {
page.waitFor(100)
const value = await page.callMethod('checkViewNativeView')
expect(value).toBe(true)
})
it('check_input_native_view', async () => {
page.waitFor(100)
const value = await page.callMethod('checkInputNativeView')
expect(value).toBe(true)
})
it('check_textarea_native_view', async () => {
page.waitFor(100)
const value = await page.callMethod('checkTextareaNativeView')
expect(value).toBe(true)
})
it('check_web_view_native_view', async () => {
page.waitFor(100)
const value = await page.callMethod('checkWebViewNativeView')
expect(value).toBe(true)
})
})