提交 2494acf5 编写于 作者: G gaoxi

电话ims用例修改

Signed-off-by: Ngaoxi <gaoxi785@huawei.com>
上级 a7b585ad
......@@ -15,7 +15,7 @@
import call from '@ohos.telephony.call';
import observer from '@ohos.telephony.observer';
import {describe, afterAll, it, expect, beforeAll, afterEach} from 'deccjsunit/index';
import { describe, afterAll, it, expect, beforeAll, afterEach } from 'deccjsunit/index';
import {
AUTO_ACCEPT_NUMBER,
AUTO_ACCEPT_NUMBER2,
......@@ -64,7 +64,7 @@ import {
EVENT_OTT_FUNCTION_UNSUPPORTED,
TEL_CONFERENCE_IDLE
} from './lib/Const.js';
import {toString} from './lib/ApiToPromise.js';
import { toString } from './lib/ApiToPromise.js';
import {
scenceInCalling,
hangupCall2,
......@@ -87,22 +87,22 @@ const WAITING_TIME = 200;
let callId = null;
class RejectMessageOptions {
constructor (str) {
constructor(str) {
this.messageContent = str;
}
}
class EmergencyNumberOptions {
constructor (num) {
constructor(num) {
this.slotId = num;
}
}
class NumberFormatOptions {
constructor (str) {
constructor(str) {
this.countryCode = str;
}
}
class CallAttributeOptions {
constructor (accountNumber, speakerphoneOn, accountId, videoState, startTime,
constructor(accountNumber, speakerphoneOn, accountId, videoState, startTime,
isEcc, callType, callId, callState, conferenceState) {
this.accountNumber = accountNumber;
this.speakerphoneOn = speakerphoneOn;
......@@ -184,195 +184,6 @@ describe('CallManageImsCall', function () {
console.log('Telephony_CallManager all 54 case is over for callmanager CallManageImsCall');
});
/**
* @tc.number Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400
* @tc.name Run the function enableLteEnhanceMode by args slotId SLOT_ID_INVALID,
* by callback,the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_enableLteEnhanceMode_Async_0400';
call.enableLteEnhanceMode(SLOT_ID_INVALID, (error, data) => {
if (error) {
console.log(`${caseName} enableLteEnhanceMode error,case success,error:${toString(error)}`);
done();
return;
}
expect().assertFail();
console.log(`${caseName} enableLteEnhanceMode success,case failed,data:${toString(data)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_enableLteEnhanceMode_Promise_0400
* @tc.name Run the function enableLteEnhanceMode by args slotId SLOT_ID_INVALID by promise,
* the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_enableLteEnhanceMode_Promise_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_enableLteEnhanceMode_Promise_0400';
call.enableLteEnhanceMode(SLOT_ID_INVALID).then(data => {
expect().assertFail();
console.log(`${caseName} enableLteEnhanceMode success,case failed,data:${toString(data)}`);
done();
}).catch(error => {
console.log(`${caseName} enableLteEnhanceMode error,case success,error:${toString(error)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_disableLteEnhanceMode_Async_0400
* @tc.name Run the function disableLteEnhanceMode by args slotId SLOT_ID_INVALID,
* by callback,the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_disableLteEnhanceMode_Async_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_disableLteEnhanceMode_Async_0400';
call.disableLteEnhanceMode(SLOT_ID_INVALID, (error, data) => {
if (error) {
console.log(`${caseName} disableLteEnhanceMode error,case success,error:${toString(error)}`);
done();
return;
}
expect().assertFail();
console.log(`${caseName} disableLteEnhanceMode success,case failed,data:${toString(data)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_disableLteEnhanceMode_Promise_0400
* @tc.name Run the function disableLteEnhanceMode by args slotId SLOT_ID_INVALID by promise,
* the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_disableLteEnhanceMode_Promise_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_disableLteEnhanceMode_Promise_0400';
call.disableLteEnhanceMode(SLOT_ID_INVALID).then(data => {
expect().assertFail();
console.log(`${caseName} disableLteEnhanceMode success,case failed,data:${toString(data)}`);
done();
}).catch(error => {
console.log(`${caseName} disableLteEnhanceMode error,case success,error:${toString(error)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Async_0400
* @tc.name Run the function isLteEnhanceModeEnabled by args slotId SLOT_ID_INVALID by callback,
* the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Async_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Async_0400';
call.isLteEnhanceModeEnabled(SLOT_ID_INVALID, (error, data) => {
if (error) {
console.log(`${caseName} isLteEnhanceModeEnabled error,case success,error:${toString(error)}`);
done();
return;
}
expect().assertFail();
console.log(`${caseName} isLteEnhanceModeEnabled success,case failed,data:${toString(data)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Promise_0400
* @tc.name Run the function isLteEnhanceModeEnabled by args slotId SLOT_ID_INVALID by promise,
* the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Promise_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_isLteEnhanceModeEnabled_Promise_0400';
call.isLteEnhanceModeEnabled(SLOT_ID_INVALID).then(data => {
expect().assertFail();
console.log(`${caseName} isLteEnhanceModeEnabled success,case failed,data:${toString(data)}`);
done();
}).catch(error => {
console.log(`${caseName} isLteEnhanceModeEnabled error,case success,error:${toString(error)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_startRTT_Async_0200
* @tc.name Run function startRTT by args callId CALL_ID_NOT_EXIST,msg RTT_MSG by callback,
* the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_startRTT_Async_0200', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_startRTT_Async_0200';
call.startRTT(CALL_ID_NOT_EXIST, RTT_MSG, (error, data) => {
if (error) {
console.log(`${caseName} startRTT ${callId} error,case success,error:${toString(error)}`);
done();
return;
}
expect().assertFail();
console.log(`${caseName} startRTT success,case failed,data:${toString(data)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_startRTT_Promise_0200
* @tc.name Run function startRTT by args callId CALL_ID_NOT_EXIST,msg RTT_MSG by callback,
* the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_startRTT_Promise_0200', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_startRTT_Promise_0200';
call.startRTT(CALL_ID_NOT_EXIST, RTT_MSG).then(data => {
expect().assertFail();
console.log(`${caseName} startRTT success,case failed,data:${toString(data)}`);
done();
}).catch(error => {
console.log(`${caseName} startRTT ${callId} error,case success,error:${toString(error)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_stopRTT_Async_0200
* @tc.name Run function stopRTT by args callId CALL_ID_NOT_EXIST by callback,the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_stopRTT_Async_0200', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_stopRTT_Async_0200';
call.stopRTT(CALL_ID_NOT_EXIST, (error, data) => {
if (error) {
console.log(`${caseName} stopRTT ${callId} error,case success,error:${toString(error)}`);
done();
return;
}
expect().assertFail();
console.log(`${caseName} stopRTT success,case failed,data:${toString(data)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_IMS_stopRTT_Promise_0200
* @tc.name Run function stopRTT by args callId CALL_ID_NOT_EXIST by callback,the function return error
* @tc.desc Function test
*/
it('Telephony_CallManager_IMS_stopRTT_Promise_0200', 0, function (done) {
let caseName = 'Telephony_CallManager_IMS_stopRTT_Promise_0200';
call.stopRTT(CALL_ID_NOT_EXIST).then(data => {
expect().assertFail();
console.log(`${caseName} stopRTT success,case failed,data:${toString(data)}`);
done();
}).catch(error => {
console.log(`${caseName} stopRTT ${callId} error,case success,error:${toString(error)}`);
done();
});
});
/**
* @tc.number Telephony_CallManager_controlCamera_Async_0200
* @tc.name Dial a call and after answering the call,run function controlCamera by
......@@ -383,9 +194,9 @@ describe('CallManageImsCall', function () {
it('Telephony_CallManager_controlCamera_Async_0200', 0, function (done) {
let caseName = 'Telephony_CallManager_controlCamera_Async_0200';
scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER2,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER2,
checkState: CALL_STATUS_DIALING
}).then(data => {
callId = data.callId;
let cameraId = CARMER_ID_NOT_EXIT;
......@@ -416,9 +227,9 @@ describe('CallManageImsCall', function () {
let cameraId = CARMER_ID_NOT_EXIT;
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER2,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER2,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......@@ -446,12 +257,12 @@ describe('CallManageImsCall', function () {
it('Telephony_CallManager_setPreviewWindow_Async_0300', 0, function (done) {
let caseName = 'Telephony_CallManager_setPreviewWindow_Async_0300';
scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
}).then(data => {
callId = data.callId;
let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600};
let info = { x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600 };
call.setPreviewWindow(info, (error) => {
if (error) {
console.log(`${caseName} error,case success,error:${toString(error)}`);
......@@ -479,9 +290,9 @@ describe('CallManageImsCall', function () {
let caseName = 'Telephony_CallManager_setPreviewWindow_Promise_0300';
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......@@ -490,7 +301,7 @@ describe('CallManageImsCall', function () {
return;
}
try {
let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600};
let info = { x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600 };
await call.setPreviewWindow(info);
console.log(`${caseName} case faild`);
expect().assertFail();
......@@ -511,9 +322,9 @@ describe('CallManageImsCall', function () {
let caseName = 'Telephony_CallManager_setDisplayWindow_Async_0300';
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......@@ -522,7 +333,7 @@ describe('CallManageImsCall', function () {
return;
}
try {
let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600};
let info = { x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600 };
await call.setDisplayWindow(info);
console.log(`${caseName} case faild`);
expect().assertFail();
......@@ -543,9 +354,9 @@ describe('CallManageImsCall', function () {
let caseName = 'Telephony_CallManager_setDisplayWindow_Promise_0300';
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......@@ -554,7 +365,7 @@ describe('CallManageImsCall', function () {
return;
}
try {
let info = {x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600};
let info = { x: POS_700, y: POS_10, z: POS_Z_ERROR, width: POS_LENGTH_300, height: POS_LENGTH_600 };
await call.setDisplayWindow(info);
console.log(`${caseName} case faild`);
expect().assertFail();
......@@ -573,9 +384,9 @@ describe('CallManageImsCall', function () {
it('Telephony_CallManager_setCameraZoom_Async_0400', 0, function (done) {
let caseName = 'Telephony_CallManager_setCameraZoom_Async_0400';
scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER2,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER2,
checkState: CALL_STATUS_DIALING
}).then(data => {
callId = data.callId;
call.setCameraZoom(ZOOM_RATIO_MINUS_1_0, (error) => {
......@@ -604,9 +415,9 @@ describe('CallManageImsCall', function () {
let caseName = 'Telephony_CallManager_setCameraZoom_Promise_0400';
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......@@ -633,9 +444,9 @@ describe('CallManageImsCall', function () {
it('Telephony_CallManager_setPausePicture_Async_0500', 0, function (done) {
let caseName = 'Telephony_CallManager_setPausePicture_Async_0500';
scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
}).then(data => {
callId = data.callId;
call.setPausePicture(IMAGE_LOCAL_ERROR_PATH, (error) => {
......@@ -664,9 +475,9 @@ describe('CallManageImsCall', function () {
let caseName = 'Telephony_CallManager_setPausePicture_Promise_0500';
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......@@ -692,9 +503,9 @@ describe('CallManageImsCall', function () {
it('Telephony_CallManager_setDeviceDirection_Async_0500', 0, function (done) {
let caseName = 'Telephony_CallManager_setDeviceDirection_Async_0500';
scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER,
checkState: CALL_STATUS_DIALING
}).then(data => {
callId = data.callId;
call.setDeviceDirection(ROTATION_MINUS_1, (error) => {
......@@ -723,9 +534,9 @@ describe('CallManageImsCall', function () {
let caseName = 'Telephony_CallManager_setDeviceDirection_Promise_0500';
try {
let data = await scenceInCalling({
caseName:caseName,
phoneNumber:AUTO_ACCEPT_NUMBER2,
checkState:CALL_STATUS_DIALING
caseName: caseName,
phoneNumber: AUTO_ACCEPT_NUMBER2,
checkState: CALL_STATUS_DIALING
});
callId = data.callId;
} catch (error) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册