diff --git a/pages/API/get-background-audio-manager/get-background-audio-manager.uvue b/pages/API/get-background-audio-manager/get-background-audio-manager.uvue index 5ceb76dbe2f12d3656e3837a7e75335eb8dfec18..0d0521f386af77d1be2b714ede5b969a945a90a7 100644 --- a/pages/API/get-background-audio-manager/get-background-audio-manager.uvue +++ b/pages/API/get-background-audio-manager/get-background-audio-manager.uvue @@ -2,7 +2,7 @@ - 注意:离开当前页面后背景音乐将保持播放,但退出uni-app将停止 + 注意:离开当前页面后背景音乐将保持播放 @@ -38,8 +38,7 @@ onLoad: function () { let bgAudioMannager = uni.getBackgroundAudioManager(); bgAudioMannager.title = '致爱丽丝'; - bgAudioMannager.epname = '致爱丽丝' - bgAudioMannager.singer = '暂无'; + bgAudioMannager.singer = '路德维希·范·贝多芬'; bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg'; bgAudioMannager.onPlay(() => { @@ -52,14 +51,12 @@ }) bgAudioMannager.onEnded(() => { this.playing = false; - // this.playTime = this.playTime = 0; - // thi.formatedPlayTime = this.formatedPlayTime }) bgAudioMannager.onNext(() => { console.log("下一曲"); this.bgAudioMannager?.stop() bgAudioMannager.title = '致爱丽丝' + this.count++; - bgAudioMannager.singer = '暂无2' + this.count++; + bgAudioMannager.singer = '路德维希·范·贝多芬'; bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg'; this.bgAudioMannager!.src = this.dataUrl; this.bgAudioMannager?.play() @@ -68,17 +65,10 @@ console.log("上一曲"); this.bgAudioMannager?.stop() bgAudioMannager.title = '致爱丽丝' + this.count--; - bgAudioMannager.singer = '暂无' + this.count--; + bgAudioMannager.singer = '路德维希·范·贝多芬'; this.bgAudioMannager!.src = this.dataUrl; this.bgAudioMannager?.play() }) - // bgAudioMannager.onTimeUpdate((e) => { - // if (Math.floor(bgAudioMannager.currentTime) > Math.floor(this.playTime)) { - // this.$backgroundAudioData.formatedPlayTime = this.formatedPlayTime = util.formatTime(Math.floor(bgAudioMannager.currentTime)); - // } - // this.$backgroundAudioData.playTime = this.playTime = bgAudioMannager.currentTime; - // }) - this.bgAudioMannager = bgAudioMannager; }, methods: { @@ -142,5 +132,6 @@ .page-body-button { flex-direction: row; justify-content: center; + margin-bottom: 10px; } - \ No newline at end of file + diff --git a/pages/component/grid-view/grid-view.test.js b/pages/component/grid-view/grid-view.test.js index deb6dae20e253ededf27430e12b5de7e43758f3b..583f15c275478c7064fa926853804fb1e526c9b0 100644 --- a/pages/component/grid-view/grid-view.test.js +++ b/pages/component/grid-view/grid-view.test.js @@ -2,7 +2,7 @@ const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase() const isMP = platformInfo.startsWith('mp') describe('component-native-grid-view', () => { - if (isMP) { + if (isMP || platformInfo.indexOf('web') > -1) { it('skip mp', () => { expect(1).toBe(1) }) @@ -14,7 +14,7 @@ describe('component-native-grid-view', () => { //打开grid-view测试页 page = await program.reLaunch('/pages/component/grid-view/grid-view') await page.waitFor(600) - }) + }) //检测竖向scrolltop属性赋值 it('check_scroll_top', async () => { @@ -63,9 +63,9 @@ describe('component-native-grid-view', () => { endPoint: { x: 100, y: 100 }, duration: 100 }) - await page.waitFor(600) + await page.waitFor(1200) const endDetail = await page.data('scrollEndDetailTest') - // console.log('scrollEndDetailTest:', endDetail) + console.log('scrollEndDetailTest:', endDetail) expect(endDetail.deltaY).toBe(0) expect(endDetail.deltaX).toBe(0) expect(endDetail.scrollLeft).toBe(0) @@ -81,7 +81,7 @@ describe('component-native-grid-view', () => { expect(value).toBe(true) }) - // //检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误 + //检测下拉刷新 备注:iOS本地测试结果正确,但是自动化测试结果错误 it('check_refresher', async () => { await page.callMethod('confirm_scroll_top_input', 0) await page.setData({ diff --git a/pages/component/list-view/list-view.test.js b/pages/component/list-view/list-view.test.js index 047b9fea485f59a6019cdc5ae51fe9e049963c9a..42f29be5b8506d44deb40b8aed235280b9afcdd4 100644 --- a/pages/component/list-view/list-view.test.js +++ b/pages/component/list-view/list-view.test.js @@ -90,9 +90,9 @@ describe('component-native-list-view', () => { endPoint: { x: 100, y: 100 }, duration: 100 }) - await page.waitFor(600) + await page.waitFor(1600) const endDetail = await page.data('scrollEndDetailTest') - // console.log('scrollEndDetailTest:', endDetail) + console.log('scrollEndDetailTest:', endDetail) expect(endDetail.deltaY).toBe(0) expect(endDetail.deltaX).toBe(0) expect(endDetail.scrollLeft).toBe(0) diff --git a/pages/component/map/map.test.js b/pages/component/map/map.test.js index adfc8bef143cd084e663a6283141b5c300639faa..b5405ebdaee53ff6c5d4280d950f5f269186c3a3 100644 --- a/pages/component/map/map.test.js +++ b/pages/component/map/map.test.js @@ -1,11 +1,6 @@ let page; describe('web-map', () => { - if (!process.env.uniTestPlatformInfo.startsWith('web')) { - it('app', () => { - expect(1).toBe(1) - }) - return - } + beforeAll(async () => { page = await program.reLaunch('/pages/component/map/map') await page.waitFor('view'); @@ -16,6 +11,26 @@ describe('web-map', () => { await page.callMethod('updateAutoTest',true) }); + it('handleMoveToLocation', async () => { + await page.callMethod('handleMoveToLocation') + await page.waitFor(500); + const moveToLocationRes = await page.data('jestResult') + expect(moveToLocationRes.moveToLocationMsg).toBe("moveToLocation:ok"); + }); + + it('Check EventDetail JsonStringify', async () => { + const res = await page.data('jestResult') + console.log(res.eventDetailJsonStringify); + expect(res.eventDetailJsonStringify).not.toBe("{}"); + }) + + if (!process.env.uniTestPlatformInfo.startsWith('web')) { + it('app', () => { + expect(1).toBe(1) + }) + return + } + it('Check MapMethods', async () => { const mapMethods = ['addControls', 'addMarkers', 'addMarkersLabel','removeMarker','addPolyline','removePolyline', 'addPolygons','removePolygon', 'addCircles','removeCircle','includePoint'] for (var i = 0; i < mapMethods.length; i++) { @@ -58,12 +73,7 @@ describe('web-map', () => { expect(translateMarkerRes.translateMarkerMsg).toBe('translateMarker:ok'); }); - it('handleMoveToLocation', async () => { - await page.callMethod('handleMoveToLocation') - await page.waitFor(500); - const moveToLocationRes = await page.data('jestResult') - expect(moveToLocationRes.moveToLocationMsg).toBe("moveToLocation:ok"); - }); + it('handleGetScale', async () => { await page.callMethod('handleGetScale') @@ -73,5 +83,4 @@ describe('web-map', () => { expect(scaleRes.scale).toBeLessThanOrEqual(18); console.log("jestResult",await page.data()) }); - }); diff --git a/pages/component/map/map.uvue b/pages/component/map/map.uvue index fb94420525f2494bad845c98bfb8a3e6abfe3f1a..294b95f19bc150dff2e8d5e8f06677519ab0916f 100644 --- a/pages/component/map/map.uvue +++ b/pages/component/map/map.uvue @@ -59,7 +59,8 @@ southwest : LocationObject, northeast : LocationObject, moveToLocationMsg : string, - scale : number + scale : number, + eventDetailJsonStringify: string, } const testMarkers :Marker[]= [{ @@ -344,7 +345,8 @@ longitude: 0 }, moveToLocationMsg: "", - scale: 0, + scale: 0, + eventDetailJsonStringify: "{}" } as TypeJestResult); @@ -632,11 +634,18 @@ }) } - const maptap = (e : UniMapTapEvent) => { + const maptap = (e : UniMapTapEvent) => { + // #ifdef WEB + uni.showModal({ + content: 'web端map组件tap事件不支持返回经纬度' + }); + // #endif + // #ifndef WEB // console.log('点击地图时触发',e) uni.showModal({ content: JSON.stringify(e.detail) - }); + }); + // #endif }; const onmarkertap = (e : UniMapMarkerTapEvent) => { @@ -665,7 +674,8 @@ }; const onregionchange = (e : UniMapRegionChangeEvent) => { - console.log('视野发生变化时触发', e.detail) + console.log('视野发生变化时触发', e.detail) + jestResult.eventDetailJsonStringify = JSON.stringify(e.detail) }; const onpoitap = (e : UniMapPoiTapEvent) => { diff --git a/pages/component/rich-text/rich-text.uvue b/pages/component/rich-text/rich-text.uvue index f218f7dad7f21832847ccbb9cdb442bc85f67268..0142f2f62a69aaf8691c0e6087319047721ff5e5 100644 --- a/pages/component/rich-text/rich-text.uvue +++ b/pages/component/rich-text/rich-text.uvue @@ -68,9 +68,10 @@ }, updateRichTextHeight() { if (this.richTextElement != null) { - const elRect = this.richTextElement!.getBoundingClientRect() - this.richTextHeight = elRect.height - console.log('richTextHeight:', this.richTextHeight) + this.richTextElement!.getBoundingClientRectAsync().then((elRect: DOMRect) => { + this.richTextHeight = elRect.height + console.log('richTextHeight:', this.richTextHeight) + }) } }, // 自动化测试 diff --git a/pages/component/textarea/textarea.uvue b/pages/component/textarea/textarea.uvue index 1a7df96b838549d725a5bb30cf4192aee82d4379..2bdf8714ebe0bdc620bd2df97892fde7e5e82b6d 100644 --- a/pages/component/textarea/textarea.uvue +++ b/pages/component/textarea/textarea.uvue @@ -24,6 +24,7 @@ selectionEnd: -1, hold_keyboard: false, adjust_position: false, + disabled: false, jest_result: false } }, @@ -70,6 +71,9 @@ changeAdjustPosition(event : UniSwitchChangeEvent) { const checked = event.detail.value; this.adjust_position = checked; + }, + change_disabled_boolean(checked : boolean) { + this.disabled = checked } } } @@ -85,7 +89,7 @@ :show-confirm-bar="show_confirm_bar_boolean" :adjust-position="adjust_position_boolean" :cursor-color="cursor_color" :cursor="cursor" :placeholder="placeholder_value" :inputmode="inputmode_enum[inputmode_enum_current].name" - :confirm-type="confirm_type_list[confirm_type_current].name" @click="textarea_click" + :confirm-type="confirm_type_list[confirm_type_current].name" :disabled="disabled" @click="textarea_click" @touchstart="textarea_touchstart" @touchmove="textarea_touchmove" @touchcancel="textarea_touchcancel" @touchend="textarea_touchend" @tap="textarea_tap" @longpress="textarea_longpress" @confirm="textarea_confirm" @input="textarea_input" @linechange="textarea_linechange" @blur="textarea_blur" @@ -99,7 +103,9 @@ @change="change_auto_height_boolean"> - + +