提交 fd828ca7 编写于 作者: H huangke11

add cust js api test

Signed-off-by: Nhuangke11 <huangke11@huawei.com>
上级 9994c8b2
...@@ -20,12 +20,12 @@ ohos_js_hap_suite("custjs_test") { ...@@ -20,12 +20,12 @@ ohos_js_hap_suite("custjs_test") {
":custjs_resources", ":custjs_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "CustJsApiTest" hap_name = "ActsCustJsTest"
} }
ohos_js_assets("resmgrjs_assets") { ohos_js_assets("custjs_assets") {
source_dir = "./src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("resmgrjs_resources") { ohos_resources("custjs_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"CustJSApiTest.hap" "ActsCustJsTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import device from '@system.device';
export default { export default {
onCreate() { onCreate() {
......
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{title}} {{ $t('strings.hello') }} {{ title }}
</text> </text>
</div> </div>
...@@ -26,19 +26,19 @@ describe('CustTest', function () { ...@@ -26,19 +26,19 @@ describe('CustTest', function () {
it('getOneCfgFile_test_001', 0, async function (done) { it('getOneCfgFile_test_001', 0, async function (done) {
cust.getOneCfgFile('custxml/none.xml', (error, value) => { cust.getOneCfgFile('custxml/none.xml', (error, value) => {
expect(value.length == 0).assertTrue(); expect(value.length == 0).assertTrue();
console.log('CustTest getOneCfgFile_test_001, none.xml:' + value); console.log('CustTest getOneCfgFile_test_001, none.xml:' + value);
}); });
cust.getOneCfgFile('custxml/system.xml', (error, value) => { cust.getOneCfgFile('custxml/system.xml', (error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getOneCfgFile_test_001, system.xml:' + value); console.log('CustTest getOneCfgFile_test_001, system.xml:' + value);
}); });
cust.getOneCfgFile('custxml/both.xml', (error, value) => { cust.getOneCfgFile('custxml/both.xml', (error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getOneCfgFile_test_001, both.xml:' + value); console.log('CustTest getOneCfgFile_test_001, both.xml:' + value);
}); });
cust.getOneCfgFile('custxml/user.xml', (error, value) => { cust.getOneCfgFile('custxml/user.xml', (error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getOneCfgFile_test_001, user.xml:' + value); console.log('CustTest getOneCfgFile_test_001, user.xml:' + value);
}); });
done(); done();
}) })
...@@ -51,24 +51,24 @@ describe('CustTest', function () { ...@@ -51,24 +51,24 @@ describe('CustTest', function () {
it('getOneCfgFile_test_002', 0, async function (done) { it('getOneCfgFile_test_002', 0, async function (done) {
cust.getOneCfgFile('custxml/none.xml').then(value => { cust.getOneCfgFile('custxml/none.xml').then(value => {
expect(value.length == 0).assertTrue(); expect(value.length == 0).assertTrue();
console.log('CustTest getOneCfgFile_test_002, none.xml:' + value); console.log('CustTest getOneCfgFile_test_002, none.xml:' + value);
}); });
cust.getOneCfgFile('custxml/system.xml').then(value => { cust.getOneCfgFile('custxml/system.xml').then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getOneCfgFile_test_002, system.xml:' + value); console.log('CustTest getOneCfgFile_test_002, system.xml:' + value);
}); });
cust.getOneCfgFile('custxml/both.xml').then(value => { cust.getOneCfgFile('custxml/both.xml').then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getOneCfgFile_test_002, both.xml:' + value); console.log('CustTest getOneCfgFile_test_002, both.xml:' + value);
}); });
cust.getOneCfgFile('custxml/user.xml').then(value => { cust.getOneCfgFile('custxml/user.xml').then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getOneCfgFile_test_002, user.xml:' + value); console.log('CustTest getOneCfgFile_test_002, user.xml:' + value);
}); });
done(); done();
}) })
/* * /* *
* @tc.number SUB_CUST_JS_0300 * @tc.number SUB_CUST_JS_0300
* @tc.name test getCfgFiles method in callback mode * @tc.name test getCfgFiles method in callback mode
* @tc.desc get getCfgFiles in callback mode * @tc.desc get getCfgFiles in callback mode
...@@ -76,19 +76,19 @@ describe('CustTest', function () { ...@@ -76,19 +76,19 @@ describe('CustTest', function () {
it('getCfgFiles_test_003', 0, async function (done) { it('getCfgFiles_test_003', 0, async function (done) {
cust.getCfgFiles('custxml/none.xml', (error, value) => { cust.getCfgFiles('custxml/none.xml', (error, value) => {
expect(value.length == 0).assertTrue(); expect(value.length == 0).assertTrue();
console.log('CustTest getCfgFiles_test_003, none.xml:' + value); console.log('CustTest getCfgFiles_test_003, none.xml:' + value);
}); });
cust.getCfgFiles('custxml/system.xml', (error, value) => { cust.getCfgFiles('custxml/system.xml', (error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getCfgFiles_test_003, system.xml:' + value); console.log('CustTest getCfgFiles_test_003, system.xml:' + value);
}); });
cust.getCfgFiles('custxml/both.xml', (error, value) => { cust.getCfgFiles('custxml/both.xml', (error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getCfgFiles_test_003, both.xml:' + value); console.log('CustTest getCfgFiles_test_003, both.xml:' + value);
}); });
cust.getCfgFiles('custxml/user.xml', (error, value) => { cust.getCfgFiles('custxml/user.xml', (error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getCfgFiles_test_003, user.xml:' + value); console.log('CustTest getCfgFiles_test_003, user.xml:' + value);
}); });
done(); done();
}) })
...@@ -101,24 +101,24 @@ describe('CustTest', function () { ...@@ -101,24 +101,24 @@ describe('CustTest', function () {
it('getCfgFiles_test_004', 0, async function (done) { it('getCfgFiles_test_004', 0, async function (done) {
cust.getCfgFiles('custxml/none.xml').then(value => { cust.getCfgFiles('custxml/none.xml').then(value => {
expect(value.length == 0).assertTrue(); expect(value.length == 0).assertTrue();
console.log('CustTest getCfgFiles_test_004, none.xml:' + value); console.log('CustTest getCfgFiles_test_004, none.xml:' + value);
}); });
cust.getCfgFiles('custxml/system.xml').then(value => { cust.getCfgFiles('custxml/system.xml').then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getCfgFiles_test_004, system.xml:' + value); console.log('CustTest getCfgFiles_test_004, system.xml:' + value);
}); });
cust.getCfgFiles('custxml/both.xml').then(value => { cust.getCfgFiles('custxml/both.xml').then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getCfgFiles_test_004, both.xml:' + value); console.log('CustTest getCfgFiles_test_004, both.xml:' + value);
}); });
cust.getCfgFiles('custxml/user.xml').then(value => { cust.getCfgFiles('custxml/user.xml').then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('CustTest getCfgFiles_test_004, user.xml:' + value); console.log('CustTest getCfgFiles_test_004, user.xml:' + value);
}); });
done(); done();
}) })
/* * /* *
* @tc.number SUB_CUST_JS_0500 * @tc.number SUB_CUST_JS_0500
* @tc.name test getCfgDirList method in callback mode * @tc.name test getCfgDirList method in callback mode
* @tc.desc get getCfgDirList in callback mode * @tc.desc get getCfgDirList in callback mode
...@@ -126,7 +126,7 @@ describe('CustTest', function () { ...@@ -126,7 +126,7 @@ describe('CustTest', function () {
it('getCfgDirList_test_005', 0, async function (done) { it('getCfgDirList_test_005', 0, async function (done) {
cust.getCfgDirList((error, value) => { cust.getCfgDirList((error, value) => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('getCfgDirList_test_005:' + value); console.log('CustTest getCfgDirList_test_005:' + value);
}); });
done(); done();
}) })
...@@ -139,10 +139,10 @@ describe('CustTest', function () { ...@@ -139,10 +139,10 @@ describe('CustTest', function () {
it('getCfgDirList_test_006', 0, async function (done) { it('getCfgDirList_test_006', 0, async function (done) {
cust.getCfgDirList().then(value => { cust.getCfgDirList().then(value => {
expect(value.length != 0).assertTrue(); expect(value.length != 0).assertTrue();
console.log('getCfgDirList_test_006:' + value); console.log('CustTest getCfgDirList_test_006:' + value);
}); });
done(); done();
}) })
console.log('CustTest**************************end'); console.log('CustTest**************************end');
}) })
\ No newline at end of file \ No newline at end of file
...@@ -12,4 +12,5 @@ ...@@ -12,4 +12,5 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require('./Resmgr.test.js')
require('./Cust.test.js')
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册