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

test: 调整 ios 平台判断方式

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