Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f0910215
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f0910215
编写于
6月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3933 remove StatisticsJsunit.test
Merge pull request !3933 from 高曦/OpenHarmony-3.1-Release
上级
6af7eacf
6674ad4a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
0 addition
and
1350 deletion
+0
-1350
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/List.test.ets
...atistic/entry/src/main/ets/MainAbility/test/List.test.ets
+0
-2
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets
...y/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets
+0
-1348
未找到文件。
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/List.test.ets
浏览文件 @
f0910215
...
...
@@ -20,7 +20,6 @@ import radioSecondJsunit from './RadioSecondJsunit.test.ets'
import smsUiJsunit from './SmsMmsJsunit.test.ets';
import callJsunit from './CallJsunit.test.ets';
import dataJsunit from './DataJsunit.test.ets';
import statisticsUiJsunit from './StatisticsJsunit.test.ets';
export default function testsuite() {
//other
...
...
@@ -30,5 +29,4 @@ export default function testsuite() {
convertOptionsJsunit();
radioJsunit();
radioSecondJsunit();
statisticsUiJsunit();
}
\ No newline at end of file
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/MainAbility/test/StatisticsJsunit.test.ets
已删除
100644 → 0
浏览文件 @
6af7eacf
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
import statistics from '@ohos.net.statistics';
import utils from './Utils.ets'
export default function statisticsUiJsunit() {
describe('appInfoTest', function () {
const DATA_0 = 0;
/**
* @tc.number Telephony_statistics_getCellularRxBytes_Async_0100
* @tc.name The APP calls getCellularRxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getCellularRxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getCellularRxBytes_Async_0100';
console.log(`${caseName} done`);
statistics.getCellularRxBytes((err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getCellularRxBytes_Promise_0100
* @tc.name The APP calls getCellularRxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getCellularRxBytes_Promise_0100', 0, async function (done) {
let caseName = 'Telephony_statistics_getCellularRxBytes_Promise_0100';
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
statistics.getCellularRxBytes().then((data) => {
console.log(`${caseName} get data = ${data.message}:${ data.code}`);
expect(data.code >= DATA_0).assertTrue();
expect(data.rxBytes >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getCellularTxBytes_Async_0100
* @tc.name The APP calls getCellularTxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getCellularTxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getCellularTxBytes_Async_0100';
statistics.getCellularTxBytes((err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
expect(data.txBytes >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getCellularTxBytes_Promise_0100
* @tc.name The APP calls getCellularTxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getCellularTxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getCellularTxBytes_Promise_0100';
statistics.getCellularTxBytes().then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getUidRxBytes_Async_0100
* @tc.name The APP calls getUidRxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getUidRxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidRxBytess_Async_0100';
statistics.getUidRxBytes(1,(err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.message == 'successful').assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidRxBytes_Promise_0100
* @tc.name The APP calls getUidRxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getUidRxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidRxBytes_Promise_0100';
statistics.getUidRxBytes(1).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.message == 'successful').assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getUidTxBytes_Async_0100
* @tc.name The APP calls getUidTxBytes and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getUidTxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidTxBytes_Async_0100';
statistics.getUidTxBytes(1,(err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.message == 'successful').assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidTxBytess_Promise_0100
* @tc.name The APP calls getUidTxBytes() and gets traffic successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getUidTxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidTxBytes_Promise_0100';
statistics.getUidTxBytes(1).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.message == 'successful').assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Async_0100
* @tc.name Set the network interface to cellular,
* call getIfaceRxBytes() and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0100';
let ifaceName = "usb0";
statistics.getIfaceRxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
expect(data.rxPackets >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Async_0200
* @tc.name Set network interface to WIFI network interface,
* call getIfaceRxBytes(), successfully obtain traffic value (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Async_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0200';
let ifaceName = "wlan0";
statistics.getIfaceRxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
expect(data.txPackets >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Async_0300
* @tc.name Set the network interface to an Ethernet interface,
* call getIfaceRxBytes(), and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Async_0300', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0300';
let ifaceName = "eth0";
statistics.getIfaceRxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Async_0400
* @tc.name Set the network interface to a nonexistent one, call getIfaceRxBytes(),
* and get a traffic value of DATA_0
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Async_0400', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Async_0400';
let ifaceName = "xlan0";
statistics.getIfaceRxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code == DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0100
* @tc.name Set the network interface to cellular,
* call getIfaceRxBytes() and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0100';
let ifaceName = "usb0";
statistics.getIfaceRxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0200
* @tc.name Set network interface to WIFI network interface,
* call getIfaceRxBytes(), successfully obtain traffic value (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Promise_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0200';
let ifaceName = "wlan0";
statistics.getIfaceRxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0300
* @tc.name Set the network interface to an Ethernet interface,
* call getIfaceRxBytes(), and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Promise_0300', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0300';
let ifaceName = "eth0";
statistics.getIfaceRxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceRxBytes_Promise_0400
* @tc.name Set the network interface to a nonexistent one, call getIfaceRxBytes(),
* and get a traffic value of DATA_0
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceRxBytes_Promise_0400', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceRxBytes_Promise_0400';
let ifaceName = "xlan0";
statistics.getIfaceRxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code == DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Async_0100
* @tc.name Set the network interface to cellular,
* call getIfaceTxBytes() and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0100';
let ifaceName = "usb0";
statistics.getIfaceTxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Async_0200
* @tc.name Set network interface to WIFI network interface,
* call getIfaceTxBytes(), successfully obtain traffic value (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Async_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0200';
let ifaceName = "wlan0";
statistics.getIfaceTxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Async_0300
* @tc.name Set the network interface to an Ethernet interface,
* call getIfaceTxBytes(), and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Async_0300', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0300';
let ifaceName = "eth0";
statistics.getIfaceTxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Async_0400
* @tc.name Set the network interface to a nonexistent one, call getIfaceTxBytes(),
* and get a traffic value of DATA_0
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Async_0400', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Async_0400';
let ifaceName = "xlan0";
statistics.getIfaceTxBytes(ifaceName, (err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code == DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0100
* @tc.name Set the network interface to cellular,
* call getIfaceTxBytes() and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0100';
let ifaceName = "usb0";
statistics.getIfaceTxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0200
* @tc.name Set network interface to WIFI network interface,
* call getIfaceTxBytes(), successfully obtain traffic value (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Promise_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0200';
let ifaceName = "wlan0";
statistics.getIfaceTxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0300
* @tc.name Set the network interface to an Ethernet interface,
* call getIfaceTxBytes(), and get the traffic value successfully (>=DATA_0).
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Promise_0300', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0300';
let ifaceName = "eth0";
statistics.getIfaceTxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceTxBytes_Promise_0400
* @tc.name Set the network interface to a nonexistent one, call getIfaceTxBytes(),
* and get a traffic value of DATA_0
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceTxBytes_Promise_0400', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceTxBytes_Promise_0400';
let ifaceName = "xlan0";
statistics.getIfaceTxBytes(ifaceName).then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code == DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getAllRxBytes_Async_0100
* @tc.name Call getAllRxBytes() and get traffic successfully (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getAllRxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getAllRxBytes_Async_0100';
statistics.getAllRxBytes((err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getAllRxBytes_Promise_0100
* @tc.name Call getAllRxBytes() and get traffic successfully (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getAllRxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getAllRxBytes_Promise_0100';
statistics.getAllRxBytes().then((data) => {
console.log(`${caseName} get data = ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get erro = ` + err);
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getAllRxBytes_Async_0100
* @tc.name Call getAllTxBytes() and get traffic successfully (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getAllTxBytes_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getAllTxBytes_Async_0100';
statistics.getAllTxBytes((err, data) => {
if (err) {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
}
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
});
});
/**
* @tc.number Telephony_statistics_getAllTxBytes_Promise_0100
* @tc.name Call getAllTxBytes() and get traffic successfully (>=DATA_0)
* @tc.desc Function test
*/
it('Telephony_statistics_getAllTxBytes_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getAllTxBytes_Promise_0100';
statistics.getAllTxBytes().then((data) => {
console.log(`${caseName} get data: ${data.message} + ${data.code}`);
expect(data.code >= DATA_0).assertTrue();
done();
}).catch((err) => {
console.log(`${caseName} get data fail: ${err.message} ${err.code}`);
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0100
* @tc.name Test getIfaceStatsDetail() to check the callback result when iface is test
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0100';
let ifaceInfo = {
"iface": "test",
"startTime": Date.now() - 60 * 60,
"endTime": Date.now()
};
statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => {
if (err) {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0200
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime more than the statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Async_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0200';
let ifaceInfo = {
"iface": "eth0",
"startTime": Date.now(),
"endTime": Date.now() - 60 * 60
};
statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => {
if (err) {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0500
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime equal statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Async_0500', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0500';
let time = Date.now();
let ifaceInfo = {
"iface": "eth0",
"startTime": time,
"endTime": time
};
statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => {
if (err) {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0600
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime before system time
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Async_0600', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0600';
let ifaceInfo = {
"iface": "eth0",
"startTime": 1,
"endTime": 2
};
statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => {
if (err) {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Async_0700
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime after system time
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Async_0700', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Async_0700';
let ifaceInfo = {
"iface": "eth0",
"startTime": 1981080000,
"endTime": 1981083600
};
statistics.getIfaceStatsDetail(ifaceInfo, (err, data) => {
if (err) {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0100
* @tc.name Test getIfaceStatsDetail() to check the callback result when iface is test
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0100';
let ifaceInfo = {
"iface": "test",
"startTime": Date.now() - 60 * 60,
"endTime": Date.now()
};
statistics.getIfaceStatsDetail(ifaceInfo).then(data => {
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0200
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime more than the statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Promise_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0200';
let ifaceInfo = {
"iface": "eth0",
"startTime": Date.now(),
"endTime": Date.now() - 60 * 60
};
statistics.getIfaceStatsDetail(ifaceInfo).then(data => {
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0500
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime equal statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Promise_0500', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0500';
let time = Date.now();
let ifaceInfo = {
"iface": "eth0",
"startTime": time,
"endTime": time
};
statistics.getIfaceStatsDetail(ifaceInfo).then(data => {
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0600
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime before system time
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Promise_0600', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0600';
let ifaceInfo = {
"iface": "eth0",
"startTime": 1,
"endTime": 2
};
statistics.getIfaceStatsDetail(ifaceInfo).then(data => {
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getIfaceStatsDetail_Promise_0700
* @tc.name Test getIfaceStatsDetail() to check the callback result when endTime and statTime after system time
* @tc.desc Function test
*/
it('Telephony_statistics_getIfaceStatsDetail_Promise_0700', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getIfaceStatsDetail_Promise_0700';
let ifaceInfo = {
"iface": "eth0",
"startTime": 1981080000,
"endTime": 1981083600
};
statistics.getIfaceStatsDetail(ifaceInfo).then(data => {
console.log(`${caseName} getIfaceStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getIfaceStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Async_0100
* @tc.name Test getUidStatsDetail() to check the callback result when iface is test
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Async_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0100';
let uidInfo = {
"ifaceInfo": {
"iface": "test",
"startTime": Date.now() - 60 * 60,
"endTime": Date.now()
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo, (err, data) => {
if (err) {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Async_0200
* @tc.name Test getUidStatsDetail() to check the callback result when endTime more than the statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Async_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0200';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": Date.now(),
"endTime": Date.now() - 60 * 60
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo, (err, data) => {
if (err) {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Async_0500
* @tc.name Test getUidStatsDetail() to check the callback result when endTime equal statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Async_0500', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0500';
let time = Date.now();
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": time,
"endTime": time
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo, (err, data) => {
if (err) {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Async_0600
* @tc.name Test getUidStatsDetail() to check the callback result when uid is 0
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Async_0600', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0600';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": Date.now() - 60 * 60,
"endTime": Date.now()
},
"uid": 0
};
statistics.getUidStatsDetail(uidInfo, (err, data) => {
if (err) {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Async_0700
* @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime before system time
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Async_0700', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0700';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": 1,
"endTime": 2
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo, (err, data) => {
if (err) {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Async_0800
* @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime after system time
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Async_0800', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Async_0800';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": 1981080000,
"endTime": 1981083600
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo, (err, data) => {
if (err) {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
return;
}
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
});
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Promise_0100
* @tc.name Test getUidStatsDetail() to check the callback result when iface is test
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Promise_0100', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0100';
let uidInfo = {
"ifaceInfo": {
"iface": "test",
"startTime": Date.now() - 60 * 60,
"endTime": Date.now()
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo).then(data => {
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Promise_0200
* @tc.name Test getUidStatsDetail() to check the callback result when endTime more than the statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Promise_0200', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0200';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": Date.now(),
"endTime": Date.now() - 60 * 60
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo).then(data => {
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Promise_0500
* @tc.name Test getUidStatsDetail() to check the callback result when endTime equal statTime
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Promise_0500', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0500';
let time = Date.now();
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": time,
"endTime": time
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo).then(data => {
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Promise_0600
* @tc.name Test getUidStatsDetail() to check the callback result when uid is 0
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Promise_0600', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0600';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": Date.now() - 60 * 60,
"endTime": Date.now()
},
"uid": 0
};
statistics.getUidStatsDetail(uidInfo).then(data => {
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Promise_0700
* @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime before system time
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Promise_0700', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0700';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": 1,
"endTime": 2
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo).then(data => {
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
/**
* @tc.number Telephony_statistics_getUidStatsDetail_Promise_0800
* @tc.name Test getUidStatsDetail() to check the callback result when endTime and statTime after system time
* @tc.desc Function test
*/
it('Telephony_statistics_getUidStatsDetail_Promise_0800', 0, async function (done) {
if (utils.notCheck) {
expect(true).assertTrue();
done();
return;
}
let caseName = 'Telephony_statistics_getUidStatsDetail_Promise_0800';
let uidInfo = {
"ifaceInfo": {
"iface": "eth0",
"startTime": 1981080000,
"endTime": 1981083600
},
"uid": 1001
};
statistics.getUidStatsDetail(uidInfo).then(data => {
console.log(`${caseName} getUidStatsDetail data: ${JSON.stringify(data)}`);
expect().assertFail();
done();
}).catch(err => {
console.log(`${caseName} getUidStatsDetail fail: ${JSON.stringify(err)}`);
done();
})
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录