提交 64ab41d1 编写于 作者: Y yichengzhao

modify name of barrierfree test

Signed-off-by: Nyichengzhao <yichengzhao1@huawei.com>
Change-Id: I7b59abd2333965787264593fdc528e4e50795acd
上级 357fdc6f
......@@ -17,11 +17,11 @@ group("barrierfree") {
testonly = true
if (is_standard_system) {
deps = [
"accessibleabilitylist:AccessibleAbilityList",
"accessiblecaptionconfiguration:AccessibleCaptionConfiguration",
"accessiblecheckability:AccessibleCheckAbility",
"accessibleregisterstate:AccessibleRegisterState",
"accessiblesendevent:AccessibleSendEvent",
"accessibleabilitylist:ActsAccessibleAbilityListTest",
"accessiblecaptionconfiguration:ActsAccessibleCaptionConfigurationTest",
"accessiblecheckability:ActsAccessibleCheckAbilityTest",
"accessibleregisterstate:ActsAccessibleRegisterStateTest",
"accessiblesendevent:ActsAccessibleSendEventTest",
]
}
}
......@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AccessibleAbilityList") {
ohos_js_hap_suite("ActsAccessibleAbilityListTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
......
......@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AccessibleCaptionConfiguration") {
ohos_js_hap_suite("ActsAccessibleCaptionConfigurationTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
......
......@@ -16,24 +16,25 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
import accessibility from '@ohos.accessibility'
//import accessibility from '@ohos.application.AccessibilityExtension'
describe('AccessibleCaptionConfiguration', function () {
beforeEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: beforeEach starts`);
let captionManager = accessibility.getCaptionsManager();
captionManager.off("enableChange");
captionManager.off("styleChange");
done();
})
afterEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: afterEach starts`);
let captionManager = accessibility.getCaptionsManager();
captionManager.off("enableChange");
captionManager.off("styleChange");
setTimeout(done, 1000);
})
beforeEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: beforeEach starts`);
let captionManager = accessibility.getCaptionsManager();
captionManager.off("enableChange");
captionManager.off("styleChange");
done();
})
afterEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: afterEach starts`);
let captionManager = accessibility.getCaptionsManager();
captionManager.off("enableChange");
captionManager.off("styleChange");
setTimeout(done, 1000);
})
var CaptionsStyle = {
fontFamily: "default",
fontScale: 75,
......@@ -52,7 +53,6 @@ describe('AccessibleCaptionConfiguration', function () {
windowColor: "green"
}
/*
* @tc.number CaptionConfiguration_0010
* @tc.name CaptionConfiguration_0010
......@@ -105,17 +105,17 @@ describe('AccessibleCaptionConfiguration', function () {
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0020', 0, async function (done) {
console.info('CaptionConfiguration_0020');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style = StyleTest;
})
it('CaptionConfiguration_0020', 0, async function (done) {
console.info('CaptionConfiguration_0020');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style = StyleTest;
})
/*
* @tc.number CaptionConfiguration_0021
......@@ -237,6 +237,58 @@ describe('AccessibleCaptionConfiguration', function () {
captionManager.style.windowColor = "TmepwindowColor";
})
/*
* @tc.number CaptionConfiguration_0030
* @tc.name CaptionConfiguration_0030
* @tc.desc The parameter input is 'enableChange', test the captionManager.off() function,
* and return true
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0030', 0, async function (done) {
console.info('CaptionConfiguration_0030');
let stateEventType = 'enableChange';
let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType);
captionManager.enabled = false;
captionManager.on(stateEventType, (data) => {
let ret = false;
expect(ret).assertEqual(true);
});
let ret = captionManager.off(stateEventType);
captionManager.enabled = true;
expect(true).assertEqual(true);
done();
})
/*
* @tc.number CaptionConfiguration_0031
* @tc.name CaptionConfiguration_0031
* @tc.desc The parameter input is 'enableChange', test the captionManager.off() function,
* and return true
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0031', 0, async function (done) {
console.info('CaptionConfiguration_0031');
let stateEventType = 'enableChange';
let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType);
captionManager.enabled = true;
captionManager.on(stateEventType, (data) => {
let ret = false;
expect(ret).assertEqual(true);
});
captionManager.off(stateEventType, (data) => {
expect(data).assertEqual(true);
});
captionManager.enabled = false;
expect(true).assertEqual(true);
done();
})
/*
* @tc.number CaptionConfiguration_0032
* @tc.name CaptionConfiguration_0032
......@@ -261,6 +313,57 @@ describe('AccessibleCaptionConfiguration', function () {
});
})
/*
* @tc.number CaptionConfiguration_0040
* @tc.name CaptionConfiguration_0040
* @tc.desc The parameter input is 'styleChange', test the captionManager.off() function,
* and return true
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0040', 0, async function (done) {
console.info('CaptionConfiguration_0040');
let stateEventType = 'styleChange';
let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType);
captionManager.on(stateEventType, (data) => {
let ret = false;
expect(ret).assertEqual(true);
});
captionManager.off(stateEventType);
captionManager.style = StyleTest;
done();
})
/*
* @tc.number CaptionConfiguration_0041
* @tc.name CaptionConfiguration_0041
* @tc.desc The parameter input is 'styleChange', test the captionManager.off() function,
* and return true
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0041', 0, async function (done) {
console.info('CaptionConfiguration_0041');
let stateEventType = 'styleChange';
let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType);
captionManager.on(stateEventType, (data) => {
let ret = false;
expect(ret).assertEqual(true);
});
captionManager.off(stateEventType, (data) => {
expect(data.fontFamily).assertEqual(StyleTest.fontFamily);
expect(data.fontScale).assertEqual(StyleTest.fontScale);
expect(data.fontColor).assertEqual(StyleTest.fontColor);
expect(data.fontEdgeType).assertEqual(StyleTest.fontEdgeType);
expect(data.backgroundColor).assertEqual(StyleTest.backgroundColor);
expect(data.windowColor).assertEqual(StyleTest.windowColor);
});
captionManager.style = CaptionsStyle;
done();
})
/*
* @tc.number CaptionConfiguration_0042
* @tc.name CaptionConfiguration_0042
......@@ -282,7 +385,6 @@ describe('AccessibleCaptionConfiguration', function () {
});
})
/*
* @tc.number CaptionConfiguration_0050
* @tc.name CaptionConfiguration_0050
......@@ -292,13 +394,13 @@ describe('AccessibleCaptionConfiguration', function () {
* @tc.type User
*/
it('CaptionConfiguration_0050', 0, async function (done) {
console.info('CaptionConfiguration_0050');
let captionManager = accessibility.getCaptionsManager();
let fontFamily = "default";
captionManager.style.fontFamily = fontFamily;
let value = captionManager.style.fontFamily;
expect(value).assertEqual(fontFamily);
done();
console.info('CaptionConfiguration_0050');
let captionManager = accessibility.getCaptionsManager();
let fontFamily = "default";
captionManager.style.fontFamily = fontFamily;
let value = captionManager.style.fontFamily;
expect(value).assertEqual(fontFamily);
done();
})
/*
......@@ -517,6 +619,60 @@ describe('AccessibleCaptionConfiguration', function () {
done();
})
/*
* @tc.number CaptionConfiguration_0070
* @tc.name CaptionConfiguration_0070
* @tc.desc Test getCaptionsManager() function by modifying fontColor.
* Return CaptionsManager.
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0070', 0, async function (done) {
console.info('CaptionConfiguration_0070');
let captionManager = accessibility.getCaptionsManager();
let fontColor ="TmepfontColor";
captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor;
expect(value).assertEqual(fontColor);
done();
})
/*
* @tc.number CaptionConfiguration_0071
* @tc.name CaptionConfiguration_0071
* @tc.desc Test getCaptionsManager() function by modifying fontColor.
* Return CaptionsManager.
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0071', 0, async function (done) {
console.info('CaptionConfiguration_0071');
let captionManager = accessibility.getCaptionsManager();
let fontColor ="none";
captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor;
expect(value).assertEqual(fontColor);
done();
})
/*
* @tc.number CaptionConfiguration_0072
* @tc.name CaptionConfiguration_0072
* @tc.desc Test getCaptionsManager() function by modifying fontColor.
* Return CaptionsManager.
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0072', 0, async function (done) {
console.info('CaptionConfiguration_0072');
let captionManager = accessibility.getCaptionsManager();
let fontColor ="";
captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor;
expect(value).assertEqual(fontColor);
done();
})
/*
* @tc.number CaptionConfiguration_0080
* @tc.name CaptionConfiguration_0080
......@@ -696,7 +852,7 @@ describe('AccessibleCaptionConfiguration', function () {
expect(value).assertEqual(windowColor);
done();
})
/*
* @tc.number CaptionConfiguration_0101
* @tc.name CaptionConfiguration_0101
......@@ -714,7 +870,7 @@ describe('AccessibleCaptionConfiguration', function () {
expect(value).assertEqual(windowColor);
done();
})
/*
* @tc.number CaptionConfiguration_0102
* @tc.name CaptionConfiguration_0102
......@@ -732,5 +888,65 @@ describe('AccessibleCaptionConfiguration', function () {
expect(value).assertEqual(windowColor);
done();
})
/*
* @tc.number CaptionConfiguration_0110
* @tc.name CaptionConfiguration_0110
* @tc.desc Test getCaptionsManager() function by modifying style.
* Return CaptionsManager.
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0110', 0, async function (done) {
console.info('CaptionConfiguration_0110');
let captionManager = accessibility.getCaptionsManager();
let StyleTest = {
fontFamily: "monospacedSerif",
fontScale: 99,
fontColor: "red",
fontEdgeType: "uniform",
backgroundColor: "pink",
windowColor: "green"
};
captionManager.style = StyleTest;
let value = captionManager.style;
expect(value.fontFamily).assertEqual(StyleTest.fontFamily);
expect(value.fontScale).assertEqual(StyleTest.fontScale);
expect(value.fontColor).assertEqual(StyleTest.fontColor);
expect(value.fontEdgeType).assertEqual(StyleTest.fontEdgeType);
expect(value.backgroundColor).assertEqual(StyleTest.backgroundColor);
expect(value.windowColor).assertEqual(StyleTest.windowColor);
done();
})
/*
* @tc.number CaptionConfiguration_0111
* @tc.name CaptionConfiguration_0111
* @tc.desc Test getCaptionsManager() function by modifying style.
* Return CaptionsManager.
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0111', 0, async function (done) {
console.info('CaptionConfiguration_0111');
let captionManager = accessibility.getCaptionsManager();
let StyleTest = {
fontFamily: "default",
fontScale: 75,
fontColor: "blue",
fontEdgeType: "none",
backgroundColor: "green",
windowColor: "pink"
};
captionManager.style = StyleTest;
let value = captionManager.style;
expect(value.fontFamily).assertEqual(StyleTest.fontFamily);
expect(value.fontScale).assertEqual(StyleTest.fontScale);
expect(value.fontColor).assertEqual(StyleTest.fontColor);
expect(value.fontEdgeType).assertEqual(StyleTest.fontEdgeType);
expect(value.backgroundColor).assertEqual(StyleTest.backgroundColor);
expect(value.windowColor).assertEqual(StyleTest.windowColor);
done();
})
})
......@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AccessibleCheckAbility") {
ohos_js_hap_suite("ActsAccessibleCheckAbilityTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
......
......@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AccessibleRegisterState") {
ohos_js_hap_suite("ActsAccessibleRegisterStateTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
......
......@@ -38,14 +38,14 @@ describe('AccessibleRegisterState', function () {
/*
* @tc.number RegisterStateOnOff_0330
* @tc.name RegisterStateOnOff_0330
* @tc.desc The parameter input is 'accessibility', test the accessibility.on() function,
* @tc.desc The parameter input is 'accessibilityStateChange', test the accessibility.on() function,
* and return void.
* @tc.size SmallTest
* @tc.type User
*/
it('RegisterStateOnOff_0330', 0, async function (done) {
console.info('RegisterStateOnOff_0330');
const stateEventType = 'accessibility';
let stateEventType = 'accessibilityStateChange';
let ret = accessibility.on(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -54,14 +54,14 @@ describe('AccessibleRegisterState', function () {
/*
* @tc.number RegisterStateOnOff_0340
* @tc.name RegisterStateOnOff_0340
* @tc.desc The parameter input is 'touchGuide', test the accessibility.on() function,
* @tc.desc The parameter input is 'touchGuideStateChange', test the accessibility.on() function,
* and return void.
* @tc.size SmallTest
* @tc.type User
*/
it('RegisterStateOnOff_0340', 0, async function (done) {
console.info('RegisterStateOnOff_0340');
const stateEventType = 'touchGuide';
let stateEventType = 'touchGuideStateChange';
let ret = accessibility.on(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -77,7 +77,7 @@ describe('AccessibleRegisterState', function () {
*/
it('RegisterStateOnOff_0350', 0, async function (done) {
console.info('RegisterStateOnOff_0350');
const stateEventType = '';
let stateEventType = '';
let ret = accessibility.on(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -93,7 +93,7 @@ describe('AccessibleRegisterState', function () {
*/
it('RegisterStateOnOff_0360', 0, async function (done) {
console.info('RegisterStateOnOff_0360');
const stateEventType = null;
let stateEventType = null;
let ret = accessibility.on(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -106,14 +106,14 @@ describe('AccessibleRegisterState', function () {
/*
* @tc.number RegisterStateOnOff_0370
* @tc.name RegisterStateOnOff_0370
* @tc.desc The parameter input is 'accessibility', test the accessibility.off() function,
* @tc.desc The parameter input is 'accessibilityStateChange', test the accessibility.off() function,
* and return void.
* @tc.size SmallTest
* @tc.type User
*/
it('RegisterStateOnOff_0370', 0, async function (done) {
console.info('RegisterStateOnOff_0370');
const stateEventType = 'accessibility';
let stateEventType = 'accessibilityStateChange';
let ret = accessibility.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -122,14 +122,14 @@ describe('AccessibleRegisterState', function () {
/*
* @tc.number RegisterStateOnOff_0380
* @tc.name RegisterStateOnOff_0380
* @tc.desc The parameter input is 'touchGuide', test the accessibility.off() function,
* @tc.desc The parameter input is 'touchGuideStateChange', test the accessibility.off() function,
* and return void.
* @tc.size SmallTest
* @tc.type User
*/
it('RegisterStateOnOff_0380', 0, async function (done) {
console.info('RegisterStateOnOff_0380');
const stateEventType = 'touchGuide';
let stateEventType = 'touchGuideStateChange';
let ret = accessibility.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -145,7 +145,7 @@ describe('AccessibleRegisterState', function () {
*/
it('RegisterStateOnOff_0390', 0, async function (done) {
console.info('RegisterStateOnOff_0390');
const stateEventType = '';
let stateEventType = '';
let ret = accessibility.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -161,7 +161,7 @@ describe('AccessibleRegisterState', function () {
*/
it('RegisterStateOnOff_0400', 0, async function (done) {
console.info('RegisterStateOnOff_0400');
const stateEventType = null;
let stateEventType = null;
let ret = accessibility.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......@@ -177,7 +177,7 @@ describe('AccessibleRegisterState', function () {
*/
it('RegisterStateOnOff_0410', 0, async function (done) {
console.info('RegisterStateOnOff_0410');
const stateEventType = null;
let stateEventType = null;
let ret = accessibility.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
......
......@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AccessibleSendEvent") {
ohos_js_hap_suite("ActsAccessibleSendEventTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册