diff --git a/barrierfree/accessibleabilitylist/entry/src/main/js/test/AccessibleAbilityList.test.js b/barrierfree/accessibleabilitylist/entry/src/main/js/test/AccessibleAbilityList.test.js index 70b2be65e439ce9ed403ae317a88c182da1b3266..95b1937ee7dede9f747e3c37677438efdf7725e5 100644 --- a/barrierfree/accessibleabilitylist/entry/src/main/js/test/AccessibleAbilityList.test.js +++ b/barrierfree/accessibleabilitylist/entry/src/main/js/test/AccessibleAbilityList.test.js @@ -35,13 +35,13 @@ describe('AccessibleAbilityList', function () { }) /******************************************************************************** */ - /* Cases AbilityList_0210-0300 are for accessibility.getAbilityLists() API test */ + /* Cases AbilityList_0210-0460 are for accessibility.getAbilityLists() API test */ /******************************************************************************** */ /* * @tc.number AbilityList_0210 * @tc.name AbilityList_0210 - * @tc.desc The parameters input are 'audible' and 'enable', test the getAbilityLists() function, + * @tc.desc The parameters input are 'audible' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User @@ -49,7 +49,6 @@ describe('AccessibleAbilityList', function () { it('AbilityList_0210', 0, async function (done) { console.info('AbilityList_0210'); let abilityType = 'audible'; - let abilityState = 'enable'; accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { if (err.code != 0) { console.error(`AccessibleAbilityList: AbilityList_0210 has error: ${err.code}`); @@ -65,15 +64,14 @@ describe('AccessibleAbilityList', function () { /* * @tc.number AbilityList_0220 * @tc.name AbilityList_0220 - * @tc.desc The parameters input are 'audible' and '', test the getAbilityLists() function, + * @tc.desc The parameters input are 'generic' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ it('AbilityList_0220', 0, async function (done) { console.info('AbilityList_0220'); - let abilityType = 'audible'; - let abilityState = ''; + let abilityType = 'generic'; accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { if (err.code != 0) { console.error(`AccessibleAbilityList: AbilityList_0220 has error: ${err.code}`); @@ -89,15 +87,14 @@ describe('AccessibleAbilityList', function () { /* * @tc.number AbilityList_0230 * @tc.name AbilityList_0230 - * @tc.desc The parameters input are 'audible' and null, test the getAbilityLists() function, + * @tc.desc The parameters input are 'haptic' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ it('AbilityList_0230', 0, async function (done) { console.info('AbilityList_0230'); - let abilityType = 'audible'; - let abilityState = null; + let abilityType = 'haptic'; accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { if (err.code != 0) { console.error(`AccessibleAbilityList: AbilityList_0230 has error: ${err.code}`); @@ -113,15 +110,14 @@ describe('AccessibleAbilityList', function () { /* * @tc.number AbilityList_0240 * @tc.name AbilityList_0240 - * @tc.desc The parameters input are '' and 'enable', test the getAbilityLists() function, + * @tc.desc The parameters input are 'spoken' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ it('AbilityList_0240', 0, async function (done) { console.info('AbilityList_0240'); - let abilityType = ''; - let abilityState = 'enable'; + let abilityType = 'spoken'; accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { if (err.code != 0) { console.error(`AccessibleAbilityList: AbilityList_0240 has error: ${err.code}`); @@ -137,15 +133,14 @@ describe('AccessibleAbilityList', function () { /* * @tc.number AbilityList_0250 * @tc.name AbilityList_0250 - * @tc.desc The parameters input are null and 'enable', test the getAbilityLists() function, + * @tc.desc The parameters input are 'visual' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ it('AbilityList_0250', 0, async function (done) { console.info('AbilityList_0250'); - let abilityType = null; - let abilityState = 'enable'; + let abilityType = 'visual'; accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { if (err.code != 0) { console.error(`AccessibleAbilityList: AbilityList_0250 has error: ${err.code}`); @@ -161,113 +156,468 @@ describe('AccessibleAbilityList', function () { /* * @tc.number AbilityList_0260 * @tc.name AbilityList_0260 - * @tc.desc The parameters input are 'audible' and 'enable', test the getAbilityLists() function, + * @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ it('AbilityList_0260', 0, async function (done) { console.info('AbilityList_0260'); - let abilityType = 'audible'; + let abilityType = 'all'; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0260 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0260 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0270 + * @tc.name AbilityList_0270 + * @tc.desc The parameters input are '' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0270', 0, async function (done) { + console.info('AbilityList_0270'); + let abilityType = ''; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0270 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0270 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0280 + * @tc.name AbilityList_0280 + * @tc.desc The parameters input are null and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0280', 0, async function (done) { + console.info('AbilityList_0280'); + let abilityType = null; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0280 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0290 + * @tc.name AbilityList_0290 + * @tc.desc The parameters input are 'all' and 'enable', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0290', 0, async function (done) { + console.info('AbilityList_0290'); let abilityState = 'enable'; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0290 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0290 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0300 + * @tc.name AbilityList_0300 + * @tc.desc The parameters input are 'all' and 'disable', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0300', 0, async function (done) { + console.info('AbilityList_0300'); + let abilityState = 'disable'; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0300 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0300 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0310 + * @tc.name AbilityList_0310 + * @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0310', 0, async function (done) { + console.info('AbilityList_0310'); + let abilityState = 'install'; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0310 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0310 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0320 + * @tc.name AbilityList_0320 + * @tc.desc The parameters input are 'all' and '', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0320', 0, async function (done) { + console.info('AbilityList_0320'); + let abilityState = ''; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0320 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0320 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0330 + * @tc.name AbilityList_0330 + * @tc.desc The parameters input are 'all' and null, test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0330', 0, async function (done) { + console.info('AbilityList_0330'); + let abilityState = null; + accessibility.getAbilityLists(abilityType, abilityState, (err, data) => { + if (err.code != 0) { + console.error(`AccessibleAbilityList: AbilityList_0330 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibleAbilityList: AbilityList_0330 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityList_0340 + * @tc.name AbilityList_0340 + * @tc.desc The parameters input are 'audible' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0340', 0, async function (done) { + console.info('AbilityList_0340'); + let abilityType = 'audible'; accessibility.getAbilityLists(abilityType, abilityState).then((result) => { - console.info(`AccessibleAbilityList: AbilityList_0260 result ${result.length}`); + console.info(`AccessibleAbilityList: AbilityList_0340 result ${result.length}`); expect(Array.isArray(result)).assertEqual(true); done(); }).catch((err) => { - console.error(`AccessibleAbilityList: AbilityList_0260 has error: ${err}`); + console.error(`AccessibleAbilityList: AbilityList_0340 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0350 + * @tc.name AbilityList_0350 + * @tc.desc The parameters input are 'generic' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0350', 0, async function (done) { + console.info('AbilityList_0350'); + let abilityType = 'generic'; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0350 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0350 has error: ${err}`); expect(null).assertFail(); done(); }); }) /* - * @tc.number AbilityList_0270 - * @tc.name AbilityList_0270 - * @tc.desc The parameters input are 'audible' and '', test the getAbilityLists() function, + * @tc.number AbilityList_0360 + * @tc.name AbilityList_0360 + * @tc.desc The parameters input are 'haptic' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ - it('AbilityList_0270', 0, async function (done) { - console.info('AbilityList_0270'); - let abilityType = 'audible'; - let abilityState = ''; + it('AbilityList_0360', 0, async function (done) { + console.info('AbilityList_0360'); + let abilityType = 'haptic'; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0360 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0360 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0370 + * @tc.name AbilityList_0370 + * @tc.desc The parameters input are 'spoken' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0370', 0, async function (done) { + console.info('AbilityList_0370'); + let abilityType = 'spoken'; accessibility.getAbilityLists(abilityType, abilityState).then((result) => { - console.info(`AccessibleAbilityList: AbilityList_0270 result ${result.length}`); + console.info(`AccessibleAbilityList: AbilityList_0370 result ${result.length}`); expect(Array.isArray(result)).assertEqual(true); done(); }).catch((err) => { - console.error(`AccessibleAbilityList: AbilityList_0270 has error: ${err}`); + console.error(`AccessibleAbilityList: AbilityList_0370 has error: ${err}`); expect(null).assertFail(); done(); }); }) /* - * @tc.number AbilityList_0280 - * @tc.name AbilityList_0280 - * @tc.desc The parameters input are 'audible' and null, test the getAbilityLists() function, + * @tc.number AbilityList_0380 + * @tc.name AbilityList_0380 + * @tc.desc The parameters input are 'visual' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ - it('AbilityList_0280', 0, async function (done) { - console.info('AbilityList_0280'); - let abilityType = 'audible'; - let abilityState = null; + it('AbilityList_0380', 0, async function (done) { + console.info('AbilityList_0380'); + let abilityType = 'visual'; accessibility.getAbilityLists(abilityType, abilityState).then((result) => { - console.info(`AccessibleAbilityList: AbilityList_0280 result ${result.length}`); + console.info(`AccessibleAbilityList: AbilityList_0380 result ${result.length}`); expect(Array.isArray(result)).assertEqual(true); done(); }).catch((err) => { - console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err}`); + console.error(`AccessibleAbilityList: AbilityList_0380 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0390 + * @tc.name AbilityList_0390 + * @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0390', 0, async function (done) { + console.info('AbilityList_0390'); + let abilityType = 'all'; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0390 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0390 has error: ${err}`); expect(null).assertFail(); done(); }); }) /* - * @tc.number AbilityList_0290 - * @tc.name AbilityList_0290 - * @tc.desc The parameters input are '' and 'enable', test the getAbilityLists() function, + * @tc.number AbilityList_0400 + * @tc.name AbilityList_0400 + * @tc.desc The parameters input are '' and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ - it('AbilityList_0290', 0, async function (done) { - console.info('AbilityList_0290'); + it('AbilityList_0400', 0, async function (done) { + console.info('AbilityList_0400'); let abilityType = ''; - let abilityState = 'enable'; accessibility.getAbilityLists(abilityType, abilityState).then((result) => { - console.info(`AccessibleAbilityList: AbilityList_0290 result ${result.length}`); + console.info(`AccessibleAbilityList: AbilityList_0400 result ${result.length}`); expect(Array.isArray(result)).assertEqual(true); done(); }).catch((err) => { - console.error(`AccessibleAbilityList: AbilityList_0290 has error: ${err}`); + console.error(`AccessibleAbilityList: AbilityList_0400 has error: ${err}`); expect(null).assertFail(); done(); }); }) /* - * @tc.number AbilityList_0300 - * @tc.name AbilityList_0300 - * @tc.desc The parameters input are null and 'enable', test the getAbilityLists() function, + * @tc.number AbilityList_0410 + * @tc.name AbilityList_0410 + * @tc.desc The parameters input are null and 'install', test the getAbilityLists() function, * and the output is the list of AccessibilityAbilityInfo * @tc.size SmallTest * @tc.type User */ - it('AbilityList_0300', 0, async function (done) { - console.info('AbilityList_0300'); + it('AbilityList_0410', 0, async function (done) { + console.info('AbilityList_0410'); let abilityType = null; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0410 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0410 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0420 + * @tc.name AbilityList_0420 + * @tc.desc The parameters input are 'all' and 'enable', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0420', 0, async function (done) { + console.info('AbilityList_0420'); let abilityState = 'enable'; accessibility.getAbilityLists(abilityType, abilityState).then((result) => { - console.info(`AccessibleAbilityList: AbilityList_0300 result ${result.length}`); + console.info(`AccessibleAbilityList: AbilityList_0420 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0420 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0430 + * @tc.name AbilityList_0430 + * @tc.desc The parameters input are 'all' and 'disable', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0430', 0, async function (done) { + console.info('AbilityList_0430'); + let abilityState = 'disable'; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0430 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0430 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0440 + * @tc.name AbilityList_0440 + * @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0440', 0, async function (done) { + console.info('AbilityList_0440'); + let abilityState = 'install'; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0440 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0440 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0450 + * @tc.name AbilityList_0450 + * @tc.desc The parameters input are 'all' and '', test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0450', 0, async function (done) { + console.info('AbilityList_0450'); + let abilityState = ''; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0450 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibleAbilityList: AbilityList_0450 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityList_0460 + * @tc.name AbilityList_0460 + * @tc.desc The parameters input are 'all' and null, test the getAbilityLists() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityList_0460', 0, async function (done) { + console.info('AbilityList_0460'); + let abilityState = null; + accessibility.getAbilityLists(abilityType, abilityState).then((result) => { + console.info(`AccessibleAbilityList: AbilityList_0460 result ${result.length}`); expect(Array.isArray(result)).assertEqual(true); done(); }).catch((err) => { - console.error(`AccessibleAbilityList: AbilityList_0300 has error: ${err}`); + console.error(`AccessibleAbilityList: AbilityList_0460 has error: ${err}`); expect(null).assertFail(); done(); }); diff --git a/barrierfree/accessiblecaptionconfiguration/entry/src/main/js/test/AccessibleCaptionConfiguration.test.js b/barrierfree/accessiblecaptionconfiguration/entry/src/main/js/test/AccessibleCaptionConfiguration.test.js index b1cc58dc882054c619d64158dedefc2baf1d9ed3..da2f3de042625d5653f5a9b22500e0bfdc311dad 100644 --- a/barrierfree/accessiblecaptionconfiguration/entry/src/main/js/test/AccessibleCaptionConfiguration.test.js +++ b/barrierfree/accessiblecaptionconfiguration/entry/src/main/js/test/AccessibleCaptionConfiguration.test.js @@ -14,8 +14,6 @@ */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import accessibility from '@ohos.accessibility' -//import accessibility from '@ohos.application.AccessibilityExtension' - describe('AccessibleCaptionConfiguration', function () {