Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
db9eea53
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
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看板
提交
db9eea53
编写于
11月 21, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 处理小程序兼容问题
上级
70b54085
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
13 deletion
+27
-13
pages/API/choose-location/choose-location.test.js
pages/API/choose-location/choose-location.test.js
+3
-3
pages/API/dialog-page/dialog-page.test.js
pages/API/dialog-page/dialog-page.test.js
+8
-1
pages/API/get-app/get-app.test.js
pages/API/get-app/get-app.test.js
+8
-5
pages/API/get-app/get-app.uvue
pages/API/get-app/get-app.uvue
+6
-2
pages/API/get-current-pages/get-current-pages.uvue
pages/API/get-current-pages/get-current-pages.uvue
+2
-2
未找到文件。
pages/API/choose-location/choose-location.test.js
浏览文件 @
db9eea53
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
isWeixin
=
platformInfo
==
'
mp-weixin
'
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
dialog page
'
,
()
=>
{
if
(
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
...
...
@@ -8,8 +8,8 @@ describe('dialog page', () => {
})
return
}
if
(
is
Weixin
)
{
it
(
'
skip
app-webview
'
,
()
=>
{
if
(
is
MP
)
{
it
(
'
skip
mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
...
...
pages/API/dialog-page/dialog-page.test.js
浏览文件 @
db9eea53
...
...
@@ -3,6 +3,7 @@ jest.setTimeout(20000)
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isWeb
=
platformInfo
.
startsWith
(
'
web
'
)
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
FIRST_PAGE_PATH
=
'
/pages/API/dialog-page/dialog-page
'
const
NEXT_PAGE_PATH
=
'
/pages/API/dialog-page/next-page
'
...
...
@@ -13,6 +14,12 @@ describe('dialog page', () => {
})
return
}
if
(
isMP
)
{
it
(
'
skip mp
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
;
let
initLifeCycleNum
;
...
...
@@ -51,7 +58,7 @@ describe('dialog page', () => {
it
(
'
check dialogPage methods
'
,
async
()
=>
{
expect
(
await
page
.
callMethod
(
'
dialogPageCheckGetDialogPages
'
)).
toBe
(
true
)
let
dialogPageStyle
=
await
page
.
callMethod
(
'
dialogPageGetPageStyle
'
)
expect
(
dialogPageStyle
.
backgroundColorContent
).
not
.
toBe
(
'
red
'
)
expect
(
dialogPageStyle
.
backgroundColorContent
).
not
.
toBe
(
'
red
'
)
await
page
.
callMethod
(
'
dialogPageSetPageStyle
'
)
dialogPageStyle
=
await
page
.
callMethod
(
'
dialogPageGetPageStyle
'
)
expect
(
dialogPageStyle
.
backgroundColorContent
).
toBe
(
'
red
'
)
...
...
pages/API/get-app/get-app.test.js
浏览文件 @
db9eea53
const
PAGE_PATH
=
'
/pages/API/get-app/get-app
'
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
describe
(
'
getApp
'
,
()
=>
{
let
page
=
null
...
...
@@ -49,8 +50,10 @@ describe('getApp', () => {
expect
(
newLifeCycleNum
-
oldLifeCycleNum
).
toBe
(
100
)
await
page
.
callMethod
(
'
setLifeCycleNum
'
,
oldLifeCycleNum
)
})
it
(
'
getAndroidApplication
'
,
async
()
=>
{
const
res
=
await
page
.
callMethod
(
'
getAndroidApplication
'
)
expect
(
res
).
toBe
(
isAndroid
)
})
if
(
!
isMP
)
{
it
(
'
getAndroidApplication
'
,
async
()
=>
{
const
res
=
await
page
.
callMethod
(
'
getAndroidApplication
'
)
expect
(
res
).
toBe
(
isAndroid
)
})
}
})
pages/API/get-app/get-app.uvue
浏览文件 @
db9eea53
...
...
@@ -38,11 +38,13 @@
<button class="uni-common-mt" @click="_increasetLifeCycleNum">
increase lifeCycleNum
</button>
<text class="uni-common-mt">lifeCycleNum: {{ lifeCycleNum }}</text>
<text class="uni-common-mt">lifeCycleNum: {{ lifeCycleNum }}</text>
<!-- #ifndef MP -->
<button class="uni-common-mt" @click="getAndroidApplication">
getAndroidApplication
</button>
<text class="uni-common-mt">androidApplication is null: {{ androidApplication == null }}</text>
<!-- #endif -->
</view>
</view>
<!-- #ifdef APP -->
...
...
@@ -172,12 +174,14 @@
// 自动化测试
setLifeCycleNum(num : number) {
setLifeCycleNum(num)
},
},
// #ifndef MP
getAndroidApplication() : boolean {
const app = getApp()
this.androidApplication = app.getAndroidApplication()
return this.androidApplication !== null
}
// #endif
},
}
</script>
...
...
pages/API/get-current-pages/get-current-pages.uvue
浏览文件 @
db9eea53
...
...
@@ -93,12 +93,12 @@
}
},
onLoad(options : OnLoadOptions) {
// #if
ndef APP-ANDROID
// #if
def APP-IOS || WEB
if (options instanceof UTSJSONObject) {
this.checked = true
}
// #endif
// #if
def APP-ANDROID
// #if
ndef APP-IOS || WEB
this.checked = true
// #endif
this.getPageStyle();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录