Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
8c6d49f3
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6013
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8c6d49f3
编写于
11月 21, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 处理小程序兼容问题
上级
db9eea53
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
208 addition
and
84 deletion
+208
-84
pages/component/global-events/global-events.test.js
pages/component/global-events/global-events.test.js
+81
-44
pages/component/global-properties/global-properties.uvue
pages/component/global-properties/global-properties.uvue
+35
-30
pages/component/list-view/issue-2199.test.js
pages/component/list-view/issue-2199.test.js
+11
-1
pages/component/list-view/list-view-children-in-slot.test.js
pages/component/list-view/list-view-children-in-slot.test.js
+10
-0
pages/component/list-view/list-view-multiplex.test.js
pages/component/list-view/list-view-multiplex.test.js
+10
-0
pages/component/list-view/list-view.test.js
pages/component/list-view/list-view.test.js
+16
-6
pages/component/nested-scroll-body/nested-scroll-body.test.js
...s/component/nested-scroll-body/nested-scroll-body.test.js
+10
-0
pages/component/nested-scroll-header/nested-scroll-header.test.js
...mponent/nested-scroll-header/nested-scroll-header.test.js
+10
-0
pages/component/sticky-header/sticky-header.test.js
pages/component/sticky-header/sticky-header.test.js
+10
-0
pages/component/sticky-section/sticky-section.test.js
pages/component/sticky-section/sticky-section.test.js
+11
-1
pages/component/swiper/swiper2.test.js
pages/component/swiper/swiper2.test.js
+4
-2
未找到文件。
pages/component/global-events/global-events.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
PAGE_PATH
=
'
/pages/component/global-events/global-events
'
describe
(
'
event trigger
'
,
()
=>
{
...
...
@@ -178,6 +180,17 @@ describe('event trigger', () => {
})
it
(
'
click
'
,
async
()
=>
{
if
(
isMP
)
{
page
=
await
program
.
navigateTo
(
PAGE_PATH
)
await
page
.
waitFor
(
'
view
'
)
const
el
=
await
page
.
$
(
'
#longpress-target
'
)
await
el
.
tap
()
await
page
.
waitFor
(
500
)
const
clickEventX
=
await
page
.
$
(
'
#click-event-x
'
)
expect
(
parseInt
(
await
clickEventX
.
text
())).
toBeGreaterThan
(
0
)
const
clickEventY
=
await
page
.
$
(
'
#click-event-y
'
)
expect
(
parseInt
(
await
clickEventY
.
text
())).
toBeGreaterThan
(
0
)
}
else
{
const
el
=
await
page
.
$
(
'
#longpress-target
'
)
await
el
.
tap
()
const
targetX
=
'
0
'
...
...
@@ -190,12 +203,35 @@ describe('event trigger', () => {
expect
(
await
clickEventX
.
text
()).
toBe
(
targetX
)
const
clickEventY
=
await
page
.
$
(
'
#click-event-y
'
)
expect
(
await
clickEventY
.
text
()).
toBe
(
targetY
)
}
})
it
(
'
longPress
'
,
async
()
=>
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
const
el
=
await
page
.
$
(
'
#longpress-target
'
)
await
el
.
longpress
()
if
(
isMP
)
{
const
longPressTouchIdentifier
=
await
page
.
$
(
'
#long-press-touch-identifier
'
)
expect
(
await
longPressTouchIdentifier
.
text
()).
toBe
(
'
0
'
)
const
longPressTouchPageX
=
await
page
.
$
(
'
#long-press-touch-page-x
'
)
expect
(
parseInt
(
await
longPressTouchPageX
.
text
())).
toBeGreaterThan
(
0
)
const
longPressTouchPageY
=
await
page
.
$
(
'
#long-press-touch-page-y
'
)
expect
(
parseInt
(
await
longPressTouchPageY
.
text
())).
toBeGreaterThan
(
0
)
const
longPressTouchClientX
=
await
page
.
$
(
'
#long-press-touch-client-x
'
)
expect
(
parseInt
(
await
longPressTouchClientX
.
text
())).
toBeGreaterThan
(
0
)
const
longPressTouchClientY
=
await
page
.
$
(
'
#long-press-touch-client-y
'
)
expect
(
parseInt
(
await
longPressTouchClientY
.
text
())).
toBeGreaterThan
(
0
)
const
longPressChangedTouchIdentifier
=
await
page
.
$
(
'
#long-press-changed-touch-identifier
'
)
expect
(
await
longPressChangedTouchIdentifier
.
text
()).
toBe
(
'
0
'
)
const
longPressChangedTouchPageX
=
await
page
.
$
(
'
#long-press-changed-touch-page-x
'
)
expect
(
parseInt
(
await
longPressChangedTouchPageX
.
text
())).
toBeGreaterThan
(
0
)
const
longPressChangedTouchPageY
=
await
page
.
$
(
'
#long-press-changed-touch-page-y
'
)
expect
(
parseInt
(
await
longPressChangedTouchPageY
.
text
())).
toBeGreaterThan
(
0
)
const
longPressChangedTouchClientX
=
await
page
.
$
(
'
#long-press-changed-touch-client-x
'
)
expect
(
parseInt
(
await
longPressChangedTouchClientX
.
text
())).
toBeGreaterThan
(
0
)
const
longPressChangedTouchClientY
=
await
page
.
$
(
'
#long-press-changed-touch-client-y
'
)
expect
(
parseInt
(
await
longPressChangedTouchClientY
.
text
())).
toBeGreaterThan
(
0
)
}
else
{
const
longPressTouchTargetIdentifier
=
'
1
'
const
longPressTouchTargetValue
=
'
0
'
const
longPressTouchIdentifier
=
await
page
.
$
(
'
#long-press-touch-identifier
'
)
...
...
@@ -226,6 +262,7 @@ describe('event trigger', () => {
expect
(
await
longPressChangedTouchScreenX
.
text
()).
toBe
(
longPressTouchTargetValue
)
const
longPressChangedTouchScreenY
=
await
page
.
$
(
'
#long-press-changed-touch-screen-y
'
)
expect
(
await
longPressChangedTouchScreenY
.
text
()).
toBe
(
longPressTouchTargetValue
)
}
if
(
isAndroid
||
isIos
)
{
if
(
isIos
)
{
...
...
pages/component/global-properties/global-properties.uvue
浏览文件 @
8c6d49f3
...
...
@@ -63,13 +63,17 @@
}
// #ifdef APP
if (!generalTarget.classList.includes('general-class')) {
this.validateGeneralAttrText = '基础属性 class 验证失败'
return
}
// #endif
// #ifndef APP
// #ifdef WEB
if (!Array.from(generalTarget.classList).includes('general-class')) {
// #endif
this.validateGeneralAttrText = '基础属性 class 验证失败'
return
}
// #endif
// #ifndef MP
const generalName = generalTarget.getAttribute('name')
if (generalName != this.generalName) {
this.validateGeneralAttrText = '基础属性 name 验证失败'
...
...
@@ -85,9 +89,10 @@
this.validateGeneralAttrText = '基础属性 data-test 验证失败'
return
}
// #endif
this.validateGeneralAttrText = '基础属性验证成功'
},
changeHeight()
{
changeHeight()
{
const generalTarget = this.$refs['general-target'] as UniElement
this.changeHeightByRefText = '已通过 ref 修改高度'
generalTarget.style.setProperty('height', '200px')
...
...
pages/component/list-view/issue-2199.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
issue-2199
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/issue-2199
'
)
await
page
.
waitFor
(
600
)
...
...
pages/component/list-view/list-view-children-in-slot.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
list-view-children-in-slot
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-children-in-slot
'
)
...
...
pages/component/list-view/list-view-multiplex.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-list-view
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
//打开list-view-multiplex测试页
...
...
pages/component/list-view/list-view.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-list-view
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
//打开list-view测试页
...
...
pages/component/nested-scroll-body/nested-scroll-body.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-nested-scroll-body
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
if
(
process
.
env
.
uniTestPlatformInfo
.
indexOf
(
'
web
'
)
>
-
1
||
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
it
(
'
dummyTest
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
...
...
pages/component/nested-scroll-header/nested-scroll-header.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-nested-scroll-header
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
if
(
process
.
env
.
uniTestPlatformInfo
.
indexOf
(
'
web
'
)
>
-
1
||
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
it
(
'
dummyTest
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
...
...
pages/component/sticky-header/sticky-header.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-sticky-header
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
async
function
getWindowInfo
()
{
const
windowInfoPage
=
await
program
.
reLaunch
(
'
/pages/API/get-window-info/get-window-info
'
)
...
...
pages/component/sticky-section/sticky-section.test.js
浏览文件 @
8c6d49f3
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
component-native-sticky-section
'
,
()
=>
{
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/sticky-section/sticky-section
'
)
...
...
pages/component/swiper/swiper2.test.js
浏览文件 @
8c6d49f3
...
...
@@ -4,8 +4,10 @@ describe('swiper-touch-test', () => {
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isWeb
=
platformInfo
.
startsWith
(
'
web
'
)
// 屏蔽 web * android 平台
if
(
isWeb
||
isAndroid
)
{
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
// 屏蔽 web * android 平台, 需要针对调整坐标
// 屏蔽 小程序,不支持 program.swipe
if
(
isWeb
||
isAndroid
||
isMp
)
{
it
(
'
other platform
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录