diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d57b6802e9ef7eda4c8ad773aed9527fac9d8b43..636d29d6053d9d84549c5cdd871ed24527afe02e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3,6 +3,8 @@
+
+
diff --git a/pages/API/action-sheet/action-sheet.test.js b/pages/API/action-sheet/action-sheet.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..ff37aa33f6aed5d431cfdac18509034e2c673573
--- /dev/null
+++ b/pages/API/action-sheet/action-sheet.test.js
@@ -0,0 +1,540 @@
+// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
+
+describe('API-loading', () => {
+
+ let page;
+ const isAndroid = process.env.UNI_OS_NAME === "android";
+
+ beforeAll(async () => {
+ page = await program.reLaunch('/pages/API/action-sheet/action-sheet')
+ await page.waitFor(200);
+
+ });
+
+
+ it("onload-action-sheet-test", async () => {
+ if (isAndroid) {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+
+ it("action-sheet-test-current-0", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+
+ await page.setData({
+ showErrorToast:false,
+ current: 0,
+ itemContentLarge:false,
+ itemNumLargeSelect:false,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-0-largeContent", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+
+ await page.setData({
+ showErrorToast:false,
+ current: 0,
+ itemContentLarge:true,
+ itemNumLargeSelect:false,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-0-largeContent-largeNum", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+ await page.setData({
+ showErrorToast:false,
+ current: 0,
+ itemContentLarge:true,
+ itemNumLargeSelect:true,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-0-largeContent-largeNum-customColor", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+ await page.setData({
+ showErrorToast:false,
+ current: 0,
+ itemContentLarge:true,
+ itemNumLargeSelect:true,
+ itemColorCustom:true,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+
+ it("action-sheet-test-current-1", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+
+ await page.setData({
+ current: 1,
+ itemContentLarge:false,
+ itemNumLargeSelect:false,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+
+ })
+
+
+
+ it("action-sheet-test-current-1-largeContent", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+
+ await page.setData({
+ showErrorToast:false,
+ current: 1,
+ itemContentLarge:true,
+ itemNumLargeSelect:false,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-1-largeContent-largeNum", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+ await page.setData({
+ showErrorToast:false,
+ current: 1,
+ itemContentLarge:true,
+ itemNumLargeSelect:true,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-1-largeContent-largeNum-customColor", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+ await page.setData({
+ showErrorToast:false,
+ current: 1,
+ itemContentLarge:true,
+ itemNumLargeSelect:true,
+ itemColorCustom:true,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+
+ it("action-sheet-test-current-2", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+
+ await page.setData({
+ current: 2,
+ itemContentLarge:false,
+ itemNumLargeSelect:false,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-2-largeContent", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+
+ await page.setData({
+ showErrorToast:false,
+ current: 2,
+ itemContentLarge:true,
+ itemNumLargeSelect:false,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-2-largeContent-largeNum", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+ await page.setData({
+ showErrorToast:false,
+ current: 2,
+ itemContentLarge:true,
+ itemNumLargeSelect:true,
+ itemColorCustom:false,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+
+ })
+
+
+ it("action-sheet-test-current-2-largeContent-largeNum-customColor", async () => {
+
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+ const windowWidth = res.windowWidth * res.pixelRatio;
+
+ await page.setData({
+ showErrorToast:false,
+ current: 2,
+ itemContentLarge:true,
+ itemNumLargeSelect:true,
+ itemColorCustom:true,
+ })
+
+ const btnToastDurationButton = await page.$('#btn-action-sheet-show')
+ await btnToastDurationButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ width:windowWidth
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+
+});
diff --git a/pages/API/action-sheet/action-sheet.uvue b/pages/API/action-sheet/action-sheet.uvue
index 90deb477d7039c6b301ce4aa1216aabef5edea59..2642faa5868fdc7959b68e3daf3f799f0722d82e 100644
--- a/pages/API/action-sheet/action-sheet.uvue
+++ b/pages/API/action-sheet/action-sheet.uvue
@@ -25,7 +25,7 @@
-
+
@@ -41,7 +41,8 @@
title: 'action-sheet',
itemColorCustom: false,
itemContentLarge: false,
- itemNumLargeSelect: false,
+ itemNumLargeSelect: false,
+ showErrorToast:true,
items: [{
value: '标题',
name: '有标题'
@@ -64,7 +65,11 @@
itemList:['item1', 'item2'],
})
},
- methods: {
+ methods: {
+ //自动化测试例专用
+ jest_getWindowInfo() : GetWindowInfoResult {
+ return uni.getWindowInfo();
+ },
radioChange(e : UniRadioGroupChangeEvent) {
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].value === e.detail.value) {
@@ -127,11 +132,13 @@
})
},
fail: (e) => {
- console.log(e);
- uni.showToast({
- title: e.errMsg,
- icon: "none"
- })
+ console.log(e);
+ if(this.showErrorToast){
+ uni.showToast({
+ title: e.errMsg,
+ icon: "none"
+ })
+ }
}
})
}
diff --git a/pages/API/choose-image/choose-image.uvue b/pages/API/choose-image/choose-image.uvue
index e6cb83e6ffdeeb61553fc980b0ebd0ce5c165098..2a3bb0d5f62677ef1b708bd0bc20d235ddd2767c 100644
--- a/pages/API/choose-image/choose-image.uvue
+++ b/pages/API/choose-image/choose-image.uvue
@@ -29,8 +29,7 @@
数量限制
-
+
@@ -41,7 +40,7 @@
-
+
图片质量(%)
@@ -285,11 +284,11 @@
}
.crop-option {
- border-top-color: lightgray;
- border-width: 1px;
- border-style: solid;
- padding: 10px;
- transition: height;
- transition-duration: 300ms;
+ margin-left: 11px;
+ margin-right: 11px;
+ border-radius: 11px;
+ background-color: #eee;
+ transition-property: height, margin-bottom;
+ transition-duration: 200ms;
}
diff --git a/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue b/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue
index 3a9c8e5a03adc6e20a4e7a97d18fcd1a69b23bc4..04c6a077c3d05cc19b5a036a20bc4cc5390884cd 100644
--- a/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue
+++ b/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue
@@ -7,7 +7,7 @@
是否授权使用摄像头
-
+
@@ -15,7 +15,7 @@
是否授权使用定位
-
+
@@ -23,7 +23,7 @@
定位准确度
-
+
@@ -31,7 +31,7 @@
是否授权使用麦克风
-
+
@@ -39,7 +39,7 @@
是否授权通知
-
+
diff --git a/pages/API/get-app-base-info/get-app-base-info.uvue b/pages/API/get-app-base-info/get-app-base-info.uvue
index c924e277df5ed8a987de7cbb69da953ed67ac90c..46bbcbc2cb51f58d811933baf4a302b77c9fa008 100644
--- a/pages/API/get-app-base-info/get-app-base-info.uvue
+++ b/pages/API/get-app-base-info/get-app-base-info.uvue
@@ -7,7 +7,7 @@
{{item.label}}
-
+
diff --git a/pages/API/get-device-info/get-device-info.uvue b/pages/API/get-device-info/get-device-info.uvue
index 1d575a4eaa1bb92ca1101069a2dc0d95b61ce7a4..02d198c9729126dcb70d7a4a3361395b7600fb14 100644
--- a/pages/API/get-device-info/get-device-info.uvue
+++ b/pages/API/get-device-info/get-device-info.uvue
@@ -14,7 +14,7 @@
}}
-
+
diff --git a/pages/API/get-system-info/get-system-info.uvue b/pages/API/get-system-info/get-system-info.uvue
index 93ab1c83ba7fe24509c2c94b583f0d9a17dbc283..328ed0e1a87c977c24f44b497e48123eeb1e4bd0 100644
--- a/pages/API/get-system-info/get-system-info.uvue
+++ b/pages/API/get-system-info/get-system-info.uvue
@@ -13,7 +13,7 @@
}}
-
+
diff --git a/pages/API/get-system-setting/get-system-setting.uvue b/pages/API/get-system-setting/get-system-setting.uvue
index a20012d52ca590e9ff594bfb689f8d27b24ad1d6..c3b49bbdfca729e3602f15cc7f3d74f3870a9822 100644
--- a/pages/API/get-system-setting/get-system-setting.uvue
+++ b/pages/API/get-system-setting/get-system-setting.uvue
@@ -7,7 +7,7 @@
蓝牙的系统开关
-
+
@@ -15,7 +15,7 @@
地理位置的系统开关
-
+
@@ -23,7 +23,7 @@
Wi-Fi 的系统开关
-
+
@@ -31,7 +31,7 @@
设备方向
-
+
@@ -62,7 +62,15 @@
this.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? "开启" : "关闭";
this.locationEnabled = res.locationEnabled ? "开启" : "关闭";
this.wifiEnabled = (res.wifiEnabled ?? false) ? "开启" : "关闭";
- this.deviceOrientation = res.deviceOrientation
+ this.deviceOrientation = res.deviceOrientation
+
+ if(res.bluetoothError != null){
+ this.bluetoothEnabled = "无蓝牙权限"
+ }
+
+ if(res.wifiError != null){
+ this.wifiEnabled = "无WiFi权限"
+ }
}
}
}
diff --git a/pages/API/get-window-info/get-window-info.uvue b/pages/API/get-window-info/get-window-info.uvue
index 464f473b95c1175d0f69d5b099bd3281ccf7d0b0..e780dc271375e43eb3f45e8324b163d0d09a768f 100644
--- a/pages/API/get-window-info/get-window-info.uvue
+++ b/pages/API/get-window-info/get-window-info.uvue
@@ -7,7 +7,7 @@
{{ item.label }}
-
+
diff --git a/pages/API/loading/loading.uvue b/pages/API/loading/loading.uvue
index 76acb14faa880552659bf95a400398c4284a0d71..468ebbbdfa8174387348744a25022dffe1416f14 100644
--- a/pages/API/loading/loading.uvue
+++ b/pages/API/loading/loading.uvue
@@ -67,6 +67,10 @@
}, 2000);
},
methods: {
+ //自动化测试例专用
+ jest_getWindowInfo() : GetWindowInfoResult {
+ return uni.getWindowInfo();
+ },
radioChange(e : UniRadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => {
diff --git a/pages/API/modal/modal.test.js b/pages/API/modal/modal.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..01f2012bd9a70685f2ed7bf7a3dd30d423690464
--- /dev/null
+++ b/pages/API/modal/modal.test.js
@@ -0,0 +1,702 @@
+// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
+
+describe('API-loading', () => {
+
+ let page;
+ const isAndroid = process.env.UNI_OS_NAME === "android";
+
+ beforeAll(async () => {
+ page = await program.reLaunch('/pages/API/modal/modal')
+ await page.waitFor(200);
+
+ });
+
+
+ it("onload-modal-test", async () => {
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+
+ it("modal-test-current-0", async () => {
+
+ await page.setData({
+ current: 0,
+ showCancelSelect: false,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-1", async () => {
+
+ await page.setData({
+ current: 1,
+ showCancelSelect: false,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: false,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText-confirmText", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: true,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText-confirmText-editable-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: true,
+ editableSelect: true,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-confirmText-editable-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: false,
+ confirmTextSelect: true,
+ editableSelect: true,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-editable-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: true,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: false,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText-editable-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: false,
+ editableSelect: true,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: false,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+
+ it("modal-test-current-2-showCancel-cancelText-confirmText-placeholder", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: true,
+ editableSelect: false,
+ placeholderTextSelect: true,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText-confirmText", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: true,
+ editableSelect: false,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+
+ it("modal-test-current-2-showCancel-cancelText-confirmText-editable", async () => {
+
+ await page.setData({
+ current: 2,
+ showCancelSelect: true,
+ cancelTextSelect: true,
+ confirmTextSelect: true,
+ editableSelect: true,
+ placeholderTextSelect: false,
+ })
+
+ const btnModalButton = await page.$('#btn-modal-show')
+ await btnModalButton.tap()
+ await page.waitFor(500);
+
+ if (isAndroid) {
+ const res = await page.callMethod('jest_getWindowInfo')
+ const windowHeight = res.windowHeight * res.pixelRatio;
+
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ height: windowHeight,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+
+ })
+
+});
diff --git a/pages/API/modal/modal.uvue b/pages/API/modal/modal.uvue
index 0d3acc7e2002d8f275750d9aad35b9b16fe657cb..a17b1c1bdc280010d1644889a14d1893e1611afe 100644
--- a/pages/API/modal/modal.uvue
+++ b/pages/API/modal/modal.uvue
@@ -37,7 +37,7 @@
-
@@ -87,6 +87,10 @@
})
},
methods: {
+ //自动化测试例专用
+ jest_getWindowInfo() : GetWindowInfoResult {
+ return uni.getWindowInfo();
+ },
showCancelChange: function (e : UniSwitchChangeEvent) {
this.showCancelSelect = e.detail.value
},
diff --git a/pages/API/nodes-info/nodes-info.test.js b/pages/API/nodes-info/nodes-info.test.js
index 6db2b9991e1417fefcfbb40e8c5788b248fed207..d219bfe014ecf6b52ded01df564bba630f5ebd47 100644
--- a/pages/API/nodes-info/nodes-info.test.js
+++ b/pages/API/nodes-info/nodes-info.test.js
@@ -10,6 +10,16 @@ describe('nodes-info', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
})
+ it('get-root-node-info', async () => {
+ // 测试 class 选择器
+ await getRootNode('.page')
+
+ // 测试 id 选择器
+ await getRootNode('#page')
+
+ // 测试 标签 选择器
+ // await getRootNode('page')
+ })
it('get-node-info', async () => {
const btnGetNodeInfo = await page.$('.btn-get-node-info')
@@ -53,4 +63,19 @@ describe('nodes-info', () => {
}) */
// #endif
-})
+})
+
+async function getRootNode(selector) {
+ const page = await program.currentPage()
+
+ await page.setData({
+ rootNodeInfo: null,
+ })
+ await page.waitFor(100)
+
+ await page.callMethod('getRootNodeInfo', selector)
+ await page.waitFor(100)
+
+ const data = await page.data()
+ expect(data.rootNodeInfo != null).toBe(true)
+}
diff --git a/pages/API/nodes-info/nodes-info.uvue b/pages/API/nodes-info/nodes-info.uvue
index 299d8e151a0c8205015a253ec6947703012bd97a..47349d2549c08c8ed94cba90cab134148e43be32 100644
--- a/pages/API/nodes-info/nodes-info.uvue
+++ b/pages/API/nodes-info/nodes-info.uvue
@@ -1,5 +1,5 @@
-
+
getNodeInfo
getAllNodeInfo
@@ -53,6 +53,8 @@
return {
title: 'createSelectorQuery',
nodeInfoList: [] as NodeInfoType[],
+ // 仅用于自动化测试
+ rootNodeInfo: null as NodeInfoType | null,
//供自动化测试使用
// resizeRectValid: false
}
@@ -68,6 +70,23 @@
} */
},
methods: {
+ // 仅用于自动化测试
+ getRootNodeInfo(selector: string) {
+ uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {
+ if (ret.length == 1) {
+ const nodeInfo = ret[0] as NodeInfo;
+ const nodeType = {
+ left: nodeInfo.left,
+ top: nodeInfo.top,
+ right: nodeInfo.right,
+ bottom: nodeInfo.bottom,
+ width: nodeInfo.width,
+ height: nodeInfo.height,
+ } as NodeInfoType;
+ this.rootNodeInfo = nodeType
+ }
+ })
+ },
getNodeInfo() {
uni.createSelectorQuery().select('.rect1').boundingClientRect().exec((ret) => {
this.nodeInfoList.length = 0
diff --git a/pages/API/storage/storage.test.js b/pages/API/storage/storage.test.js
index ace9737df4194cddbe31f235a129bc0a77eafa26..1b609e49979d7db020bacda45b694d40a1eb1612 100644
--- a/pages/API/storage/storage.test.js
+++ b/pages/API/storage/storage.test.js
@@ -241,6 +241,42 @@ describe('ExtApi-StorageInfoTest', () => {
expect(parseObj['name']).toEqual('james')
+
+ await page.setData({
+ key: "autotest_key_mock",
+ data:"1234567890"
+ })
+ await page.waitFor(600)
+ btnSetStorageButtonInfo = await page.$('.btn-setstorageSync')
+ await btnSetStorageButtonInfo.tap()
+ await page.waitFor(600)
+ btnGetStorageButtonInfo = await page.$('.btn-getstorageSync')
+ await btnGetStorageButtonInfo.tap()
+ await page.waitFor(600)
+ let strRet = await getData('apiGetData')
+ // 顺序不能保证,验证长度和各个属性来区分
+ expect(typeof strRet).toEqual("string")
+ expect(strRet).toEqual("1234567890")
+
+
+ await page.setData({
+ key: "autotest_key_mock",
+ data:"1234567.890"
+ })
+ await page.waitFor(600)
+ btnSetStorageButtonInfo = await page.$('.btn-setstorageSync')
+ await btnSetStorageButtonInfo.tap()
+ await page.waitFor(600)
+ btnGetStorageButtonInfo = await page.$('.btn-getstorageSync')
+ await btnGetStorageButtonInfo.tap()
+ await page.waitFor(600)
+ let strRet2 = await getData('apiGetData')
+ // 顺序不能保证,验证长度和各个属性来区分
+ expect(typeof strRet2).toEqual("string")
+ expect(strRet2).toEqual("1234567.890")
+
+
+
});
});
diff --git a/pages/API/storage/storage.uvue b/pages/API/storage/storage.uvue
index fd21d8fbb621e00f44be678999ad0832d271e90b..2bfdc94f7116ede588f684849c2bc21b9149014b 100644
--- a/pages/API/storage/storage.uvue
+++ b/pages/API/storage/storage.uvue
@@ -49,11 +49,21 @@
填充浮点型
-
-
- 填充符合json格式的字符串
+
+ 填充json字符串
+
+
+ 填充整数字符串
+
+
+
+
+ 填充浮点字符串
+
+
+ 填充负数字符串
@@ -124,6 +134,19 @@
age: 12,
from: "american"
});
+
+ },
+ longLikeMock() {
+ this.key = 'key_' + Math.random()
+ this.data = "1234567890"
+ },
+ floatLikeMock() {
+ this.key = 'key_' + Math.random()
+ this.data = "321456.1234567890"
+ },
+ negativeLikeMock() {
+ this.key = 'key_' + Math.random()
+ this.data = "-321456"
},
strMock() {
this.key = 'key_' + Math.random()
diff --git a/pages/API/toast/toast.test.js b/pages/API/toast/toast.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..05c94e65e53574e07c3b91b3d6141ad010b17bd6
--- /dev/null
+++ b/pages/API/toast/toast.test.js
@@ -0,0 +1,161 @@
+// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
+
+describe('API-toast', () => {
+
+ let page;
+ const isAndroid = process.env.UNI_OS_NAME === "android";
+
+ beforeAll(async () => {
+ page = await program.reLaunch('/pages/API/toast/toast')
+ await page.waitFor(600);
+ });
+
+
+
+ it("onload-toast-test", async () => {
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+
+
+ it("btn-toast-default-1", async () => {
+ const btnToastDefaultButton = await page.$('#btn-toast-default')
+ await btnToastDefaultButton.tap()
+ await page.waitFor(200)
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+
+
+ it("btn-toast-duration-1", async () => {
+ const btnToastDurationButton = await page.$('#btn-toast-duration')
+ await btnToastDurationButton.tap()
+ await page.waitFor(2000)
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+ it("btn-toast-errorIcon-1", async () => {
+ const btnToastErrorIconButton = await page.$('#btn-toast-errorIcon')
+ await btnToastErrorIconButton.tap()
+ await page.waitFor(200)
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+
+ it("btn-toast-loading-1", async () => {
+ const btnToastLoadingButton = await page.$('#btn-toast-loading')
+ await btnToastLoadingButton.tap()
+ await page.waitFor(200)
+
+ const btnToastHideButton = await page.$('#btn-toast-hide')
+ await btnToastHideButton.tap()
+ await page.waitFor(200)
+
+ if (isAndroid) {
+ const image = await program.screenshot({
+ adb: true,
+ area: {
+ x: 0,
+ y: 200,
+ },
+ });
+ expect(image).toMatchImageSnapshot();
+ }else{
+ const image = await program.screenshot({
+ adb: true,
+ fullPage: true
+ });
+ expect(image).toMatchImageSnapshot()
+ }
+ })
+
+
+ // it("btn-toast-postion-bottom-1", async () => {
+ // const btnToastButton = await page.$('#btn-toast-postion-bottom')
+ // await btnToastButton.tap()
+ // await page.waitFor(200)
+ // if (isAndroid) {
+ // const windowHeight = uni.getWindowInfo().windowHeight;
+ // const windowWidth = uni.getWindowInfo().windowWidth;
+ // const image = await program.screenshot({
+ // adb: true,
+ // area: {
+ // x: 0,
+ // y: 200,
+ // height: windowHeight,
+ // width:windowWidth
+ // },
+ // });
+ // expect(image).toMatchImageSnapshot();
+ // }else{
+ // const image = await program.screenshot({
+ // adb: true,
+ // fullPage: true
+ // });
+ // expect(image).toMatchImageSnapshot()
+ // }
+ // })
+
+
+
+});
diff --git a/pages/API/toast/toast.uvue b/pages/API/toast/toast.uvue
index 4e6b8f96b17eaf6992fb895e2341ff798bea7383..8ad3f8a08a7e70fb9596bf284b2e499990fec8c4 100644
--- a/pages/API/toast/toast.uvue
+++ b/pages/API/toast/toast.uvue
@@ -3,17 +3,17 @@
- 点击弹出默认toast
- 点击弹出设置icon的toast
- 点击弹出设置duration的toast
- 点击弹出显示loading的toast
+ 点击弹出默认toast
+ 点击弹出设置icon的toast
+ 点击弹出设置duration的toast
+ 点击弹出显示loading的toast
点击弹出显示自定义图片的toast
- 点击显示无图标的居底toast
+ 点击显示无图标的居底toast
- 点击隐藏toast
+ 点击隐藏toast
{{exeRet}}
@@ -41,7 +41,7 @@
uni.showToast({
title: "默认",
success: (res) => {
- this.exeRet = "success:" + JSON.stringify(res) + new Date()
+ this.exeRet = "success:" + JSON.stringify(res)
},
fail: (res) => {
this.exeRet = "fail:" + JSON.stringify(res)
@@ -53,7 +53,7 @@
title: "默认",
icon: 'error',
success: (res) => {
- this.exeRet = "success:" + JSON.stringify(res) + new Date()
+ this.exeRet = "success:" + JSON.stringify(res)
},
fail: (res) => {
this.exeRet = "fail:" + JSON.stringify(res)
@@ -65,7 +65,7 @@
title: "duration 3000",
duration: 3000,
success: (res) => {
- this.exeRet = "success:" + JSON.stringify(res) + new Date()
+ this.exeRet = "success:" + JSON.stringify(res)
},
fail: (res) => {
this.exeRet = "fail:" + JSON.stringify(res)
@@ -78,7 +78,7 @@
icon: "loading",
duration: 5000,
success: (res) => {
- this.exeRet = "success:" + JSON.stringify(res) + new Date()
+ this.exeRet = "success:" + JSON.stringify(res)
},
fail: (res) => {
this.exeRet = "fail:" + JSON.stringify(res)
@@ -90,7 +90,7 @@
title: "logo",
image: "/static/uni.png",
success: (res) => {
- this.exeRet = "success:" + JSON.stringify(res) + new Date()
+ this.exeRet = "success:" + JSON.stringify(res)
},
fail: (res) => {
this.exeRet = "fail:" + JSON.stringify(res)
@@ -103,7 +103,7 @@
title: "显示一段轻提示",
position: 'bottom',
success: (res) => {
- this.exeRet = "success:" + JSON.stringify(res) + new Date()
+ this.exeRet = "success:" + JSON.stringify(res)
},
fail: (res) => {
this.exeRet = "fail:" + JSON.stringify(res)
diff --git a/pages/component/input/input.uvue b/pages/component/input/input.uvue
index bb444764261a02f1716efaca146154dbafe06f1f..5d44bd09f8c60b6d42e2291b018fbf4de4e0490a 100644
--- a/pages/component/input/input.uvue
+++ b/pages/component/input/input.uvue
@@ -127,7 +127,7 @@
设置输入框聚焦时光标的位置(点击生效)
-
+
@@ -137,7 +137,7 @@
+ :selection-end="selectionEnd" @blur="onSelectionBlurChange"/>
@@ -269,22 +269,28 @@
}
},
methods: {
- inputFocusKeyBoardChange(e : InputKeyboardHeightChangeEvent) {
+ inputFocusKeyBoardChange(e : UniInputKeyboardHeightChangeEvent) {
this.inputFocusKeyBoardChangeValue = e.detail.height > 50
},
- onMaxLengthInput(event : InputEvent) {
+ onMaxLengthInput(event : UniInputEvent) {
this.onMaxLengthInputValue = event.detail.value
},
setCursor: function (cursor : number) {
(this.$refs['input'] as UniInputElement).focus();
- this.cursor = cursor;
+ this.cursor = cursor;
+ },
+ onCursorBlurChange(){
+ this.cursor = 0
},
setSelection: function (selectionStart : number, selectionEnd : number) {
(this.$refs['input2'] as UniInputElement).focus();
this.selectionStart = selectionStart;
- this.selectionEnd = selectionEnd;
+ this.selectionEnd = selectionEnd;
+ },
+ onSelectionBlurChange(){
+ this.selectionEnd = 0;
},
- clearInput: function (event : InputEvent) {
+ clearInput: function (event : UniInputEvent) {
this.inputClearValue = event.detail.value
if (event.detail.value.length > 0) {
this.showClearIcon = true
@@ -299,23 +305,23 @@
changePassword: function () {
this.showPassword = !this.showPassword
},
- onInput: function (event : InputEvent) {
+ onInput: function (event : UniInputEvent) {
console.log("键盘输入", JSON.stringify(event.detail));
this.inputEventDetail = JSON.stringify(event.detail)
},
- onFocus: function (event : InputFocusEvent) {
+ onFocus: function (event : UniInputFocusEvent) {
console.log("输入框聚焦", JSON.stringify(event.detail));
this.focusAndBlurEventDetail = JSON.stringify(event.detail);
},
- onBlur: function (event : InputBlurEvent) {
+ onBlur: function (event : UniInputBlurEvent) {
console.log("输入框失去焦点", JSON.stringify(event.detail));
this.focusAndBlurEventDetail = JSON.stringify(event.detail);
},
- onConfirm: function (event : InputConfirmEvent) {
+ onConfirm: function (event : UniInputConfirmEvent) {
console.log("点击完成按钮", JSON.stringify(event.detail));
this.confirmEventDetail = JSON.stringify(event.detail);
},
- onKeyborardHeightChange: function (event : InputKeyboardHeightChangeEvent) {
+ onKeyborardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {
console.log("键盘高度发生变化", JSON.stringify(event.detail));
this.keyboardHeightChangeEventDetail = JSON.stringify(event.detail);
},
diff --git a/pages/component/textarea/textarea.uvue b/pages/component/textarea/textarea.uvue
index 40c0c2df017d3dd2f5b76b9f5735fc129b585002..2bddb7989c827f8b25ddff53c00bac0cb55df698 100644
--- a/pages/component/textarea/textarea.uvue
+++ b/pages/component/textarea/textarea.uvue
@@ -10,7 +10,7 @@ export default {
confirm_hold_boolean: false,
focus_boolean: true,
auto_focus_boolean: false,
- default_value:"",
+ default_value:"1\n2\n3\n4\n5\n6",
maxlength:-1,
inputmode_enum: [{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"},{"value":0,"name":"none"}] as ItemType[],
cursor_color: "#3393E2",
diff --git a/pages/template/custom-tab-bar/custom-tab-bar.uvue b/pages/template/custom-tab-bar/custom-tab-bar.uvue
index c633bdc1fff5a89254c31a873e26a440be37202a..bf15977647c8fe6f658327051cc67edbef98840f 100644
--- a/pages/template/custom-tab-bar/custom-tab-bar.uvue
+++ b/pages/template/custom-tab-bar/custom-tab-bar.uvue
@@ -80,10 +80,11 @@
},
methods: {
onTabClick(index : number) {
- this.setSelectedIndex(index);
- if (index == 0) {
+ if (this.selectedIndex == index && index == 0) {
+ this.displayArrow = false;
(this.$refs["tab1"]! as ComponentPublicInstance).$callMethod('scrollTop', 0)
}
+ this.setSelectedIndex(index);
},
onTabPageEvent(top : number) {
this.displayArrow = top > this.tabViewHeight
diff --git a/pages/template/drop-card/drop-card.uvue b/pages/template/drop-card/drop-card.uvue
index 6645ca77fe2dc247df3bc52ec974dce8d65d8ff3..4a632220f4b832b35f8fbf11f1109fe9a3467e79 100644
--- a/pages/template/drop-card/drop-card.uvue
+++ b/pages/template/drop-card/drop-card.uvue
@@ -17,12 +17,12 @@
'/static/template/drop-card/1.jpg',
'/static/template/drop-card/2.jpg',
'/static/template/drop-card/3.jpg'
- ] as string[]
+ ] as string.ImageURIString[]
}
}
}
-