diff --git a/multimedia/medialibrary/common.js b/multimedia/medialibrary/common.js index 4d8b5c80c383bce6126ac300cce99d67c7a69f86..15ce55cf4d63f618dfeacb5ce09e6da9596e6b77 100644 --- a/multimedia/medialibrary/common.js +++ b/multimedia/medialibrary/common.js @@ -236,13 +236,18 @@ const getPermission = async function (name, context) { context.requestPermissionsFromUser(permissions, (data) => { console.info(`getPermission requestPermissionsFromUser ${JSON.stringify(data)}`); }); - await sleep(200); let driver = uitest.Driver.create(); - await sleep(200); + await sleep(500); - let button = await driver.findComponent(uitest.ON.text("允许")); - await button.click(); + for (let i = 0; i < 10; i++) { + await sleep(500); + let button = await driver.findComponent(uitest.ON.text("允许")); + if (button != undefined) { + await button.click(); + break; + } + } let appInfo = await bundle.getApplicationInfo(name, 0, 100); let tokenID = appInfo.accessTokenId; diff --git a/multimedia/medialibrary/mediaLibrary_album/Test.json b/multimedia/medialibrary/mediaLibrary_album/Test.json index b08fadc5cae07b1885a4c1487d6467bf19a4ea55..73570ded8173fcda23ee49db0db181137c657057 100644 --- a/multimedia/medialibrary/mediaLibrary_album/Test.json +++ b/multimedia/medialibrary/mediaLibrary_album/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -54,6 +56,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ] diff --git a/multimedia/medialibrary/mediaLibrary_base/Test.json b/multimedia/medialibrary/mediaLibrary_base/Test.json index 48cee0b5f5bda7e426cec10109732b4acba7510a..bc985fe7d54ceffa00bd5df1d3c144a58a21f8f8 100644 --- a/multimedia/medialibrary/mediaLibrary_base/Test.json +++ b/multimedia/medialibrary/mediaLibrary_base/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -36,8 +38,6 @@ { "type": "ShellKit", "run-command": [ - "param set persist.ace.testmode.enabled 1", - "param set persist.sys.suspend_manager_enabled 0", "mkdir -pv /storage/media/100/local/files/Pictures/{Static,On,Off,OnAlbum,OffAlbum}", "mkdir -pv /storage/media/100/local/files/Videos//{Static,On,Off}", "mkdir -pv /storage/media/100/local/files/Audios/{Static,On,Off}", diff --git a/multimedia/medialibrary/mediaLibrary_favorite/Test.json b/multimedia/medialibrary/mediaLibrary_favorite/Test.json index 7e59514b4796354117137faa32a2145de8acb6ef..16b1f02ebb2633ba86a4fecbaabc3dd2a3752de3 100644 --- a/multimedia/medialibrary/mediaLibrary_favorite/Test.json +++ b/multimedia/medialibrary/mediaLibrary_favorite/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -54,6 +56,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ] diff --git a/multimedia/medialibrary/mediaLibrary_file/Test.json b/multimedia/medialibrary/mediaLibrary_file/Test.json index 1b053b2142344851a2cb4135f38bff39eda0d194..feb7f62429c832115801ac7e00598e9c1f242d71 100644 --- a/multimedia/medialibrary/mediaLibrary_file/Test.json +++ b/multimedia/medialibrary/mediaLibrary_file/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -58,6 +60,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ] diff --git a/multimedia/medialibrary/mediaLibrary_fileAsset/Test.json b/multimedia/medialibrary/mediaLibrary_fileAsset/Test.json index e0ad63d65f8b584c8d7e9555b0d2641b468b0145..cbca915aa7fbee0f205cd3d8a7c54360be621045 100644 --- a/multimedia/medialibrary/mediaLibrary_fileAsset/Test.json +++ b/multimedia/medialibrary/mediaLibrary_fileAsset/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -36,9 +38,6 @@ { "type": "ShellKit", "run-command": [ - "param set persist.ace.testmode.enabled 1", - "param set persist.sys.suspend_manager_enabled 0", - "reboot", "mkdir -pv /storage/media/100/local/files/Pictures/{ModifyCb,ModifyPro,RW,R,W,RW_cb,R_cb,W_cb,openClose}", "mkdir -pv /storage/media/100/local/files/Videos/{ModifyCb,ModifyPro,RW,R,W,RW_cb,R_cb,W_cb,openClose}", "mkdir -pv /storage/media/100/local/files/Audios/{ModifyCb,ModifyPro,RW,R,W,RW_cb,R_cb,W_cb,openClose}", diff --git a/multimedia/medialibrary/mediaLibrary_fileKey/Test.json b/multimedia/medialibrary/mediaLibrary_fileKey/Test.json index d24c154db8e61b83ff85be67840ec69353dc6cfe..496635b55f7c2f23ffe9015e479dd393044b89ce 100644 --- a/multimedia/medialibrary/mediaLibrary_fileKey/Test.json +++ b/multimedia/medialibrary/mediaLibrary_fileKey/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -50,6 +52,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ] diff --git a/multimedia/medialibrary/mediaLibrary_fileResult/Test.json b/multimedia/medialibrary/mediaLibrary_fileResult/Test.json index dd299f4d61a9d92ed1986cc8011af90c2025fb98..fbafbc0423766b756ac4ee60ed936ba69e33856f 100644 --- a/multimedia/medialibrary/mediaLibrary_fileResult/Test.json +++ b/multimedia/medialibrary/mediaLibrary_fileResult/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -54,6 +56,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ] diff --git a/multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json b/multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json index 1403c036943420a9d03657622c8bef734ab5a5c3..697318cb9afdd707eea8653c5969d7360734bbe7 100644 --- a/multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json +++ b/multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.MediaLibraryDataA/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -35,9 +37,6 @@ { "type": "ShellKit", "run-command": [ - "param set persist.ace.testmode.enabled 1", - "param set persist.sys.suspend_manager_enabled 0", - "reboot", "mkdir -pv /storage/media/100/local/files/Pictures/Thumbnail", "mkdir -pv /storage/media/100/local/files/Videos/Thumbnail", "mkdir -pv /storage/media/100/local/files/Audios/Thumbnail", diff --git a/multimedia/medialibrary/mediaLibrary_mediafetchoptions/Test.json b/multimedia/medialibrary/mediaLibrary_mediafetchoptions/Test.json index f49317851eaaa79c4d84bffdc70e7819c52fe2ed..d3b44b55923129a4e4e0f3b617e30ef36a521fe4 100644 --- a/multimedia/medialibrary/mediaLibrary_mediafetchoptions/Test.json +++ b/multimedia/medialibrary/mediaLibrary_mediafetchoptions/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -54,6 +56,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ] diff --git a/multimedia/medialibrary/mediaLibrary_trash/Test.json b/multimedia/medialibrary/mediaLibrary_trash/Test.json index def6d8d8afb5ef7f324919c56dfc5ab04ff114e2..d6a979bd474dc10eddb1961232d6d0c5ecc8d6ad 100644 --- a/multimedia/medialibrary/mediaLibrary_trash/Test.json +++ b/multimedia/medialibrary/mediaLibrary_trash/Test.json @@ -17,6 +17,8 @@ "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.MediaLibraryDataA/*", "mkdir -pv /storage/media/100/local/files/{Pictures,Videos,Audios,Documents}", "mkdir -p /storage/media/100/local/temp", + "param set persist.sys.suspend_manager_enabled 0", + "reboot", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", @@ -54,6 +56,8 @@ "sleep 10" ], "teardown-command": [ + "param set persist.sys.suspend_manager_enabled 1", + "reboot", "hilog -b X -D 0xD002B70", "power-shell setmode 600" ]