From 31c396f68e9237e1296b2537b522c716e16ffe17 Mon Sep 17 00:00:00 2001 From: mahaifeng Date: Wed, 18 Sep 2024 17:14:28 +0800 Subject: [PATCH] =?UTF-8?q?[open-type]=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=B8=8E=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 15 ++++++++- pages/component/open-type/open-type.test.js | 36 +++++++++++++++++++++ pages/component/open-type/open-type.uvue | 36 +++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 pages/component/open-type/open-type.test.js create mode 100644 pages/component/open-type/open-type.uvue diff --git a/pages.json b/pages.json index 5591a123..7710ef5c 100644 --- a/pages.json +++ b/pages.json @@ -205,6 +205,15 @@ "navigationBarTitleText": "textarea | 多行输入框" } }, + // #ifdef APP-ANDROID + { + "path": "pages/component/open-type/open-type", + "group": "0,3,12", + "style": { + "navigationBarTitleText": "button | open-type" + } + }, + //#endif { "path": "pages/component/slider/slider", "group": "0,3,9", @@ -2053,7 +2062,11 @@ { "id": "component.form-component.textarea", "name": "textarea" - } + }, + { + "id": "component.form-component.open-type", + "name": "open-type" + } ] }, { diff --git a/pages/component/open-type/open-type.test.js b/pages/component/open-type/open-type.test.js new file mode 100644 index 00000000..3dc6be59 --- /dev/null +++ b/pages/component/open-type/open-type.test.js @@ -0,0 +1,36 @@ +let page; +describe('open-type', () => { + beforeAll(async () => { + page = await program.reLaunch('/pages/component/open-type/open-type') + await page.waitFor(600); + }); + it('opentype-test', async () => { + if (!isAndroid()) { + return + } + const opentype = await page.$('#opentype') + await opentype.tap() + let isAgreeRes = await getData('isAgreeRes') + expect(isAgreeRes).toBe(true) + }) + + function isAndroid() { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW === + 'true') { + expect(1).toBe(1) + return false + } + if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { + expect(1).toBe(1) + return false + } + return true + } + + function getData(key = '') { + return new Promise(async (resolve, reject) => { + const data = await page.data() + resolve(key ? data[key] : data) + }) + } +}); diff --git a/pages/component/open-type/open-type.uvue b/pages/component/open-type/open-type.uvue new file mode 100644 index 00000000..e043d57b --- /dev/null +++ b/pages/component/open-type/open-type.uvue @@ -0,0 +1,36 @@ + + + + + -- GitLab