提交 5b3b259c 编写于 作者: DCloud_iOS_WZT's avatar DCloud_iOS_WZT

Merge branch 'dev' of https://gitcode.net/dcloud/hello-uni-app-x into dev

...@@ -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 {
......
...@@ -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": {
......
...@@ -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);
} }
}) })
......
...@@ -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
......
<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>
...@@ -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");
......
...@@ -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)
})
}); });
...@@ -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>
...@@ -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: "显示一段轻提示",
......
...@@ -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
......
...@@ -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模拟器不截图 导致闪退
......
...@@ -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('')
})
}) })
...@@ -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>
...@@ -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>
...@@ -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)
......
...@@ -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,
......
...@@ -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({
disableValue: str inputMaxLengthValue: str
}) })
let length = (await input.attribute("value")).length let length = (await input.attribute("value")).length
expect(length).toBe(140) expect(length).toBe(10)
await page.setData({ await page.setData({
disableValue: "" inputMaxLengthValue: ""
}) })
}) })
......
...@@ -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: {
......
<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>
......
...@@ -64,10 +64,10 @@ ...@@ -64,10 +64,10 @@
data() { data() {
return { return {
items: [] as Item[], items: [] as Item[],
refresherEnabled: false, refresherEnabled: true,
refresherTriggered: false, refresherTriggered: false,
refresherThreshold: 45, refresherThreshold: 45,
refresherDefaultStyle: "white", refresherDefaultStyle: "black",
refresherBackground: "transparent", refresherBackground: "transparent",
} }
}, },
......
// 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');
......
...@@ -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')
} }
......
...@@ -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
})
}) })
}) })
...@@ -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 = "修改设置高度文本";
} }
} }
} }
......
...@@ -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;
}); });
......
// 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');
......
...@@ -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",
......
...@@ -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>
......
...@@ -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
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册