diff --git a/packages/wxa-cli/package.json b/packages/wxa-cli/package.json index cb4d0dba..80d52452 100644 --- a/packages/wxa-cli/package.json +++ b/packages/wxa-cli/package.json @@ -1,6 +1,6 @@ { "name": "@webank/wxa-cli2-apple", - "version": "1.0.63", + "version": "1.0.65", "description": "cli for wxa development", "main": "dist/wxa.js", "scripts": { diff --git a/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestCaseTpl.ejs b/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestCaseTpl.ejs index d61e7173..7f725f49 100644 --- a/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestCaseTpl.ejs +++ b/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestCaseTpl.ejs @@ -194,7 +194,7 @@ for (let j = 0; j < testCaseNameArr.length; j++) { async function screenShot({screenshotDir, screenCount, diff, baseScreenshot}) { let actualImagePath = path.join(screenshotDir, `${screenCount}.png`); - let expectPath = baseScreenshot; + let expectPath = path.join(baseScreenshot, `${screenCount}.png`) await miniProgram.screenshot({path: actualImagePath}); if (diff) { let same = await imageDiff(actualImagePath, expectPath, path.join(screenshotDir, `diff/${screenCount}.png`)); diff --git a/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestSuite.js b/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestSuite.js index 8cc3644c..fba429b2 100644 --- a/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestSuite.js +++ b/packages/wxa-cli/src/tester/wxa-e2eTest/e2eTestSuite.js @@ -68,21 +68,24 @@ const addRecord = function(type, ...args) { let id = target.dataset[IDKEY]; // 先判断是否需要记录 if (shouldRecord.bind(this)(type, ...args)) { - let pages = getCurrentPages(); - let currentPage = pages[pages.length - 1]; - id = findParent(this, id); - state.record.push({ - action: { - ...e, - page: joinURLQuery(currentPage.route, currentPage.options), - event: type, - id, - timeStamp: +new Date() - } - }); - console.log('e2eRecord:', e, id) - } + // tab-bar的操作直接忽略,因为回放找不到 + if (this.is.slice(0, 14) !== 'custom-tab-bar') { + let pages = getCurrentPages(); + let currentPage = pages[pages.length - 1]; + id = findParent(this, id); + state.record.push({ + action: { + ...e, + page: joinURLQuery(currentPage.route, currentPage.options), + event: type, + id, + timeStamp: +new Date() + } + }); + console.log('e2eRecord:', e, id) + } + } // 调用eventMap中原方法 let eventFunc = getEventFunc(type, e.currentTarget.dataset[EVENTMAPKEY]); if (!eventFunc) {