Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
d95ace7a
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看板
提交
d95ace7a
编写于
1月 25, 2024
作者:
shutao-dc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pages.test.js部分scroll-view示例自动化截图功能转到scroll-view目录xx.test.js示例中。截图时限制滚动条显示 防止滚动条截图可能消失问题
上级
b5c380fd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
47 addition
and
10 deletion
+47
-10
pages/component/scroll-view/scroll-view-props.test.js
pages/component/scroll-view/scroll-view-props.test.js
+12
-1
pages/component/scroll-view/scroll-view-refresher.test.js
pages/component/scroll-view/scroll-view-refresher.test.js
+11
-2
pages/component/scroll-view/scroll-view-refresher.uvue
pages/component/scroll-view/scroll-view-refresher.uvue
+3
-2
pages/component/scroll-view/scroll-view.test.js
pages/component/scroll-view/scroll-view.test.js
+18
-0
pages/component/scroll-view/scroll-view.uvue
pages/component/scroll-view/scroll-view.uvue
+3
-2
pages/pages.test.js
pages/pages.test.js
+0
-3
未找到文件。
pages/component/scroll-view/scroll-view-props.test.js
浏览文件 @
d95ace7a
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
component-native-scroll-view
'
,
()
=>
{
describe
(
'
component-native-scroll-view
-props
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
...
...
@@ -82,4 +82,15 @@ describe('component-native-scroll-view', () => {
expect
(
scrollLeft
-
930
).
toBeGreaterThanOrEqual
(
0
)
})
//截图对比
it
(
'
scroll-view-props-screenshot
'
,
async
()
=>
{
//禁止滚动条
await
page
.
setData
({
showScrollbar
:
false
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toMatchImageSnapshot
();
})
});
pages/component/scroll-view/scroll-view-refresher.test.js
浏览文件 @
d95ace7a
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
test title
'
,
()
=>
{
describe
(
'
component-native-scroll-view-refresher
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view-refresher
'
);
await
page
.
waitFor
(
300
);
});
it
(
'
scroll-view-refresher-screenshot
'
,
async
()
=>
{
//禁止滚动条
await
page
.
setData
({
showScrollbar
:
false
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toMatchImageSnapshot
();
})
it
(
'
check_refresher
'
,
async
()
=>
{
await
page
.
setData
({
...
...
pages/component/scroll-view/scroll-view-refresher.uvue
浏览文件 @
d95ace7a
...
...
@@ -3,7 +3,7 @@
<page-head title="scroll-view 下拉刷新"></page-head>
<scroll-view class="scroll" refresher-enabled=true :refresher-triggered="refresherTriggered"
@refresherrefresh="onRefresherrefresh" @refresherabort="onRefresherabort" @refresherrestore="onRefresherrestore"
@refresherpulling="onRefresherpulling" @scrolltolower="onScrolltolower">
@refresherpulling="onRefresherpulling" @scrolltolower="onScrolltolower"
:show-scrollbar="showScrollbar"
>
<view v-for="key in scrollData" :key="key">
<view class="scroll-item">
<text class="scroll-item-title">{{key}}</text>
...
...
@@ -18,7 +18,8 @@
return {
scrollData: [] as Array<string>,
refresherTriggered: false,
refresherrefresh: false
refresherrefresh: false,
showScrollbar: true
};
},
onLoad() {
...
...
pages/component/scroll-view/scroll-view.test.js
0 → 100644
浏览文件 @
d95ace7a
describe
(
'
component-native-scroll-view
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view
'
);
await
page
.
waitFor
(
300
);
});
it
(
'
scroll-view-screenshot
'
,
async
()
=>
{
//禁止滚动条
await
page
.
setData
({
showScrollbar
:
false
})
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toMatchImageSnapshot
();
});
});
pages/component/scroll-view/scroll-view.uvue
浏览文件 @
d95ace7a
...
...
@@ -11,7 +11,7 @@
</view>
<view>
<scroll-view :scroll-top="scrollTop" direction="vertical" class="scroll-Y" scroll-with-animation="true"
@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
:show-scrollbar="showScrollbar"
>
<view class="scroll-view-item uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item uni-bg-green"><text class="text">B</text></view>
<view class="scroll-view-item uni-bg-blue"><text class="text">C</text></view>
...
...
@@ -26,7 +26,7 @@
<text class="uni-subtitle-text">横向滚动</text>
</view>
<view>
<scroll-view class="scroll-view_H" direction="horizontal" @scroll="scroll" :scroll-left="120">
<scroll-view class="scroll-view_H" direction="horizontal" @scroll="scroll" :scroll-left="120"
:show-scrollbar="showScrollbar"
>
<view class="scroll-view-item_H uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item_H uni-bg-green"><text class="text">B</text></view>
<view class="scroll-view-item_H uni-bg-blue"><text class="text">C</text></view>
...
...
@@ -70,6 +70,7 @@
return {
scrollTop: 0,
oldScrollTop: 0,
showScrollbar: true
}
},
methods: {
...
...
pages/pages.test.js
浏览文件 @
d95ace7a
...
...
@@ -22,10 +22,7 @@ const pages = [
'
/pages/component/rich-text/rich-text-tags
'
,
'
/pages/component/rich-text/rich-text
'
,
'
/pages/component/scroll-view/scroll-view-custom-refresher-props
'
,
'
/pages/component/scroll-view/scroll-view-props
'
,
'
/pages/component/scroll-view/scroll-view-refresher-props
'
,
'
/pages/component/scroll-view/scroll-view-refresher
'
,
'
/pages/component/scroll-view/scroll-view
'
,
'
/pages/component/slider/slider
'
,
'
/pages/component/slider-100/slider-100
'
,
'
/pages/component/swiper/swiper
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录