提交 e3a2c45f 编写于 作者: Anne_LXM's avatar Anne_LXM

test(swiper.test.js): issues2448已修复调整测试例

上级 6a944e0d
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ // uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isAndroid = platformInfo.startsWith('android')
const isIos = platformInfo.startsWith('ios')
describe('component-native-scroll-view-refresher', () => { describe('component-native-scroll-view-refresher', () => {
if (process.env.UNI_AUTOMATOR_APP_WEBVIEW) { if (process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
it('other platform', () => { it('other platform', () => {
...@@ -30,7 +32,7 @@ describe('component-native-scroll-view-refresher', () => { ...@@ -30,7 +32,7 @@ describe('component-native-scroll-view-refresher', () => {
await page.waitFor(2000); await page.waitFor(2000);
expect(await page.data('refresherrefreshTimes')).toBe(1) expect(await page.data('refresherrefreshTimes')).toBe(1)
// 手动设置下拉刷新状态refresher-triggered为true时,在web和iOS不触发@refresherpulling事件 // 手动设置下拉刷新状态refresher-triggered为true时,在web和iOS不触发@refresherpulling事件
if(process.env.uniTestPlatformInfo.startsWith('android')){ if(isAndroid){
expect(await page.data('onRefresherpullingTest')).toBe('refresherpulling:Success') expect(await page.data('onRefresherpullingTest')).toBe('refresherpulling:Success')
expect(await page.data('refresherrefreshTest')).toBe('refresherrefresh:Success') expect(await page.data('refresherrefreshTest')).toBe('refresherrefresh:Success')
} }
...@@ -39,17 +41,34 @@ describe('component-native-scroll-view-refresher', () => { ...@@ -39,17 +41,34 @@ describe('component-native-scroll-view-refresher', () => {
}); });
// 仅App端支持手势下拉刷新,在不同设备上位置有差异可能导致不触发中止事件,安卓端仅测android 10.0.0_x86 // 仅App端支持手势下拉刷新,在不同设备上位置有差异可能导致不触发中止事件,安卓端仅测android 10.0.0_x86
if(!process.env.uniTestPlatformInfo.startsWith('web')){ if(!platformInfo.startsWith('web')){
it('check_refresherabort', async () => { it('check_refresherabort', async () => {
if(isIos){
await program.swipe({ await program.swipe({
startPoint: {x: 100,y: 500}, startPoint: {x: 100,y: 500},
endPoint: {x: 100,y: 630}, endPoint: {x: 100,y: 630},
duration: 1000 duration: 1000
}) })
}else if(isAndroid){
if(platformInfo.indexOf('12') != -1){
await program.swipe({
startPoint: {x: 100,y: 600},
endPoint: {x: 100,y: 730},
duration: 100
})
}else{
await program.swipe({
startPoint: {x: 100,y: 400},
endPoint: {x: 100,y: 500},
duration: 100
})
}
}
await page.waitFor(1500) await page.waitFor(1500)
console.log(process.env.uniTestPlatformInfo,'onRefresherabortTest',await page.data('onRefresherabortTest')) console.log('onRefresherpullingTest',await page.data('onRefresherpullingTest'))
console.log(platformInfo,'onRefresherabortTest',await page.data('onRefresherabortTest'))
// 下拉刷新被中止,在iOS不触发@refresherabort事件 // 下拉刷新被中止,在iOS不触发@refresherabort事件
if(process.env.uniTestPlatformInfo.startsWith('android 10.0.0_x86')){ if(platformInfo.startsWith('android 10.0.0_x86') || isIos){
expect(await page.data('onRefresherabortTest')).toBe('refresherabort:Success') expect(await page.data('onRefresherabortTest')).toBe('refresherabort:Success')
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册