提交 a089887d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: set-custom-navigation-bar-color 截图测试适配不同分辨率

上级 c8fe14cf
......@@ -4,8 +4,19 @@ const CURRENT_PAGE_PATH =
describe("setCustomNavigationBarColor", () => {
let page;
let originLifeCycleNum;
const screenShotArea = { x: 880, y: 0, width: 100, height: 60 };
beforeAll(async () => {
console.log('process.env.uniTestPlatformInfo', process.env.uniTestPlatformInfo )
page = await program.navigateTo(CURRENT_PAGE_PATH);
if(process.env.uniTestPlatformInfo.startsWith('android 6')){
screenShotArea.x = 535
screenShotArea.width = 90
screenShotArea.height = 50
}else if(process.env.uniTestPlatformInfo.startsWith('android 12')){
screenShotArea.x = 1160
screenShotArea.width = 140
screenShotArea.height = 80
}
await page.waitFor(1000);
originLifeCycleNum = await page.callMethod("getLifeCycleNum");
});
......@@ -21,7 +32,7 @@ describe("setCustomNavigationBarColor", () => {
await page.waitFor(1000);
const image = await program.screenshot({
adb: true,
area: { x: 880, y: 0, width: 100, height: 60 },
area: screenShotArea,
});
expect(image).toMatchImageSnapshot();
const lifeCycleNum = await page.callMethod("getLifeCycleNum");
......@@ -33,7 +44,7 @@ describe("setCustomNavigationBarColor", () => {
await page.waitFor(1000);
const image = await program.screenshot({
adb: true,
area: { x: 880, y: 0, width: 100, height: 60 },
area: screenShotArea,
});
expect(image).toMatchImageSnapshot();
const lifeCycleNum = await page.callMethod("getLifeCycleNum");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册