Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
5b3b259c
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看板
提交
5b3b259c
编写于
3月 15, 2024
作者:
DCloud_iOS_WZT
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitcode.net/dcloud/hello-uni-app-x
into dev
上级
cbe83fe9
bf22549a
变更
30
显示空白变更内容
内联
并排
Showing
30 changed file
with
493 addition
and
293 deletion
+493
-293
main.uts
main.uts
+6
-2
pages.json
pages.json
+7
-9
pages/API/action-sheet/action-sheet.uvue
pages/API/action-sheet/action-sheet.uvue
+7
-1
pages/API/download-file/download-file.test.js
pages/API/download-file/download-file.test.js
+2
-2
pages/API/get-provider/get-provider.uvue
pages/API/get-provider/get-provider.uvue
+87
-0
pages/API/navigator/new-page/onLoad.test.js
pages/API/navigator/new-page/onLoad.test.js
+3
-3
pages/API/request/request.test.js
pages/API/request/request.test.js
+8
-2
pages/API/request/request.uvue
pages/API/request/request.uvue
+19
-0
pages/API/toast/toast.uvue
pages/API/toast/toast.uvue
+2
-2
pages/API/upload-file/upload-file.test.js
pages/API/upload-file/upload-file.test.js
+9
-9
pages/CSS/overflow/overflow.test.js
pages/CSS/overflow/overflow.test.js
+7
-7
pages/component/button/button.test.js
pages/component/button/button.test.js
+7
-0
pages/component/button/button.uvue
pages/component/button/button.uvue
+14
-9
pages/component/button/buttonstatus.uvue
pages/component/button/buttonstatus.uvue
+186
-169
pages/component/general-event/general-event.test.js
pages/component/general-event/general-event.test.js
+3
-3
pages/component/image/image.test.js
pages/component/image/image.test.js
+1
-1
pages/component/input/input.test.js
pages/component/input/input.test.js
+5
-5
pages/component/input/input.uvue
pages/component/input/input.uvue
+1
-2
pages/component/scroll-view/scroll-view-custom-refresher-props.uvue
...onent/scroll-view/scroll-view-custom-refresher-props.uvue
+6
-5
pages/component/scroll-view/scroll-view-refresher-props.uvue
pages/component/scroll-view/scroll-view-refresher-props.uvue
+2
-2
pages/component/scroll-view/scroll-view-refresher.test.js
pages/component/scroll-view/scroll-view-refresher.test.js
+11
-11
pages/component/sticky-section/sticky-section.test.js
pages/component/sticky-section/sticky-section.test.js
+2
-2
pages/component/text/text-props.test.js
pages/component/text/text-props.test.js
+39
-7
pages/component/text/text-props.uvue
pages/component/text/text-props.uvue
+29
-6
pages/component/web-view-local/web-view-local.test.js
pages/component/web-view-local/web-view-local.test.js
+1
-1
pages/component/web-view/web-view.test.js
pages/component/web-view/web-view.test.js
+1
-1
pages/pages.test.js
pages/pages.test.js
+16
-16
pages/template/custom-refresher/custom-refresher.uvue
pages/template/custom-refresher/custom-refresher.uvue
+5
-9
pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js
...reenshot-comparison/webview-screenshot-comparison.test.js
+4
-4
pages/webview-screenshot/webview-screenshot.test.js
pages/webview-screenshot/webview-screenshot.test.js
+3
-3
未找到文件。
main.uts
浏览文件 @
5b3b259c
...
@@ -3,12 +3,16 @@ import App from './App.uvue'
...
@@ -3,12 +3,16 @@ import App from './App.uvue'
import { createSSRApp } from 'vue'
import { createSSRApp } from 'vue'
export function createApp() {
export function createApp() {
const app = createSSRApp(App)
const app = createSSRApp(App)
app.config.errorHandler = (err, vm, info) => {
console.log(err, vm, info)
}
app.mixin({
app.mixin({
onReady() {
onReady() {
// #ifdef APP-ANDROID
setTimeout(() => {
setTimeout(() => {
console.log((this as BasePage).$nativePage!.getDomJson())
console.log((this as BasePage).$nativePage!.getDomJson())
}, 100)
}, 100)
// #endif
}
}
})
})
return {
return {
...
...
pages.json
浏览文件 @
5b3b259c
...
@@ -269,7 +269,6 @@
...
@@ -269,7 +269,6 @@
"navigationBarTitleText"
:
"web-view-local"
"navigationBarTitleText"
:
"web-view-local"
}
}
},
},
//
#ifndef
APP-IOS
{
{
"path"
:
"pages/component/unicloud-db-contacts/list"
,
"path"
:
"pages/component/unicloud-db-contacts/list"
,
"style"
:
{
"style"
:
{
...
@@ -301,7 +300,6 @@
...
@@ -301,7 +300,6 @@
"navigationBarTitleText"
:
"mixinDatacom"
"navigationBarTitleText"
:
"mixinDatacom"
}
}
},
},
//
#endif
{
{
"path"
:
"pages/component/general-attribute/general-attribute"
,
"path"
:
"pages/component/general-attribute/general-attribute"
,
"style"
:
{
"style"
:
{
...
@@ -576,6 +574,13 @@
...
@@ -576,6 +574,13 @@
"navigationBarTitleText"
:
"get-system-setting"
"navigationBarTitleText"
:
"get-system-setting"
}
}
},
},
{
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"style"
:
{
"navigationBarTitleText"
:
"takeSnapshot"
,
"enablePullDownRefresh"
:
false
}
},
//
#endif
//
#endif
//
#ifndef
WEB
//
#ifndef
WEB
{
{
...
@@ -655,13 +660,6 @@
...
@@ -655,13 +660,6 @@
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"style"
:
{
"navigationBarTitleText"
:
"takeSnapshot"
,
"enablePullDownRefresh"
:
false
}
},
{
{
"path"
:
"pages/API/element-draw/element-draw"
,
"path"
:
"pages/API/element-draw/element-draw"
,
"style"
:
{
"style"
:
{
...
...
pages/API/action-sheet/action-sheet.uvue
浏览文件 @
5b3b259c
...
@@ -117,6 +117,12 @@
...
@@ -117,6 +117,12 @@
})
})
},
},
fail: (e) => {
fail: (e) => {
if(this.showErrorToast){
uni.showToast({
title: e.errMsg,
icon: "none"
})
}
console.log(e);
console.log(e);
}
}
})
})
...
...
pages/API/download-file/download-file.test.js
浏览文件 @
5b3b259c
...
@@ -23,7 +23,7 @@ describe('ExtApi-DownloadFile', () => {
...
@@ -23,7 +23,7 @@ describe('ExtApi-DownloadFile', () => {
});
});
let
shouldTestCookie
=
false
let
shouldTestCookie
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
shouldTestCookie
=
version
>
9
shouldTestCookie
=
version
>
9
...
...
pages/API/get-provider/get-provider.uvue
0 → 100644
浏览文件 @
5b3b259c
<template>
<!-- #ifdef APP -->
<scroll-view class="page-scroll-view">
<!-- #endif -->
<view class="page">
<page-head :title="title"></page-head>
<view class="service-item" v-for="(item, index) in serviceList" :key="index">
<text class="service-name">{{item.name}}:</text>
<view class="provider-list">
<text class="provider-item" v-for="(item2, index2) in item.provider" :key="index2">{{item2}}</text>
</view>
</view>
<button class="btn-get-provider" type="primary" @click="getProvider">getProvider</button>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
type ProviderItem = {
service : string,
name : string,
provider : string[]
}
export default {
data() {
return {
title: 'provider',
serviceList: [
{ service: "oauth", name: "登陆", provider: [] },
{ service: "share", name: "分享", provider: [] },
{ service: "payment", name: "支付", provider: [] },
{ service: "push", name: "推送", provider: [] },
{ service: "location", name: "定位", provider: [] }
] as ProviderItem[]
}
},
methods: {
getProvider() {
this.serviceList.forEach((item : ProviderItem) => {
uni.getProvider({
service: item.service,
success: (e) => {
this.updateProvider(e.service, e.provider);
}
})
})
},
updateProvider(service : string, provider : string[]) {
const item : ProviderItem | null = this.serviceList.find((item : ProviderItem) : boolean => {
return item.service == service
});
if (item != null) {
item.provider = provider
}
}
}
}
</script>
<style>
.page {
padding: 15px;
}
.service-item {
margin-top: 10px;
}
.service-name {
font-weight: bold;
}
.provider-list {
margin-left: 32px;
}
.provider-item {
line-height: 1.5;
}
.btn-get-provider {
margin-top: 30px;
}
</style>
pages/API/navigator/new-page/onLoad.test.js
浏览文件 @
5b3b259c
...
@@ -22,7 +22,7 @@ describe("onLoad", () => {
...
@@ -22,7 +22,7 @@ describe("onLoad", () => {
expect
(
page
.
path
).
toBe
(
TARGET_PAGE_PATH
.
substring
(
1
));
expect
(
page
.
path
).
toBe
(
TARGET_PAGE_PATH
.
substring
(
1
));
});
});
it
(
"
navigateBack
"
,
async
()
=>
{
it
(
"
navigateBack
"
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
page
=
await
program
.
reLaunch
(
INTERMEDIATE_PAGE_PATH
);
page
=
await
program
.
reLaunch
(
INTERMEDIATE_PAGE_PATH
);
await
page
.
waitFor
(
'
view
'
);
await
page
.
waitFor
(
'
view
'
);
await
page
.
callMethod
(
"
navigateToOnLoadWithType
"
,
"
navigateBack
"
);
await
page
.
callMethod
(
"
navigateToOnLoadWithType
"
,
"
navigateBack
"
);
...
...
pages/API/request/request.test.js
浏览文件 @
5b3b259c
...
@@ -86,7 +86,7 @@ describe('ExtApi-Request', () => {
...
@@ -86,7 +86,7 @@ describe('ExtApi-Request', () => {
});
});
let
shouldTestCookie
=
false
let
shouldTestCookie
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
shouldTestCookie
=
version
>
9
shouldTestCookie
=
version
>
9
...
@@ -108,4 +108,10 @@ describe('ExtApi-Request', () => {
...
@@ -108,4 +108,10 @@ describe('ExtApi-Request', () => {
res
=
await
page
.
data
(
'
jest_result
'
);
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
expect
(
res
).
toBe
(
true
)
});
});
it
(
'
Check Get With Data
'
,
async
()
=>
{
res
=
await
page
.
callMethod
(
'
jest_get_with_data
'
)
await
page
.
waitFor
(
2000
);
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
})
});
});
pages/API/request/request.uvue
浏览文件 @
5b3b259c
...
@@ -301,6 +301,25 @@
...
@@ -301,6 +301,25 @@
},
},
});
});
},
},
jest_get_with_data() {
uni.request({
url: "https://unidemo.dcloud.net.cn/api/banner/36kr",
method: "GET",
data:{
column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
},
timeout: 6000,
sslVerify: false,
withCredentials: false,
firstIpv4: false,
success: () => {
this.jest_result = true;
},
fail: () => {
this.jest_result = false;
},
});
},
}
}
}
}
</script>
</script>
pages/API/toast/toast.uvue
浏览文件 @
5b3b259c
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<!-- #ifndef MP-ALIPAY -->
<!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" type="default" @tap="toast4Tap">点击弹出显示自定义图片的toast</button>
<button class="uni-btn-v" type="default" @tap="toast4Tap">点击弹出显示自定义图片的toast</button>
<!-- #endif -->
<!-- #endif -->
<!-- #ifdef APP
-PLUS
-->
<!-- #ifdef APP -->
<button class="uni-btn-v" type="default" @tap="toast5Tap" id="btn-toast-postion-bottom">点击显示无图标的居底toast</button>
<button class="uni-btn-v" type="default" @tap="toast5Tap" id="btn-toast-postion-bottom">点击显示无图标的居底toast</button>
<!-- #endif -->
<!-- #endif -->
<button class="uni-btn-v" type="default" @tap="hideToast" id="btn-toast-hide">点击隐藏toast</button>
<button class="uni-btn-v" type="default" @tap="hideToast" id="btn-toast-hide">点击隐藏toast</button>
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
},
},
})
})
},
},
// #ifdef APP
-PLUS
// #ifdef APP
toast5Tap: function () {
toast5Tap: function () {
uni.showToast({
uni.showToast({
title: "显示一段轻提示",
title: "显示一段轻提示",
...
...
pages/API/upload-file/upload-file.test.js
浏览文件 @
5b3b259c
...
@@ -37,7 +37,7 @@ describe('ExtApi-UploadFile', () => {
...
@@ -37,7 +37,7 @@ describe('ExtApi-UploadFile', () => {
});
});
let
shouldTestCookie
=
false
let
shouldTestCookie
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
shouldTestCookie
=
version
>
9
shouldTestCookie
=
version
>
9
...
...
pages/CSS/overflow/overflow.test.js
浏览文件 @
5b3b259c
...
@@ -8,7 +8,7 @@ describe('component-native-overflow', () => {
...
@@ -8,7 +8,7 @@ describe('component-native-overflow', () => {
//检测overflow设置hidden,visible
//检测overflow设置hidden,visible
it
(
'
check_view_overflow
'
,
async
()
=>
{
it
(
'
check_view_overflow
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
//安卓7模拟器不截图 导致闪退
//安卓7模拟器不截图 导致闪退
...
...
pages/component/button/button.test.js
浏览文件 @
5b3b259c
...
@@ -86,4 +86,11 @@ describe('Button.uvue', () => {
...
@@ -86,4 +86,11 @@ describe('Button.uvue', () => {
const
value
=
await
page
.
callMethod
(
'
checkUniButtonElement
'
)
const
value
=
await
page
.
callMethod
(
'
checkUniButtonElement
'
)
expect
(
value
).
toBe
(
true
)
expect
(
value
).
toBe
(
true
)
})
})
it
(
"
setbuttonEmpty
"
,
async
()
=>
{
const
textBtn
=
await
page
.
$
(
'
.btn
'
)
await
page
.
setData
({
text
:
''
,
})
expect
(
await
textBtn
.
text
()).
toEqual
(
''
)
})
})
})
pages/component/button/button.uvue
浏览文件 @
5b3b259c
...
@@ -37,9 +37,9 @@
...
@@ -37,9 +37,9 @@
})
})
},
},
//用于自动化测试
//用于自动化测试
checkUniButtonElement()
: boolean {
checkUniButtonElement()
: boolean {
const button = uni.getElementById("testButton")
const button = uni.getElementById("testButton")
if
(button != null && button instanceof UniButtonElement) {
if
(button != null && button instanceof UniButtonElement) {
return true
return true
}
}
return false
return false
...
@@ -97,4 +97,9 @@
...
@@ -97,4 +97,9 @@
background-color: #179b16;
background-color: #179b16;
border-color: #179b16;
border-color: #179b16;
}
}
.button-hover {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
</style>
</style>
pages/component/button/buttonstatus.uvue
浏览文件 @
5b3b259c
...
@@ -36,7 +36,9 @@
...
@@ -36,7 +36,9 @@
</script>
</script>
<template>
<template>
<scroll-view direction="vertical" style="flex:1">
<view class="main">
<view class="main">
<!--type-->
<!--type-->
<view class="container">
<view class="container">
<button style="margin: 10px;" :disabled="disabled_boolean" :size="size_enum[size_enum_current].name"
<button style="margin: 10px;" :disabled="disabled_boolean" :size="size_enum[size_enum_current].name"
...
@@ -136,9 +138,15 @@
...
@@ -136,9 +138,15 @@
</view>
</view>
<view class="content">
<view class="content">
<button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean">uni-app x</button>
<button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean">uni-app x</button>
<button style="margin: 10px;" type="primary" @tap="change_disabled_boolean(!disabled_boolean)">修改disabled为{{disabled_boolean}}</button>
<button style="margin: 10px;" type="primary"
@tap="change_disabled_boolean(!disabled_boolean)">修改disabled为{{!disabled_boolean}}</button>
</view>
<view class="content">
<button style="margin: 10px;" type="primary" size="default" :disabled="disabled_boolean" hover-class="none">hover-class none</button>
</view>
</view>
</view>
</view>
</scroll-view>
</template>
</template>
<style>
<style>
...
@@ -173,6 +181,15 @@
...
@@ -173,6 +181,15 @@
.container {
.container {
width: 100%;
width: 100%;
height: 60px;
height: 60px;
/* background-color: orange; */
}
.is-hover {
color: rgba(255, 255, 255, 0.6);
background-color: #179b16;
border-color: #179b16;
}
.button-hover {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
}
</style>
</style>
pages/component/general-event/general-event.test.js
浏览文件 @
5b3b259c
...
@@ -10,7 +10,7 @@ describe('event trigger sequence', () => {
...
@@ -10,7 +10,7 @@ describe('event trigger sequence', () => {
})
})
it
(
'
touch
'
,
async
()
=>
{
it
(
'
touch
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
await
el
.
touchstart
({
await
el
.
touchstart
({
touches
:
[{
touches
:
[{
identifier
:
1
,
identifier
:
1
,
...
@@ -56,7 +56,7 @@ describe('event trigger sequence', () => {
...
@@ -56,7 +56,7 @@ describe('event trigger sequence', () => {
})
})
it
(
'
longPress
'
,
async
()
=>
{
it
(
'
longPress
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
await
el
.
longpress
()
await
el
.
longpress
()
const
data
=
await
page
.
data
()
const
data
=
await
page
.
data
()
expect
(
data
.
onLongPressTime
).
toBeGreaterThan
(
0
)
expect
(
data
.
onLongPressTime
).
toBeGreaterThan
(
0
)
...
...
pages/component/image/image.test.js
浏览文件 @
5b3b259c
...
@@ -30,7 +30,7 @@ describe('component-native-image', () => {
...
@@ -30,7 +30,7 @@ describe('component-native-image', () => {
expect
(
await
page
.
data
(
'
loadError
'
)).
toBe
(
true
)
expect
(
await
page
.
data
(
'
loadError
'
)).
toBe
(
true
)
})
})
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
it
(
'
check-cookie
'
,
async
()
=>
{
it
(
'
check-cookie
'
,
async
()
=>
{
await
page
.
setData
({
await
page
.
setData
({
autoTest
:
true
,
autoTest
:
true
,
...
...
pages/component/input/input.test.js
浏览文件 @
5b3b259c
...
@@ -147,19 +147,19 @@ describe('component-native-input', () => {
...
@@ -147,19 +147,19 @@ describe('component-native-input', () => {
expect
(
await
(
await
page
.
$
(
'
#uni-input-cursor-color
'
)).
attribute
(
"
cursor-color
"
)).
toBe
(
"
red
"
)
expect
(
await
(
await
page
.
$
(
'
#uni-input-cursor-color
'
)).
attribute
(
"
cursor-color
"
)).
toBe
(
"
red
"
)
})
})
it
(
"
maxlength
default
"
,
async
()
=>
{
it
(
"
maxlength
"
,
async
()
=>
{
const
input
=
await
page
.
$
(
'
#uni-input-
disable
'
);
const
input
=
await
page
.
$
(
'
#uni-input-
maxlength
'
);
let
str
=
""
;
let
str
=
""
;
for
(
let
i
=
0
;
i
<
200
;
i
++
){
for
(
let
i
=
0
;
i
<
200
;
i
++
){
str
+=
`
${
i
}
`
str
+=
`
${
i
}
`
}
}
await
page
.
setData
({
await
page
.
setData
({
disable
Value
:
str
inputMaxLength
Value
:
str
})
})
let
length
=
(
await
input
.
attribute
(
"
value
"
)).
length
let
length
=
(
await
input
.
attribute
(
"
value
"
)).
length
expect
(
length
).
toBe
(
1
4
0
)
expect
(
length
).
toBe
(
10
)
await
page
.
setData
({
await
page
.
setData
({
disable
Value
:
""
inputMaxLength
Value
:
""
})
})
})
})
...
...
pages/component/input/input.uvue
浏览文件 @
5b3b259c
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<text class="uni-title-text">设置禁用输入框</text>
<text class="uni-title-text">设置禁用输入框</text>
</view>
</view>
<view class="input-wrapper">
<view class="input-wrapper">
<input id="uni-input-disable" class="uni-input" :disabled="true"
:value="disableValue"
/>
<input id="uni-input-disable" class="uni-input" :disabled="true"/>
</view>
</view>
</view>
</view>
...
@@ -266,7 +266,6 @@
...
@@ -266,7 +266,6 @@
inputPasswordValue: "",
inputPasswordValue: "",
inputFocusKeyBoardChangeValue: true,
inputFocusKeyBoardChangeValue: true,
holdKeyboard: false,
holdKeyboard: false,
disableValue: ""
}
}
},
},
methods: {
methods: {
...
...
pages/component/scroll-view/scroll-view-custom-refresher-props.uvue
浏览文件 @
5b3b259c
<template>
<template>
<scroll-view style="flex:1;" :refresher-enabled="true" :refresher-triggered="refresherTriggered"
<scroll-view style="flex:1;" :refresher-enabled="true" :refresher-triggered="refresherTriggered"
refresher-default-style="none" @refresherpulling="onRefresherpulling" @refresherrefresh="onRefresherrefresh">
refresher-default-style="none" @refresherpulling="onRefresherpulling" @refresherrefresh="onRefresherrefresh"
@refresherrestore="onRefreshrestore"
>
<view style="height: 25px;"></view>
<view style="height: 25px;"></view>
<view v-for="i in 20" class="content-item">
<view v-for="i in 20" class="content-item">
<text class="text">item-{{i}}</text>
<text class="text">item-{{i}}</text>
...
@@ -38,9 +38,6 @@
...
@@ -38,9 +38,6 @@
methods: {
methods: {
onRefresherpulling(e : RefresherEvent) {
onRefresherpulling(e : RefresherEvent) {
this.pullingDistance = e.detail.dy;
this.pullingDistance = e.detail.dy;
if (this.pullingDistance.toDouble() == 0.0) {
this.resetting = false;
}
},
},
onRefresherrefresh() {
onRefresherrefresh() {
this.refresherTriggered = true
this.refresherTriggered = true
...
@@ -49,6 +46,10 @@
...
@@ -49,6 +46,10 @@
this.resetting = true;
this.resetting = true;
}, 1500)
}, 1500)
},
},
onRefreshrestore() {
this.pullingDistance = 0
this.resetting = false;
}
}
}
}
}
</script>
</script>
...
...
pages/component/scroll-view/scroll-view-refresher-props.uvue
浏览文件 @
5b3b259c
...
@@ -64,10 +64,10 @@
...
@@ -64,10 +64,10 @@
data() {
data() {
return {
return {
items: [] as Item[],
items: [] as Item[],
refresherEnabled:
fals
e,
refresherEnabled:
tru
e,
refresherTriggered: false,
refresherTriggered: false,
refresherThreshold: 45,
refresherThreshold: 45,
refresherDefaultStyle: "
white
",
refresherDefaultStyle: "
black
",
refresherBackground: "transparent",
refresherBackground: "transparent",
}
}
},
},
...
...
pages/component/scroll-view/scroll-view-refresher.test.js
浏览文件 @
5b3b259c
// 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/
describe
(
'
component-native-scroll-view-refresher
'
,
()
=>
{
describe
(
'
component-native-scroll-view-refresher
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
page
;
let
page
;
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view-refresher
'
);
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view-refresher
'
);
...
...
pages/component/sticky-section/sticky-section.test.js
浏览文件 @
5b3b259c
...
@@ -19,7 +19,7 @@ describe('component-native-sticky-section', () => {
...
@@ -19,7 +19,7 @@ describe('component-native-sticky-section', () => {
await
page
.
setData
({
await
page
.
setData
({
scrolling
:
'
true
'
scrolling
:
'
true
'
})
})
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
//跳转到id为C的StickyHeader位置
//跳转到id为C的StickyHeader位置
await
page
.
callMethod
(
'
gotoStickyHeader
'
,
'
C
'
)
await
page
.
callMethod
(
'
gotoStickyHeader
'
,
'
C
'
)
}
}
...
...
pages/component/text/text-props.test.js
浏览文件 @
5b3b259c
...
@@ -13,23 +13,55 @@ describe('text-props', () => {
...
@@ -13,23 +13,55 @@ describe('text-props', () => {
})
})
it
(
'
empty text
'
,
async
()
=>
{
it
(
'
empty text
'
,
async
()
=>
{
await
page
.
setData
({
autoTest
:
true
})
const
element
=
await
page
.
$
(
'
#empty-text
'
)
const
element
=
await
page
.
$
(
'
#empty-text
'
)
if
(
element
!=
null
)
{
if
(
element
!=
null
)
{
const
{
width
,
height
}
=
await
element
.
size
()
const
{
width
,
height
}
=
await
element
.
size
()
expect
(
width
).
toBe
(
0
)
expect
(
width
).
toBe
(
0
)
expect
(
height
).
toBe
(
0
)
expect
(
height
).
toBe
(
0
)
}
}
await
page
.
callMethod
(
"
setEmptyText
"
)
await
page
.
waitFor
(
100
)
const
element2
=
await
page
.
$
(
'
#empty-text2
'
)
if
(
element2
!=
null
)
{
const
{
width
,
height
}
=
await
element2
.
size
()
expect
(
width
).
toBe
(
0
)
expect
(
height
).
toBe
(
0
)
}
await
page
.
setData
({
autoTest
:
false
})
})
})
if
(
process
.
env
.
uniTestPlatformInfo
.
indexOf
(
'
web
'
)
>
-
1
)
{
it
(
'
nested text
'
,
async
()
=>
{
return
await
page
.
setData
({
autoTest
:
true
})
await
page
.
callMethod
(
"
setNestedText
"
)
await
page
.
waitFor
(
100
)
const
element
=
await
page
.
$
(
'
#nested-text
'
)
if
(
element
!=
null
)
{
expect
(
await
element
.
text
()).
toBe
(
"
修改三级节点文本
"
)
}
}
await
page
.
setData
({
autoTest
:
false
})
})
it
(
'
text nested
'
,
async
()
=>
{
it
(
'
height text
'
,
async
()
=>
{
page
.
callMethod
(
"
setTextNested
"
)
await
page
.
setData
({
const
element
=
await
page
.
$
(
'
#text-nested
'
)
autoTest
:
true
})
await
page
.
callMethod
(
"
setHeightText
"
)
await
page
.
waitFor
(
100
)
const
element
=
await
page
.
$
(
'
#height-text
'
)
if
(
element
!=
null
)
{
if
(
element
!=
null
)
{
expect
(
await
element
.
text
()).
toBe
(
"
二级节点文字红色且背景色黄色
"
)
expect
(
await
element
.
text
()).
toBe
(
"
修改设置高度文本
"
)
}
}
await
page
.
setData
({
autoTest
:
false
})
})
})
})
})
pages/component/text/text-props.uvue
浏览文件 @
5b3b259c
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
<view class="text-box">
<view class="text-box">
<text
<text
>一级节点黑色
>一级节点黑色
<text
id="text-nested" ref="text-nested"
style="color: red;background-color: yellow;"
<text style="color: red;background-color: yellow;"
>二级节点红色且背景色黄色
>二级节点红色且背景色黄色
<text>三级节点不继承二级的颜色</text>
<text>三级节点不继承二级的颜色</text>
</text>
</text>
...
@@ -96,10 +96,22 @@
...
@@ -96,10 +96,22 @@
<text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text>
<text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text>
</view>
</view>
<view v-if="autoTest">
<view class="uni-row">
<view class="uni-row">
<text id="empty-text"></text>
<text id="empty-text"></text>
</view>
</view>
<view class="uni-row">
<text id="empty-text2">{{emptyText}}</text>
</view>
<text
>一级节点文本
<text
>二级节点文本
<text id="nested-text">{{nestedText}}</text>
</text>
</text>
<text id="height-text" style="height: 50px;">{{heightText}}</text>
</view>
</view>
</view>
</scroll-view>
</scroll-view>
</template>
</template>
...
@@ -112,12 +124,23 @@ export default {
...
@@ -112,12 +124,23 @@ export default {
multiLineText:
multiLineText:
'HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言;HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言',
'HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言;HBuilderX,轻巧、极速,极客编辑器;uni-app x,终极跨平台方案;uts,大一统语言',
singleLineText: 'uni-app x,终极跨平台方案',
singleLineText: 'uni-app x,终极跨平台方案',
// 自动化测试
autoTest: false,
nestedText: '三级节点文本',
emptyText: '空文本',
heightText: '设置高度文本'
}
}
},
},
methods: {
methods: {
// 自动化测试
// 自动化测试
setTextNested() {
setNestedText() {
(this.$refs["text-nested"] as UniTextElement).value = "二级节点文字红色且背景色黄色";
this.nestedText = "修改三级节点文本";
},
setEmptyText() {
this.emptyText = "";
},
setHeightText() {
this.heightText = "修改设置高度文本";
}
}
}
}
}
}
...
...
pages/component/web-view-local/web-view-local.test.js
浏览文件 @
5b3b259c
...
@@ -12,7 +12,7 @@ describe('component-native-web-view', () => {
...
@@ -12,7 +12,7 @@ describe('component-native-web-view', () => {
});
});
it
(
'
screenshot
'
,
async
()
=>
{
it
(
'
screenshot
'
,
async
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
await
page
.
waitFor
(
async
()
=>
{
await
page
.
waitFor
(
async
()
=>
{
return
await
page
.
data
(
'
loadFinish
'
)
===
true
;
return
await
page
.
data
(
'
loadFinish
'
)
===
true
;
});
});
...
...
pages/component/web-view/web-view.test.js
浏览文件 @
5b3b259c
// 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/
describe
(
'
component-native-web-view
'
,
()
=>
{
describe
(
'
component-native-web-view
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
page
;
let
page
;
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/web-view/web-view
'
);
page
=
await
program
.
reLaunch
(
'
/pages/component/web-view/web-view
'
);
...
...
pages/pages.test.js
浏览文件 @
5b3b259c
...
@@ -121,7 +121,7 @@ const pages = [
...
@@ -121,7 +121,7 @@ const pages = [
// '/pages/API/element-draw/element-draw',
// '/pages/API/element-draw/element-draw',
]
]
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
)
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
// 规避 web 端不支持页面
// 规避 web 端不支持页面
pages
.
push
(
pages
.
push
(
"
/pages/component/list-view/list-view
"
,
"
/pages/component/list-view/list-view
"
,
...
...
pages/template/custom-refresher/custom-refresher.uvue
浏览文件 @
5b3b259c
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
:refresher-enabled="true" :refresher-triggered="refresherTriggered" refresher-default-style="none"
:refresher-enabled="true" :refresher-triggered="refresherTriggered" refresher-default-style="none"
@refresherpulling="onRefresherpulling"
@refresherpulling="onRefresherpulling"
@refresherrefresh="onRefresherrefresh"
@refresherrefresh="onRefresherrefresh"
@refresherrestore="onRefreshrestore"
:refresher-threshold="refresherThreshold"
:refresher-threshold="refresherThreshold"
>
>
<view v-for="i in 20" class="content-item">
<view v-for="i in 20" class="content-item">
...
@@ -43,9 +44,6 @@
...
@@ -43,9 +44,6 @@
onRefresherpulling(e:RefresherEvent){
onRefresherpulling(e:RefresherEvent){
// console.log('onRefresherpulling',e.detail.dy)
// console.log('onRefresherpulling',e.detail.dy)
this.pullingDistance = e.detail.dy
this.pullingDistance = e.detail.dy
if (this.pullingDistance.toDouble() == 0.0) {
this.resetting = false;
}
},
},
onRefresherrefresh(){
onRefresherrefresh(){
this.refresherTriggered = true
this.refresherTriggered = true
...
@@ -53,12 +51,10 @@
...
@@ -53,12 +51,10 @@
this.refresherTriggered = false
this.refresherTriggered = false
},1500)
},1500)
},
},
// onRefresherrestore(e:RefresherEvent){
onRefreshrestore() {
// console.log('onRefresherrestore',e)
this.pullingDistance = 0
// },
this.resetting = false;
// onRefresherabort(e:RefresherEvent){
}
// console.log('onRefresherabort',e)
// },
}
}
}
}
</script>
</script>
...
...
pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js
浏览文件 @
5b3b259c
...
@@ -237,7 +237,7 @@ const PAGE_PATH =
...
@@ -237,7 +237,7 @@ const PAGE_PATH =
describe
(
"
shot-compare
"
,
()
=>
{
describe
(
"
shot-compare
"
,
()
=>
{
let
shouldCompareScreenShot
=
false
let
shouldCompareScreenShot
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
shouldCompareScreenShot
=
version
>
9
shouldCompareScreenShot
=
version
>
9
...
...
pages/webview-screenshot/webview-screenshot.test.js
浏览文件 @
5b3b259c
...
@@ -236,7 +236,7 @@ const PAGE_PATH =
...
@@ -236,7 +236,7 @@ const PAGE_PATH =
describe
(
"
shot-compare
"
,
()
=>
{
describe
(
"
shot-compare
"
,
()
=>
{
let
shouldCompareScreenShot
=
false
let
shouldCompareScreenShot
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
shouldCompareScreenShot
=
version
>
9
shouldCompareScreenShot
=
version
>
9
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录