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}} -