diff --git a/pages/CSS/text/font-family.test.js b/pages/CSS/text/font-family.test.js new file mode 100644 index 0000000000000000000000000000000000000000..34eee55eece42a3b50a267a45873c4ec0f98e394 --- /dev/null +++ b/pages/CSS/text/font-family.test.js @@ -0,0 +1,16 @@ +// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('css-font-family', () => { + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/CSS/text/font-family'); + await page.waitFor(3000); + }); + + it('screenshot', async () => { + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toMatchImageSnapshot() + }); +}); diff --git a/pages/pages.test.js b/pages/pages.test.js index 0b5d12685e0bc7df66091d2306d69cc078027103..c51c99afdcf5a8cbffac958f6f818362bc7478df 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -84,7 +84,7 @@ const pages = [ '/pages/CSS/padding/padding-top', '/pages/CSS/padding/padding', '/pages/CSS/text/color', - '/pages/CSS/text/font-family', + // '/pages/CSS/text/font-family', // 网络资源加载 '/pages/CSS/text/font-size', '/pages/CSS/text/font-style', '/pages/CSS/text/font-weight', @@ -110,8 +110,7 @@ const pages = [ '/pages/template/custom-tab-bar/custom-tab-bar', // '/pages/template/drop-card/drop-card', '/pages/template/half-screen/half-screen', - '/pages/template/list-news/list-news', - '/pages/template/list-news/detail/detail', + // '/pages/template/list-news/list-news', // 网络资源加载 // '/pages/template/long-list/long-list', // 动态内容 '/pages/template/navbar-lite/navbar-lite', '/pages/template/pull-zoom-image/pull-zoom-image', @@ -125,12 +124,6 @@ const pages = [ '/pages/API/element-draw/element-draw', ] -const needDelayPages = [ - "/pages/CSS/text/font-family", // load network font - "/pages/template/list-news/list-news", // load network image - "/pages/component/list-view/list-view", // delay wait scroll to disappear -]; - let page; describe("page screenshot test", () => { beforeAll(async () => { @@ -138,9 +131,6 @@ describe("page screenshot test", () => { }); beforeEach(async () => { page = await program.reLaunch(pages[pageIndex]); - if (needDelayPages.includes(pages[pageIndex])) { - await page.waitFor(2000); - } await page.waitFor(1000); }); afterEach(() => { diff --git a/pages/template/list-news/list-news.test.js b/pages/template/list-news/list-news.test.js new file mode 100644 index 0000000000000000000000000000000000000000..78f6d5f5036450e6ee965254f158326779206cf4 --- /dev/null +++ b/pages/template/list-news/list-news.test.js @@ -0,0 +1,16 @@ +// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('template-list-news', () => { + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/template/list-news/list-news'); + await page.waitFor(3000); + }); + + it('screenshot', async () => { + const image = await program.screenshot({ + fullPage: true + }) + expect(image).toMatchImageSnapshot() + }); +});