未验证 提交 659e7596 编写于 作者: O openharmony_ci 提交者: Gitee

!5520 [storage standard] [master] add five test cases of document api

Merge pull request !5520 from 李妮/storage0917_1
......@@ -15,6 +15,7 @@
import fileio from '@ohos.fileio';
import file from '@system.file';
import document from '@ohos.document';
import {
describe,
it,
......@@ -3823,5 +3824,114 @@ describe('fileTest', function () {
}
});
});
/**
* @tc.number SUB_STORAGE_Document_Choose_0100
* @tc.name Document_Choose_001
* @tc.desc Function of API, choose file.The test file is exist.
*/
it('File_Document_Choose_001', 0, async function (done) {
try {
let types = [];
let code = await document.choose(types);
let str = 'Error';
console.info("getFileUri===>" + code);
expect(str).assertTrue();
done();
}
catch (e) {
console.info('File_Document_Choose_001 has failed for ' + e.message);
expect(e.message == "error").assertTrue();
done();
}
});
/**
* @tc.number SUB_STORAGE_Document_Choose_0200
* @tc.name Document_Choose_002
* @tc.desc Function of API, choose file.The test file is exist.
*/
it('File_Document_Choose_002', 0, async function (done) {
try {
let uri = "";
let code = await document.choose(function(err,uri){
});
console.info("getFileUri===>" + code);
expect(uri).assertTrue();
done();
}
catch (e) {
console.info('File_Document_Choose_002 has failed for ' + e.message);
expect(e.message == "error").assertTrue();
done();
}
});
/**
* @tc.number SUB_STORAGE_Document_Choose_0300
* @tc.name Document_Choose_003
* @tc.desc Function of API, choose file.The test file is exist.
*/
it('File_Document_Choose_003', 0, async function (done) {
try {
let types = [];
let uri = "";
let code = await document.choose(types,function(err,uri){
});
console.info("getFileUri===>" + code);
expect().assertTrue();
done();
}
catch (e) {
console.info('File_Document_Choose_003 has failed for ' + e.message);
expect(e.message == "error").assertTrue();
done();
}
});
/**
* @tc.number SUB_STORAGE_Document_Show_0100
* @tc.name Document_Show_001
* @tc.desc Function of API, show file.The test file is exist.
*/
it('File_Document_Show_001', 0, async function (done) {
try {
let type = "";
let uri = "";
let code = await document.show(uri,type);
console.info("getFileUri===>" + code);
expect().assertTrue();
done();
}
catch (e) {
console.info('File_Document_Show_001 has failed for ' + e.message);
expect(e.message == "error").assertTrue();
done();
}
});
/**
* @tc.number SUB_STORAGE_Document_Show_0200
* @tc.name Document_Show_002
* @tc.desc Function of API, show file.The test file is exist.
*/
it('File_Document_Show_002', 0, async function (done) {
try {
let type = "";
let uri ="";
let code = await document.show(uri,type,function(err){
});
console.info("getFileUri===>" + code);
expect().assertTrue();
done();
}
catch (e) {
console.info('File_Document_Show_002 has failed for ' + e.message);
expect(e.message == "error").assertTrue();
done();
}
});
});
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册