提交 a2e76acf 编写于 作者: Y yxn 提交者: yxn22

fixed 067150a3 from https://gitee.com/yxn22/xts_acts/pulls/9797

给documentPicker补充新的XTS测试用例
Signed-off-by: Nyxn <yexinnian2@huawei.com>
Change-Id: Iddb12d19f863507e696b32a4c33c7872d6e93ff6
上级 09d743c5
...@@ -25,7 +25,7 @@ export default function documentPickerCallback(abilityContext) { ...@@ -25,7 +25,7 @@ export default function documentPickerCallback(abilityContext) {
await sleep(500); await sleep(500);
}) })
async function select(testNum, done, dirName, fileName) { async function select(testNum, done) {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
documentPicker.select((err, result) => { documentPicker.select((err, result) => {
...@@ -48,7 +48,7 @@ export default function documentPickerCallback(abilityContext) { ...@@ -48,7 +48,7 @@ export default function documentPickerCallback(abilityContext) {
} }
} }
async function selectWithOption(testNum, done, option, dirName, fileName) { async function selectWithOption(testNum, done, option) {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
documentPicker.select(option, (err, result) => { documentPicker.select(option, (err, result) => {
...@@ -94,7 +94,7 @@ export default function documentPickerCallback(abilityContext) { ...@@ -94,7 +94,7 @@ export default function documentPickerCallback(abilityContext) {
} }
} }
async function saveWithOption(testNum, done, option, dirName) { async function saveWithOption(testNum, done, option) {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
documentPicker.save(option, (err, result) => { documentPicker.save(option, (err, result) => {
...@@ -125,12 +125,10 @@ export default function documentPickerCallback(abilityContext) { ...@@ -125,12 +125,10 @@ export default function documentPickerCallback(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_callback_000", 0, async function (done) { it("documentpicker_select_callback_000", 1, async function (done) {
let testNum = "documentpicker_select_callback_000"; let testNum = "documentpicker_select_callback_000";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
let dirName = "Pictures"; await selectWithOption(testNum, done, option);
let fileName = "01.jpg";
await selectWithOption(testNum, done, option, dirName, fileName);
}); });
/** /**
...@@ -139,13 +137,101 @@ export default function documentPickerCallback(abilityContext) { ...@@ -139,13 +137,101 @@ export default function documentPickerCallback(abilityContext) {
* @tc.desc : select without option * @tc.desc : select without option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_select_callback_001", 0, async function (done) { it("documentpicker_select_callback_001", 1, async function (done) {
let testNum = "documentpicker_select_callback_001"; let testNum = "documentpicker_select_callback_001";
let dirName = "Pictures"; await select(testNum, done);
let fileName = "01.jpg"; });
await select(testNum, done, dirName, fileName);
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_CALLBACK_0200
* @tc.name : documentpicker_select_callback_002
* @tc.desc : select with option maxSelectNumber
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_callback_002", 1, async function (done) {
let testNum = "documentpicker_select_callback_002";
let option = new picker.DocumentSelectOptions();
option.maxSelectNumber = 3;
await selectWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_CALLBACK_0300
* @tc.name : documentpicker_select_callback_003
* @tc.desc : select with option defaultFilePathUri
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_callback_003", 1, async function (done) {
let testNum = "documentpicker_select_callback_003";
let option = new picker.DocumentSelectOptions();
option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test/test1";
await selectWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_CALLBACK_0400
* @tc.name : documentpicker_select_callback_004
* @tc.desc : select with option image fileSuffixFilters
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_callback_004", 1, async function (done) {
let testNum = "documentpicker_select_callback_004";
let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.png', '.jpg'];
await selectWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_CALLBACK_0500
* @tc.name : documentpicker_select_callback_005
* @tc.desc : select with option docs fileSuffixFilters
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_callback_005", 1, async function (done) {
let testNum = "documentpicker_select_callback_005";
let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.pptx', '.docx', '.xlsx', '.txt'];
await selectWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_CALLBACK_0600
* @tc.name : documentpicker_select_callback_006
* @tc.desc : select with option video fileSuffixFilters
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_callback_006", 1, async function (done) {
let testNum = "documentpicker_select_callback_006";
let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.mp4'];
await selectWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_CALLBACK_0700
* @tc.name : documentpicker_select_callback_007
* @tc.desc : select with option audio fileSuffixFilters
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_callback_007", 1, async function (done) {
let testNum = "documentpicker_select_callback_007";
let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.mp3'];
await selectWithOption(testNum, done, option);
}); });
/** /**
...@@ -160,8 +246,7 @@ export default function documentPickerCallback(abilityContext) { ...@@ -160,8 +246,7 @@ export default function documentPickerCallback(abilityContext) {
let testNum = "documentpicker_save_callback_000"; let testNum = "documentpicker_save_callback_000";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.jpg"]; option.newFileNames = ["DocumentViewPicker01.jpg"];
let saveDir = "Pictures"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -172,12 +257,11 @@ export default function documentPickerCallback(abilityContext) { ...@@ -172,12 +257,11 @@ export default function documentPickerCallback(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_save_callback_001", 0, async function (done) { it("documentpicker_save_callback_001", 1, async function (done) {
let testNum = "documentpicker_save_callback_001"; let testNum = "documentpicker_save_callback_001";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.dat"]; option.newFileNames = ["DocumentViewPicker01.dat"];
let saveDir = "Documents"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -188,12 +272,11 @@ export default function documentPickerCallback(abilityContext) { ...@@ -188,12 +272,11 @@ export default function documentPickerCallback(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it("documentpicker_save_callback_002", 0, async function (done) { it("documentpicker_save_callback_002", 3, async function (done) {
let testNum = "documentpicker_save_callback_002"; let testNum = "documentpicker_save_callback_002";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.mp4"]; option.newFileNames = ["DocumentViewPicker01.mp4"];
let saveDir = "Videos"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -204,12 +287,11 @@ export default function documentPickerCallback(abilityContext) { ...@@ -204,12 +287,11 @@ export default function documentPickerCallback(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it("documentpicker_save_callback_003", 0, async function (done) { it("documentpicker_save_callback_003", 3, async function (done) {
let testNum = "documentpicker_save_callback_003"; let testNum = "documentpicker_save_callback_003";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.mp3"]; option.newFileNames = ["DocumentViewPicker01.mp3"];
let saveDir = "Audios"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -220,9 +302,84 @@ export default function documentPickerCallback(abilityContext) { ...@@ -220,9 +302,84 @@ export default function documentPickerCallback(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it("documentpicker_save_callback_004", 0, async function (done) { it("documentpicker_save_callback_004", 3, async function (done) {
let testNum = "documentpicker_save_callback_004"; let testNum = "documentpicker_save_callback_004";
await saveWithoutSelect(testNum, done); await saveWithoutSelect(testNum, done);
}); });
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_CALLBACK_0500
* @tc.name : documentpicker_save_callback_005
* @tc.desc : save png in Pictures
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_save_callback_005", 1, async function (done) {
let testNum = "documentpicker_save_callback_005";
let option = new picker.DocumentSaveOptions();
option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test/test1/202308171505.png";
await saveWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_CALLBACK_0600
* @tc.name : documentpicker_save_callback_006
* @tc.desc : save suffix in Pictures
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_save_callback_006", 1, async function (done) {
let testNum = "documentpicker_save_callback_006";
let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.png', '.jpg'];
await saveWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_CALLBACK_0700
* @tc.name : documentpicker_save_callback_007
* @tc.desc : save suffix in Documents
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_save_callback_007", 1, async function (done) {
let testNum = "documentpicker_save_callback_007";
let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.pptx', '.docx', '.xlsx', '.txt'];
await saveWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_CALLBACK_0800
* @tc.name : documentpicker_save_callback_008
* @tc.desc : save mp4 in Videos
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_save_callback_008", 1, async function (done) {
let testNum = "documentpicker_save_callback_008";
let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.mp4'];
await saveWithOption(testNum, done, option);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SAVE_CALLBACK_0900
* @tc.name : documentpicker_save_callback_009
* @tc.desc : save mp3 in Audios
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_save_callback_009", 1, async function (done) {
let testNum = "documentpicker_save_callback_009";
let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.mp3'];
await saveWithOption(testNum, done, option);
});
}); });
} }
...@@ -25,7 +25,7 @@ export default function documentPickerPromise(abilityContext) { ...@@ -25,7 +25,7 @@ export default function documentPickerPromise(abilityContext) {
await sleep(500); await sleep(500);
}) })
async function select(testNum, done, dirName, fileName) { async function select(testNum, done) {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
documentPicker.select().then((result) => { documentPicker.select().then((result) => {
...@@ -47,7 +47,7 @@ export default function documentPickerPromise(abilityContext) { ...@@ -47,7 +47,7 @@ export default function documentPickerPromise(abilityContext) {
} }
} }
async function selectWithOption(testNum, done, option, dirName?, fileName?) { async function selectWithOption(testNum, done, option) {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
documentPicker.select(option).then((result) => { documentPicker.select(option).then((result) => {
...@@ -91,7 +91,7 @@ export default function documentPickerPromise(abilityContext) { ...@@ -91,7 +91,7 @@ export default function documentPickerPromise(abilityContext) {
} }
} }
async function saveWithOption(testNum, done, option, dirName) { async function saveWithOption(testNum, done, option) {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
documentPicker.save(option).then((result) => { documentPicker.save(option).then((result) => {
...@@ -121,12 +121,10 @@ export default function documentPickerPromise(abilityContext) { ...@@ -121,12 +121,10 @@ export default function documentPickerPromise(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_000", 0, async function (done) { it("documentpicker_select_promise_000", 1, async function (done) {
let testNum = "documentpicker_select_promise_000"; let testNum = "documentpicker_select_promise_000";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
let dirName = "Pictures"; await selectWithOption(testNum, done, option);
let fileName = "01.jpg";
await selectWithOption(testNum, done, option, dirName, fileName);
}); });
/** /**
...@@ -135,125 +133,101 @@ export default function documentPickerPromise(abilityContext) { ...@@ -135,125 +133,101 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : select without option * @tc.desc : select without option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_001", 0, async function (done) { it("documentpicker_select_promise_001", 1, async function (done) {
let testNum = "documentpicker_select_promise_001"; let testNum = "documentpicker_select_promise_001";
let dirName = "Pictures"; await select(testNum, done);
let fileName = "01.jpg";
await select(testNum, done, dirName, fileName);
}); });
/** /**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0200 * @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0200
* @tc.name : documentpicker_select_promise_002 * @tc.name : documentpicker_select_promise_002
* @tc.desc : select with option * @tc.desc : select with option maxSelectNumber
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_002", 0, async function (done) { it("documentpicker_select_promise_002", 1, async function (done) {
let testNum = "documentpicker_select_promise_002"; let testNum = "documentpicker_select_promise_002";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
option.maxSelectNumber = 3; option.maxSelectNumber = 3;
let dirName = "Pictures"; await selectWithOption(testNum, done, option);
await selectWithOption(testNum, done, option, dirName);
}); });
/** /**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0300 * @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0300
* @tc.name : documentpicker_select_promise_003 * @tc.name : documentpicker_select_promise_003
* @tc.desc : select with option * @tc.desc : select with option defaultFilePathUri
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_003", 0, async function (done) { it("documentpicker_select_promise_003", 1, async function (done) {
let testNum = "documentpicker_select_promise_003"; let testNum = "documentpicker_select_promise_003";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
option.defaultFilePathUri = "file://media/file/8"; option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test/test1";
let dirName = "Pictures"; await selectWithOption(testNum, done, option);
await selectWithOption(testNum, done, option, dirName);
}); });
/** /**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0400 * @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0400
* @tc.name : documentpicker_select_promise_004 * @tc.name : documentpicker_select_promise_004
* @tc.desc : select with option * @tc.desc : select with option image fileSuffixFilters
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_004", 0, async function (done) { it("documentpicker_select_promise_004", 1, async function (done) {
let testNum = "documentpicker_select_promise_004"; let testNum = "documentpicker_select_promise_004";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test/test1";
let dirName = "Pictures";
await selectWithOption(testNum, done, option, dirName);
});
/**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0500
* @tc.name : documentpicker_select_promise_005
* @tc.desc : select with option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 1
*/
it("documentpicker_select_promise_005", 0, async function (done) {
let testNum = "documentpicker_select_promise_005";
let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.png', '.jpg']; option.fileSuffixFilters = ['.png', '.jpg'];
let dirName = "Pictures"; await selectWithOption(testNum, done, option);
await selectWithOption(testNum, done, option, dirName);
}); });
/** /**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0500 * @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0500
* @tc.name : documentpicker_select_promise_005 * @tc.name : documentpicker_select_promise_005
* @tc.desc : select with option * @tc.desc : select with option docs fileSuffixFilters
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_005", 0, async function (done) { it("documentpicker_select_promise_005", 1, async function (done) {
let testNum = "documentpicker_select_promise_005"; let testNum = "documentpicker_select_promise_005";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.pptx', '.docx', '.xlsx', '.txt']; option.fileSuffixFilters = ['.pptx', '.docx', '.xlsx', '.txt'];
let dirName = "Documents"; await selectWithOption(testNum, done, option);
await selectWithOption(testNum, done, option, dirName);
}); });
/** /**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0600 * @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0600
* @tc.name : documentpicker_select_promise_006 * @tc.name : documentpicker_select_promise_006
* @tc.desc : select with option * @tc.desc : select with option video fileSuffixFilters
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_006", 0, async function (done) { it("documentpicker_select_promise_006", 1, async function (done) {
let testNum = "documentpicker_select_promise_006"; let testNum = "documentpicker_select_promise_006";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.mp4']; option.fileSuffixFilters = ['.mp4'];
let dirName = "Videos"; await selectWithOption(testNum, done, option);
await selectWithOption(testNum, done, option, dirName);
}); });
/** /**
* @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0700 * @tc.number : SUB_STORAGE_DOCUMENTPICKER_SELECT_PROMISE_0700
* @tc.name : documentpicker_select_promise_007 * @tc.name : documentpicker_select_promise_007
* @tc.desc : select with option * @tc.desc : select with option audio fileSuffixFilters
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_select_promise_007", 0, async function (done) { it("documentpicker_select_promise_007", 1, async function (done) {
let testNum = "documentpicker_select_promise_007"; let testNum = "documentpicker_select_promise_007";
let option = new picker.DocumentSelectOptions(); let option = new picker.DocumentSelectOptions();
option.fileSuffixFilters = ['.mp3']; option.fileSuffixFilters = ['.mp3'];
let dirName = "Audios"; await selectWithOption(testNum, done, option);
await selectWithOption(testNum, done, option, dirName);
}); });
/** /**
...@@ -268,8 +242,7 @@ export default function documentPickerPromise(abilityContext) { ...@@ -268,8 +242,7 @@ export default function documentPickerPromise(abilityContext) {
let testNum = "documentpicker_save_promise_000"; let testNum = "documentpicker_save_promise_000";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.jpg"]; option.newFileNames = ["DocumentViewPicker01.jpg"];
let saveDir = "Pictures"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -280,12 +253,11 @@ export default function documentPickerPromise(abilityContext) { ...@@ -280,12 +253,11 @@ export default function documentPickerPromise(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_001", 0, async function (done) { it("documentpicker_save_promise_001", 1, async function (done) {
let testNum = "documentpicker_save_promise_001"; let testNum = "documentpicker_save_promise_001";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.dat"]; option.newFileNames = ["DocumentViewPicker01.dat"];
let saveDir = "Documents"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -296,12 +268,11 @@ export default function documentPickerPromise(abilityContext) { ...@@ -296,12 +268,11 @@ export default function documentPickerPromise(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it("documentpicker_save_promise_002", 0, async function (done) { it("documentpicker_save_promise_002", 3, async function (done) {
let testNum = "documentpicker_save_promise_002"; let testNum = "documentpicker_save_promise_002";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.mp4"]; option.newFileNames = ["DocumentViewPicker01.mp4"];
let saveDir = "Videos"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -312,12 +283,11 @@ export default function documentPickerPromise(abilityContext) { ...@@ -312,12 +283,11 @@ export default function documentPickerPromise(abilityContext) {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 3
*/ */
it("documentpicker_save_promise_003", 0, async function (done) { it("documentpicker_save_promise_003", 3, async function (done) {
let testNum = "documentpicker_save_promise_003"; let testNum = "documentpicker_save_promise_003";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.newFileNames = ["DocumentViewPicker01.mp3"]; option.newFileNames = ["DocumentViewPicker01.mp3"];
let saveDir = "Audios"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -326,14 +296,13 @@ export default function documentPickerPromise(abilityContext) { ...@@ -326,14 +296,13 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : save uri in Pictures * @tc.desc : save uri in Pictures
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_004", 0, async function (done) { it("documentpicker_save_promise_004", 1, async function (done) {
let testNum = "documentpicker_save_promise_004"; let testNum = "documentpicker_save_promise_004";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.defaultFilePathUri = "file://media/file/8"; option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test";
let saveDir = "Pictures"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -342,14 +311,13 @@ export default function documentPickerPromise(abilityContext) { ...@@ -342,14 +311,13 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : save png in Pictures * @tc.desc : save png in Pictures
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_005", 0, async function (done) { it("documentpicker_save_promise_005", 1, async function (done) {
let testNum = "documentpicker_save_promise_005"; let testNum = "documentpicker_save_promise_005";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test/test1/202308171505.png"; option.defaultFilePathUri = "file://docs/storage/Users/currentUser/test/test1/202308171505.png";
let saveDir = "Pictures"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -358,14 +326,13 @@ export default function documentPickerPromise(abilityContext) { ...@@ -358,14 +326,13 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : save suffix in Pictures * @tc.desc : save suffix in Pictures
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_006", 0, async function (done) { it("documentpicker_save_promise_006", 1, async function (done) {
let testNum = "documentpicker_save_promise_006"; let testNum = "documentpicker_save_promise_006";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.png', '.jpg']; option.fileSuffixChoices = ['.png', '.jpg'];
let saveDir = "Pictures"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -374,14 +341,13 @@ export default function documentPickerPromise(abilityContext) { ...@@ -374,14 +341,13 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : save suffix in Documents * @tc.desc : save suffix in Documents
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_007", 0, async function (done) { it("documentpicker_save_promise_007", 1, async function (done) {
let testNum = "documentpicker_save_promise_007"; let testNum = "documentpicker_save_promise_007";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.pptx', '.docx', '.xlsx', '.txt']; option.fileSuffixChoices = ['.pptx', '.docx', '.xlsx', '.txt'];
let saveDir = "Documents"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -390,14 +356,13 @@ export default function documentPickerPromise(abilityContext) { ...@@ -390,14 +356,13 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : save mp4 in Videos * @tc.desc : save mp4 in Videos
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_008", 0, async function (done) { it("documentpicker_save_promise_008", 1, async function (done) {
let testNum = "documentpicker_save_promise_008"; let testNum = "documentpicker_save_promise_008";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.mp4']; option.fileSuffixChoices = ['.mp4'];
let saveDir = "Videos"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
/** /**
...@@ -406,14 +371,13 @@ export default function documentPickerPromise(abilityContext) { ...@@ -406,14 +371,13 @@ export default function documentPickerPromise(abilityContext) {
* @tc.desc : save mp3 in Audios * @tc.desc : save mp3 in Audios
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 3 * @tc.level : Level 1
*/ */
it("documentpicker_save_promise_009", 0, async function (done) { it("documentpicker_save_promise_009", 1, async function (done) {
let testNum = "documentpicker_save_promise_009"; let testNum = "documentpicker_save_promise_009";
let option = new picker.DocumentSaveOptions(); let option = new picker.DocumentSaveOptions();
option.fileSuffixChoices = ['.mp3']; option.fileSuffixChoices = ['.mp3'];
let saveDir = "Audios"; await saveWithOption(testNum, done, option);
await saveWithOption(testNum, done, option, saveDir);
}); });
}); });
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册