提交 04d7543a 编写于 作者: DCloud-yyl's avatar DCloud-yyl

Merge branch 'dev' into alpha

......@@ -6,7 +6,7 @@ const {
const hbuilderx_version = process.env.HX_Version
const uniTestPlatformInfo = process.env.uniTestPlatformInfo ? process.env.uniTestPlatformInfo.replace(/\s/g,'_') : ''
const folderName = `__image_snapshots__/${hbuilderx_version}/__${uniTestPlatformInfo}__`
const baseFolderName = `__image_snapshots__/base`
const baseFolderName = `__image_snapshots__/base/__${uniTestPlatformInfo}__`
expect.extend({
toMatchImageSnapshot: configureToMatchImageSnapshot({
......
{
"name" : "hello-uniapp x",
"appid" : "__UNI__3584C99",
"description" : "",
"versionName" : "1.0.10",
"versionCode" : 10010,
"uni-app-x" : {},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"app": {
"duts": [
"uni-facialRecognitionVerify"
]
},
"vueVersion" : "3"
}
{
"name": "hello-uniapp x",
"appid": "__UNI__3584C99",
"description": "",
"versionName": "1.0.11",
"versionCode": 10011,
"uni-app-x":
{
},
/* 快应用特有相关 */
"quickapp":
{
},
/* 小程序特有相关 */
"mp-weixin":
{
"appid": "",
"setting":
{
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay":
{
"usingComponents": true
},
"mp-baidu":
{
"usingComponents": true
},
"mp-toutiao":
{
"usingComponents": true
},
"uniStatistics":
{
"enable": false
},
"app":
{
},
"vueVersion": "3"
}
\ No newline at end of file
......@@ -1001,6 +1001,14 @@
"navigationBarTitleText" : "getDrawableContext",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/component/transition-event/transition-event",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],
......
<template>
<view>
<page-head id="page-head" title="getElementById"></page-head>
<view class="uni-padding-wrap" id="snapshot-content">
<view id="snapshot-content">
<page-head id="page-head" title="对本页面根view截图"></page-head>
<view class="uni-padding-wrap">
<text id="text">this is text</text>
<view id="view" class="uni-common-mt" style="border: 1px solid red">this is view</view>
</view>
<button class="uni-btn" @click="changeViewStyle">
修改 view 宽高及背景色
</button>
<button class="uni-btn btn-TakeSnapshot" type="primary" @tap="takeSnapshotClick">
点击截图
点击截图并替换显示下方图片
</button>
<image style="margin-top: 20px;" :src="snapImage" mode="aspectFit" @longpress="saveToAlbum"></image>
</view>
......@@ -24,16 +19,6 @@
}
},
methods: {
changeViewStyle() {
const text = uni.getElementById('text')!
text.style.setProperty('color', 'red')
const view = uni.getElementById('view')!
view.style.setProperty('width', '90%')
view.style.setProperty('height', '50px')
view.style.setProperty('backgroundColor', '#007AFF')
},
takeSnapshotClick() {
const view = uni.getElementById('snapshot-content')!
view.takeSnapshot({
......
......@@ -11,7 +11,7 @@ describe('navigator', () => {
const btnNavigate = await page.$('.navigate')
await btnNavigate.tap()
await page.waitFor(100)
await page.waitFor(300)
const currentPage = await program.currentPage()
expect(currentPage.path).toBe(PAGE_PATH_NAVIGATE.substring(1))
......@@ -22,7 +22,7 @@ describe('navigator', () => {
const btnRedirect = await page.$('.redirect')
await btnRedirect.tap()
await page.waitFor(100)
await page.waitFor(300)
const currentPage = await program.currentPage()
expect(currentPage.path).toBe(PAGE_PATH_REDIRECT.substring(1))
......
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('transition event', () => {
let page;
beforeAll(async () => {
page = await program.reLaunch('/pages/component/transition-event/transition-event')
await page.waitFor(3000);
});
it('transitionend', async () => {
await page.callMethod('switchBtn')
await page.waitFor(3000)
expect(await page.data("onTransitionEndTriggr")).toBe(true)
});
});
<template>
<!-- #ifdef APP -->
<scroll-view style="flex:1">
<!-- #endif -->
<button @click="switchBtn">{{buttonValue}}</button>
<image class="transition-transform" id="transition-transform" @transitionend="onEnd" src="/static/uni.png"></image>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
times: 0,
element: null as Element | null,
isStart: false,
buttonValue: "开启图片旋转",
onTransitionEndTriggr: false
}
},
methods: {
switchBtn() {
if (!this.isStart) {
if (this.element == null) {
this.element = uni.getElementById('transition-transform')
}
this.buttonValue = "关闭图片旋转"
this.times = this.times + 1
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
this.element!.style.setProperty('transition-duration', '2000')
this.isStart = true
} else {
this.isStart = false
this.times = 0
this.buttonValue = "开启图片旋转"
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
this.element!.style.setProperty('transition-duration', '0')
}
},
onEnd() {
if (this.isStart) {
this.times = this.times + 1
this.element!.style.setProperty('transform', 'rotate(' + this.times * 360 + 'deg)')
this.onTransitionEndTriggr = true
}
}
}
}
</script>
<style>
.transition-transform {
width: 400rpx;
height: 400rpx;
margin: 50rpx auto;
border-radius: 200rpx;
transition-duration: 2000;
transition-property: transform;
transition-timing-function: linear;
transform: rotate(0deg);
}
</style>
<template>
<view class="page">
<unicloud-db ref="udb" v-slot:default="{data, loading, error}" :collection="collection" loadtime="manual">
<view v-if="error" class="error">{{error}}</view>
<unicloud-db ref="udb" v-slot:default="{error}" :collection="collection" loadtime="manual">
<view v-if="error!=null" class="error">{{error.errMsg}}</view>
</unicloud-db>
<view class="form-item">
<text class="form-item-label">姓名</text>
......@@ -126,4 +126,4 @@
.btn-add {
margin-top: 50px;
}
</style>
\ No newline at end of file
</style>
......@@ -37,6 +37,7 @@ const pages = [
'/pages/component/view/view',
// '/pages/component/web-view/web-view', // 动态内容
'/pages/component/web-view-local/web-view-local',
'/pages/component/transition-event/transition-event',
// CSS
'/pages/CSS/background/background-color',
......
......@@ -254,6 +254,10 @@ export default {
name: '通用事件',
url: '/pages/component/general-event/general-event',
enable: true,
},{
name: 'Transition事件',
url: '/pages/component/transition-event/transition-event',
enable: true,
},
] as Page[],
}
......
......@@ -7,9 +7,9 @@
</list-item>
<sticky-header>
<view style="width: 100%;height:44px;background-color: #f5f5f5;flex-direction: row;justify-content:center;align-items:center;">
<button style="height: 40px;font-size: 13px;" v-for="(name,index) in th_item" @click="clickTH(index)">
<text v-for="(name,index) in th_item" @click="clickTH(index)" style="margin-right: 20px;">
{{name}}
</button>
</text>
</view>
</sticky-header>
<list-item v-for="(value, index) in listData" :key="index">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册