提交 83407edf 编写于 作者: W wangjinxin613

test: 调整 ios 平台判断方式

上级 87913c27
const PAGE_PATH = '/pages/built-in-component/keep-alive/keep-alive'
describe('keep-alive', () => {
if(process.env.uniTestPlatformInfo.startsWith('IOS')){
if(process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')){
it("IOS platform not support", async () => {
expect(1).toBe(1);
});
......
const PAGE_PATH = '/pages/built-in-component/teleport/teleport'
const PAGE_PATH = '/pages/built-in-component/teleport/teleport'
describe('teleport', () => {
if(process.env.uniTestPlatformInfo.startsWith('IOS')){
if(process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')){
it("IOS platform not support", async () => {
expect(1).toBe(1);
});
return
}
let page = null
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor('view')
})
let page = null
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor('view')
})
it('teleport', async () => {
await page.waitFor(500)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
})
})
})
......@@ -20,8 +20,8 @@ describe('defineProps', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await arrayLiteralObj.text()).toBe('obj: {"arr":[1,2,3],"num":0,"str":"obj str"}')
}
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('IOS')) {
expect(await arrayLiteralObj.text()).toBe('obj: {"str":"obj str","num":0,"arr":[1,2,3]}')
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await arrayLiteralObj.text()).toBe('obj: {"str":"obj str","num":0,"arr":[1,2,3]}')
}
const arrayLiteralFn = await page.$('#array-literal-fn')
......@@ -55,7 +55,7 @@ describe('defineProps', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await typeObj.text()).toBe('obj: {"arr":[1,2,3],"num":0,"str":"obj str"}')
}
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith('IOS')) {
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await typeObj.text()).toBe('obj: {"str":"obj str","num":0,"arr":[1,2,3]}')
}
const typeFn = await page.$('#type-fn')
......
......@@ -17,8 +17,8 @@ describe('watchEffect', () => {
// track
const watchCountTrackNum = await page.$('#watch-count-track-num')
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('watch count track number: 11')
} else {
......@@ -41,7 +41,7 @@ describe('watchEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 19')
} else {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 9')
......@@ -59,7 +59,7 @@ describe('watchEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 27')
} else {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 12')
......@@ -80,7 +80,7 @@ describe('watchEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 27')
} else {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 12')
......
const PAGE_PATH = '/pages/composition-api/reactivity/watch-post-effect/watch-post-effect'
describe('watchPostEffect', () => {
const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
describe('watchPostEffect', () => {
const isWeb = process.env.uniTestPlatformInfo.startsWith('web')
let page = null
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
......@@ -20,7 +20,7 @@ describe('watchPostEffect', () => {
const watchCountTrackNum = await page.$('#watch-count-track-num')
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('watch count track number: 8')
} else {
......@@ -45,7 +45,7 @@ describe('watchPostEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 16')
} else {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 6')
......@@ -63,7 +63,7 @@ describe('watchPostEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 24')
} else {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 9')
......@@ -85,7 +85,7 @@ describe('watchPostEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 24')
} else {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 9')
......
......@@ -19,7 +19,7 @@ describe('watchSyncEffect', () => {
const watchCountTrackNum = await page.$('#watch-count-track-num')
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('watch count track number: 11')
} else {
......@@ -42,7 +42,7 @@ describe('watchSyncEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('watch count track number: 19')
} else {
......@@ -61,7 +61,7 @@ describe('watchSyncEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('watch count track number: 27')
} else {
......@@ -84,7 +84,7 @@ describe('watchSyncEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchCountTrackNum.text()).toBe('watch count track number: 3')
} else if (process.env.uniTestPlatformInfo.startsWith('IOS')) {
} else if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('watch count track number: 27')
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册