提交 69989ccd 编写于 作者: study夏羽's avatar study夏羽

update jest

上级 7bd7da40
......@@ -16,7 +16,7 @@
name:"uni-agreements",
computed:{
agreements(){
return getApp().globalData.config.about.agreements||[]
return getApp({allowDefault: true}).globalData.config.about.agreements||[]
}
},
methods:{
......
......@@ -32,10 +32,10 @@
export default {
computed: {
loginConfig() {
return getApp().globalData.config.router.login
return getApp({allowDefault: true}).globalData.config.router.login
},
agreements() {
return getApp().globalData.config.about.agreements || []
return getApp({allowDefault: true}).globalData.config.about.agreements || []
}
},
data() {
......
......@@ -2,7 +2,7 @@ import App from './App'
import store from './store'
import i18n from './lang/i18n'
uni.showModal = ()=>{};
// uni.showModal = ()=>{};
// #ifndef VUE3
import Vue from 'vue'
......
{
"name" : "uni-starter",
"appid" : "__UNI__D53040B",
"description" : "云端一体应用快速开发模版",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"locales" : {
"en" : {
"name" : "uni-starter",
"android" : {
"strings" : {
"CustomKey" : "CustomValue"
}
},
"ios" : {
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "access to the user’s photo library(read)"
},
"infoPlist" : {
"CustomKey" : "CustomValue"
}
}
},
"zh" : {
"name" : "统一应用基本项目"
}
},
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意",
"buttonRefuse" : "暂不同意"
}
},
"compatible" : {
"ignoreVersion" : true
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : false,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {
"Fingerprint" : {},
"Share" : {},
"OAuth" : {},
"FaceID" : {},
"Push" : {},
"Bluetooth" : {}
},
"distribute" : {
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {
"capabilities" : {
"entitlements" : {
"com.apple.developer.associated-domains" : [ "applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com" ]
}
}
},
"sdkConfigs" : {
"oauth" : {
"apple" : {},
"weixin" : {
"appid" : "",
"appsecret" : "",
"UniversalLinks" : ""
},
"univerify" : {}
},
"ad" : {
"gdt" : {},
"csj" : {}
},
"share" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
}
},
"geolocation" : {},
"push" : {
"unipush" : {}
},
"payment" : {}
},
"icons" : {
"android" : {
"hdpi" : "",
"xhdpi" : "",
"xxhdpi" : "",
"xxxhdpi" : ""
},
"ios" : {
"appstore" : "",
"ipad" : {
"app" : "",
"app@2x" : "",
"notification" : "",
"notification@2x" : "",
"proapp@2x" : "",
"settings" : "",
"settings@2x" : "",
"spotlight" : "",
"spotlight@2x" : ""
},
"iphone" : {
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "",
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
},
"splashscreen" : {
"iosStyle" : "common",
"androidStyle" : "common",
"useOriginalMsgbox" : true
}
},
"nvueLaunchMode" : ""
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx81dbb061d2258234",
"setting" : {
"urlCheck" : false,
"es6" : false
},
"usingComponents" : true,
"betterScopedSlots" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "演示在onShow生命周期获取地理位置"
}
}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"h5" : {
"template" : "",
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : ""
}
}
},
"router" : {
"base" : ""
}
},
"router": {
"base": ""
},
"uniStatistics": {
"enable": true
}
},
"_spaceID": "",
"vueVersion": "2"
"name": "uni-starter",
"appid": "",
"description": "云端一体应用快速开发模版",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
"locales": {
"en": {
"name": "uni-starter",
"android": {
"strings": {
"CustomKey": "CustomValue"
}
},
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "access to the user’s photo library(read)"
},
"infoPlist": {
"CustomKey": "CustomValue"
}
}
},
"zh": {
"name": "统一应用基本项目"
}
},
"privacy": {
"prompt": "template",
"template": {
"title": "服务协议和隐私政策",
"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "同意",
"buttonRefuse": "暂不同意"
}
},
"compatible": {
"ignoreVersion": true
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": false,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {
"Fingerprint": {},
"FaceID": {},
"Push": {},
"Bluetooth": {},
"OAuth": {}
},
"distribute": {
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"]
},
"ios": {
"capabilities": {
"entitlements": {
"com.apple.developer.associated-domains": [
""
]
}
}
},
"sdkConfigs": {
"oauth": {
"weixin": {
"appid": "",
"appsecret": "",
"UniversalLinks": ""
}
},
"ad": {
"gdt": {},
"csj": {}
},
"share": {},
"geolocation": {},
"push": {
"unipush": {}
},
"payment": {}
},
"icons": {
"android": {
"hdpi": "",
"xhdpi": "",
"xxhdpi": "",
"xxxhdpi": ""
},
"ios": {
"appstore": "",
"ipad": {
"app": "",
"app@2x": "",
"notification": "",
"notification@2x": "",
"proapp@2x": "",
"settings": "",
"settings@2x": "",
"spotlight": "",
"spotlight@2x": ""
},
"iphone": {
"app@2x": "",
"app@3x": "",
"notification@2x": "",
"notification@3x": "",
"settings@2x": "",
"settings@3x": "",
"spotlight@2x": "",
"spotlight@3x": ""
}
}
},
"splashscreen": {
"iosStyle": "common",
"androidStyle": "common",
"useOriginalMsgbox": true
}
},
"nvueLaunchMode": ""
},
"quickapp": {},
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": false
},
"usingComponents": true,
"betterScopedSlots": true,
"permission": {
"scope.userLocation": {
"desc": "演示在onShow生命周期获取地理位置"
}
}
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"h5": {
"template": "",
"sdkConfigs": {
"maps": {
"qqmap": {
"key": ""
}
}
},
"router": {
"base": ""
},
"uniStatistics": {
"enable": true
}
},
"_spaceID": "",
"vueVersion": "2"
}
......@@ -41,8 +41,8 @@
},
computed: {
uniStarterConfig() {
console.log(getApp());
return getApp().globalData.config
console.log(getApp({allowDefault: true}),"getApp----------------");
return getApp({allowDefault: true}).globalData.config
}
},
data() {
......@@ -54,6 +54,7 @@
},
created() {
this.about = this.uniStarterConfig.about
console.log("this.about:------ ",this.about);
uni.setNavigationBarTitle({
title: this.$t('about.about')+ " " + this.about.appName
})
......
......@@ -16,12 +16,13 @@ describe('pages/ucenter/login-page/pwd-login/pwd-login.vue', () => {
// expect((await program.currentPage()).path).toBe(
// 'pages/ucenter/login-page/register/register')
console.log(await program.currentPage(),"111111111");
await program.navigateBack()
// await page.waitFor(500)
// 执行 navigateBack 验证是否返回navigateTo
// expect((await program.navigateBack()).path).toBe(
// 'pages/ucenter/login-page/pwd-login/pwd-login')
console.log(await program.currentPage(),"22222222222");
console.log(await program.currentPage(),"22222222222");
})
it('用户名密码登录', async () => {
......
......@@ -158,7 +158,6 @@
},
/* 前往注册 */
toRegister(e) {
console.log(e);
uni.navigateTo({
url: '/pages/ucenter/login-page/register/register'
})
......
......@@ -186,20 +186,26 @@
clickLogout() {
console.log("this.hasLogin:---------------- ",this.hasLogin);
if (this.hasLogin) {
uni.showModal({
title: this.$t('settings.tips'),
content: this.$t('settings.exitLogin'),
cancelText: this.$t('settings.cancelText'),
confirmText: this.$t('settings.confirmText'),
success: res => {
if (res.confirm) {
this.logout()
uni.navigateBack();
}
},
fail: () => {},
complete: () => {}
});
this.logout()
uni.navigateBack();
// uni.showModal({
// title: this.$t('settings.tips'),
// content: this.$t('settings.exitLogin'),
// cancelText: this.$t('settings.cancelText'),
// confirmText: this.$t('settings.confirmText'),
// success: res => {
// if (res.confirm) {
// this.logout()
// uni.navigateBack();
// }
// },
// fail: (err) => {
// console.log("err: ",err);
// },
// complete: (com) => {
// console.log("com: ",com);
// }
// });
} else {
uni.navigateTo({
url: '/pages/ucenter/login-page/index/index'
......@@ -207,10 +213,10 @@
}
},
clearTmp() {
uni.showLoading({
title: this.$t('settings.clearing'),
mask: true
});
// uni.showLoading({
// title: this.$t('settings.clearing'),
// mask: true
// });
/*
任何临时存储或删除不直接影响程序运行逻辑(清除缓存必定造成业务逻辑的变化,如:打开页面的图片不从缓存中读取而从网络请求)的内容都可以视为缓存。主要有storage、和file写入。
缓存分为三部分
......
......@@ -17,14 +17,53 @@ describe('pages/ucenter/ucenter.vue', () => {
// console.log("getUcenterList: ",getUcenterList);
expect(getUcenterList.length).toBe(3)
})
it('普通签到', async () => {
if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM === "mp-weixin") {
await page.callMethod('signIn')
await page.waitFor(300)
const image = await program.screenshot({
path: "static/screenshot/sign-h5.png" // 默认项目根目录 process.env.UNI_PLATFORM === "h5" ||
})
console.log(image, "image--------------------")
}
if (process.env.UNI_PLATFORM === "app-plus") {
const signInByAdRes = await page.callMethod('signInByAd')
console.log("signInByAdRes: ",signInByAdRes);
await page.waitFor(300)
const shareRes = await page.callMethod('share')
console.log("shareRes: ",shareRes);
await page.waitFor(300)
const imageApp = await program.screenshot({
path: "static/screenshot/sign-app.png" // 默认项目根目录 process.env.UNI_PLATFORM === "h5" ||
})
console.log(imageApp, "imageApp--------------------")
}
})
it('我的积分', async () => {
// expect.assertions(1);
await page.waitFor(300)
const getScoreRes = await page.callMethod('getScore')
console.log("getScoreRes: ", getScoreRes);
if (getScoreRes) {
console.log("今日已签到");
expect(getScoreRes.score).not.toBeUndefined();
expect(getScoreRes.balance).toBeGreaterThanOrEqual(getScoreRes.score);
} else {
console.log("签到失败");
}
// await page.waitFor(500)
// expect(getScoreRes.score).not.toBeUndefined();
})
......
......@@ -167,12 +167,12 @@
// #ifdef APP-PLUS
,
appVersion() {
return getApp().appVersion
return getApp({allowDefault: true}).appVersion
}
// #endif
,
appConfig() {
return getApp().globalData.config
return getApp({allowDefault: true}).globalData.config
}
},
methods: {
......@@ -263,12 +263,14 @@
.then((res) => {
console.log(res,"res------");
const data = res.result.data[0];
console.log("data: ",data);
let msg = '';
msg = data ? (this.$t('mine.currentScore')+ data.balance) : this.$t('mine.noScore');
uni.showToast({
title: msg,
icon: 'none'
});
console.log("msg:---- ",msg);
return data
}).catch((reason)=>{
console.log(reason,'这是失败的操作');
......@@ -278,7 +280,6 @@
// uni.hideLoading()
return e
})
},
async share() {
let {
......
static/screenshot/about-app.png

106.7 KB | W: | H:

static/screenshot/about-app.png

110.6 KB | W: | H:

static/screenshot/about-app.png
static/screenshot/about-app.png
static/screenshot/about-app.png
static/screenshot/about-app.png
  • 2-up
  • Swipe
  • Onion skin
static/screenshot/about-h5.png

55.9 KB | W: | H:

static/screenshot/about-h5.png

61.9 KB | W: | H:

static/screenshot/about-h5.png
static/screenshot/about-h5.png
static/screenshot/about-h5.png
static/screenshot/about-h5.png
  • 2-up
  • Swipe
  • Onion skin
static/screenshot/about-mp.jpg

23.9 KB | W: | H:

static/screenshot/about-mp.jpg

23.9 KB | W: | H:

static/screenshot/about-mp.jpg
static/screenshot/about-mp.jpg
static/screenshot/about-mp.jpg
static/screenshot/about-mp.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,7 +2,7 @@
export default {
"h5": {
"url": "https://uni-starter.dcloud.net.cn", // 前端网页托管的域名
// 在h5端全局悬浮引导用户下载app的功能 更多自定义要求在/common/openApp.js中修改
// 在h5端全局悬浮引导用户下载app的功能 更多自定义要求在/common/openApp.js中修改
// "openApp": { //如不需要本功能直接移除本节点即可
// //点击悬浮下载栏后打开的网页链接
// "openUrl": '/#/pages/ucenter/invite/invite',
......@@ -28,20 +28,11 @@ export default {
2.visitor:白名单模式。枚举游客可访问的页面。
* 注意:黑名单与白名单模式二选一
*/
// "needLogin" : [
// {pattern:/^\/pages\/list.*/}, //支持正则表达式
// "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
// "/uni_modules/uni-feedback/pages/uni-feedback/add"
// ],
"visitor" : [
"/",//注意入口页必须直接写 "/"
{"pattern":/^\/pages\/list.*/}, //支持正则表达式
{"pattern":/^\/pages\/ucenter\/login-page.*/},
"/pages/common/webview/webview",
"/pages/grid/grid",
"/pages/ucenter/ucenter",
"/pages/ucenter/about/about",
"/pages/ucenter/settings/settings"
"needLogin": [{
pattern: /^\/pages\/list.*/
}, //支持正则表达式
// "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
// "/uni_modules/uni-feedback/pages/uni-feedback/add"
],
// "visitor" : [
// "/",//注意入口页必须直接写 "/"
......@@ -50,7 +41,6 @@ export default {
// "/pages/common/webview/webview",
// "/pages/grid/grid",
// "/pages/ucenter/ucenter",
// "/pages/ucenter/guestbook/guestbook",
// "/pages/ucenter/about/about",
// "/pages/ucenter/settings/settings"
// ],
......@@ -60,7 +50,7 @@ export default {
未列举到的,或设备环境不支持的选项,将被隐藏。如果你需要在不同平台有不同的配置,直接用条件编译即可
根据数组的第0项,决定登录方式的第一优先级。
*/
"login": ["username","univerify","weixin", "smsCode", "apple"],
"login": ["username", "univerify", "weixin", "smsCode", "apple"],
// "login": ["univerify"]
},
//关于应用
......@@ -75,30 +65,30 @@ export default {
"slogan": "云端一体应用快速开发模版",
//政策协议
"agreements": [{
"title": "用户服务条款",// 为了多语言国际化请在 lang/en.js 和 lang/zh-Hans.js中配置",
"title": "用户服务条款", // 为了多语言国际化请在 lang/en.js 和 lang/zh-Hans.js中配置",
"url": "https://ask.dcloud.net.cn/protocol.html" //对应的网络链接
},
{
"title": "隐私政策",//为了多语言国际化请在 lang/en.js 和 lang/zh-Hans.js中配置
"title": "隐私政策", //为了多语言国际化请在 lang/en.js 和 lang/zh-Hans.js中配置
"url": "https://ask.dcloud.net.cn/protocol.html"
}
],
//应用的链接,用于分享到第三方平台和生成关于我们页的二维码
"download": "",
//version
"version":"1.0.0" //用于非app端显示,app端自动获取
"version": "1.0.0" //用于非app端显示,app端自动获取
},
"download":{ //用于生成二合一下载页面
"ios":"https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8",
"android":"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-97fca9f2-41f6-449f-a35e-3f135d4c3875/6d754387-a6c3-48ed-8ad2-e8f39b40fc01.apk"
"download": { //用于生成二合一下载页面
"ios": "https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8",
"android": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-97fca9f2-41f6-449f-a35e-3f135d4c3875/6d754387-a6c3-48ed-8ad2-e8f39b40fc01.apk"
},
//用于打开应用市场评分界面
"marketId":{
"ios":"id1417078253",
"android":"123456"
"marketId": {
"ios": "id1417078253",
"android": "123456"
},
//配置多语言国际化。i18n为英文单词 internationalization的首末字符i和n,18为中间的字符数 是“国际化”的简称
"i18n":{
"enable":false //默认关闭,国际化。如果你想使用国际化相关功能,请改为true
"i18n": {
"enable": false //默认关闭,国际化。如果你想使用国际化相关功能,请改为true
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册