diff --git a/pages.json b/pages.json index 5591a123b0c968c5385dbe6ce0779ef86e41622d..7710ef5c757805af00030e4763788302237297c4 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 0000000000000000000000000000000000000000..3dc6be597bbe1e076fc79185978a6f0054dfc4cf --- /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 0000000000000000000000000000000000000000..e043d57bf555af878ea501669d698979857e75d6 --- /dev/null +++ b/pages/component/open-type/open-type.uvue @@ -0,0 +1,36 @@ + + + + +