未验证 提交 2707fd47 编写于 作者: O openharmony_ci 提交者: Gitee

!8193 优化用例

Merge pull request !8193 from 姚翠/master
...@@ -35,14 +35,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta ...@@ -35,14 +35,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
var systemWindowTypeDicArr = []; var systemWindowTypeDicArr = [];
var systemWindowTypeDic = { var systemWindowTypeDic = {
'TYPE_SYSTEM_ALERT': 1, 'TYPE_SYSTEM_ALERT': 1,
'TYPE_INPUT_METHOD': 2,
'TYPE_STATUS_BAR': 3,
'TYPE_PANEL': 4,
'TYPE_KEYGUARD': 5,
'TYPE_VOLUME_OVERLAY': 6,
'TYPE_NAVIGATION_BAR': 7,
'TYPE_FLOAT': 8, 'TYPE_FLOAT': 8,
// 'TYPE_FLOAT_CAMERA': 9
} }
var windowLayoutModeArr = []; var windowLayoutModeArr = [];
var windowLayoutModeDic = { var windowLayoutModeDic = {
...@@ -2051,7 +2044,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta ...@@ -2051,7 +2044,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
try { try {
let isLayoutFullScreen = false; let isLayoutFullScreen = false;
await wnd.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { await wnd.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => {
console.info(msgStr + 'Succeeded in setting the window layout to full-screen mode.'); console.info(msgStr + 'Succeeded in setting the window not layout to full-screen mode.');
try { try {
let propData = wnd.getWindowProperties() let propData = wnd.getWindowProperties()
console.info(msgStr + 'wnd.getWindowProperties propData: ' + JSON.stringify(propData)); console.info(msgStr + 'wnd.getWindowProperties propData: ' + JSON.stringify(propData));
...@@ -2141,7 +2134,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta ...@@ -2141,7 +2134,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
try { try {
wnd.setWindowLayoutFullScreen(isLayoutFullScreen, (err) => { wnd.setWindowLayoutFullScreen(isLayoutFullScreen, (err) => {
if (err.code) { if (err.code) {
console.error(msgStr + 'err Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); console.error(msgStr + 'err Failed to set the window not layout to full-screen mode. Cause:' + JSON.stringify(err));
try { try {
expect().assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
...@@ -2150,7 +2143,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta ...@@ -2150,7 +2143,7 @@ export default function displayAndWindowRefactorInterfaceTest(context, windowSta
done(); done();
return; return;
} }
console.info(msgStr + 'Succeeded in setting the window layout to full-screen mode.'); console.info(msgStr + 'Succeeded in setting the window not layout to full-screen mode.');
try { try {
let propData = wnd.getWindowProperties() let propData = wnd.getWindowProperties()
console.log(msgStr + JSON.stringify(propData)); console.log(msgStr + JSON.stringify(propData));
......
...@@ -40,14 +40,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -40,14 +40,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
var systemWindowTypeArr = []; var systemWindowTypeArr = [];
var systemWindowTypeDic = { var systemWindowTypeDic = {
'TYPE_SYSTEM_ALERT': 1, 'TYPE_SYSTEM_ALERT': 1,
'TYPE_INPUT_METHOD': 2,
'TYPE_STATUS_BAR': 3,
'TYPE_PANEL': 4,
'TYPE_KEYGUARD': 5,
'TYPE_VOLUME_OVERLAY': 6,
'TYPE_NAVIGATION_BAR': 7,
'TYPE_FLOAT': 8, 'TYPE_FLOAT': 8,
'TYPE_FLOAT_CAMERA': 9
} }
var windowLayoutModeArr = []; var windowLayoutModeArr = [];
var windowLayoutModeDic = { var windowLayoutModeDic = {
...@@ -1591,10 +1584,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1591,10 +1584,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
let caseName = 'loadContentTest9'; let caseName = 'loadContentTest9';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin'); console.log(msgStr + 'begin');
windowStage.loadContent('pages/index/index.ets', (err, data) => { windowStage.loadContent('MainAbility/pages/second/second', (err, data) => {
if (err && err.code) { if (err && err.code) {
unexpectedError(err, caseName, 'windowStage.loadContent', done); unexpectedError(err, caseName, 'windowStage.loadContent', done);
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent MainAbility/pages/second/second' + JSON.stringify(err));
} else { } else {
try { try {
expect(!data).assertTrue(); expect(!data).assertTrue();
...@@ -1618,7 +1611,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1618,7 +1611,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
try { try {
windowStage.loadContent(null, (err, data) => { windowStage.loadContent(null, (err, data) => {
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent null' + JSON.stringify(err));
try { try {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (error) { } catch (error) {
...@@ -1627,7 +1620,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1627,7 +1620,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
done(); done();
}); });
} catch (err) { } catch (err) {
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets) catch err' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent null catch err' + JSON.stringify(err));
try { try {
expect(err.code == 401).assertTrue(); expect(err.code == 401).assertTrue();
} catch (error) { } catch (error) {
...@@ -1647,10 +1640,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1647,10 +1640,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin'); console.log(msgStr + 'begin');
windowStage.loadContent('pages/index/index.ets', abilityStorage, (err, data) => { windowStage.loadContent('MainAbility/pages/second/second', abilityStorage, (err, data) => {
if (err && err.code) { if (err && err.code) {
unexpectedError(err, caseName, 'windowStage.loadContent', done); unexpectedError(err, caseName, 'windowStage.loadContent', done);
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent MainAbility/pages/second/second' + JSON.stringify(err));
} else { } else {
try { try {
expect(!data).assertTrue(); expect(!data).assertTrue();
...@@ -1674,7 +1667,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1674,7 +1667,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
try { try {
windowStage.loadContent(null, abilityStorage, (err, data) => { windowStage.loadContent(null, abilityStorage, (err, data) => {
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent null ' + JSON.stringify(err));
try { try {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (error) { } catch (error) {
...@@ -1683,7 +1676,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1683,7 +1676,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
done(); done();
}); });
} catch (err) { } catch (err) {
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets) catch err ' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent null catch err ' + JSON.stringify(err));
try { try {
expect(err.code === 401).assertTrue(); expect(err.code === 401).assertTrue();
} catch (error) { } catch (error) {
...@@ -2037,6 +2030,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -2037,6 +2030,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
expect().assertFail(); expect().assertFail();
done(); done();
}); });
await sleep(3000)
console.info(msgStr + 'Succeeded in setting window orientation. orientation: ' + orientation + "step: " + i); console.info(msgStr + 'Succeeded in setting window orientation. orientation: ' + orientation + "step: " + i);
} }
done() done()
...@@ -2102,6 +2096,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -2102,6 +2096,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
console.log(msgStr + 'windowStage.getMainWindow' + JSON.stringify(mainWin)); console.log(msgStr + 'windowStage.getMainWindow' + JSON.stringify(mainWin));
expect(!!mainWin).assertTrue(); expect(!!mainWin).assertTrue();
await sleep(2000)
mainWin.snapshot((err, data) => { mainWin.snapshot((err, data) => {
if (err && err.code) { if (err && err.code) {
console.log(msgStr + 'snapshot err.code:' + JSON.stringify(err.code)); console.log(msgStr + 'snapshot err.code:' + JSON.stringify(err.code));
...@@ -2324,10 +2319,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -2324,10 +2319,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}) })
}) })
/** /**
* @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_001 * @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_001
* @tc.name Test setAspectRatioTest1 * @tc.name Test setAspectRatioTest1
* @tc.desc Validate the scenario cancelled after setting the proportion of the content layout of the main window * @tc.desc Validate the scenario cancelled after setting the proportion of the content layout of the main window
*/ */
it('setAspectRatioTest1', 0, async function (done) { it('setAspectRatioTest1', 0, async function (done) {
let caseName = 'setAspectRatioTest1'; let caseName = 'setAspectRatioTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -2389,10 +2384,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -2389,10 +2384,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
await resetAspectRatio() await resetAspectRatio()
}) })
/** /**
* @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_003 * @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_003
* @tc.name Test setAspectRatioTest3 * @tc.name Test setAspectRatioTest3
* @tc.desc Validate the scenario where the content layout proportion of the main window is abnormal * @tc.desc Validate the scenario where the content layout proportion of the main window is abnormal
*/ */
it('setAspectRatioTest3', 0, async function (done) { it('setAspectRatioTest3', 0, async function (done) {
let caseName = 'setAspectRatioTest3'; let caseName = 'setAspectRatioTest3';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
......
...@@ -37,14 +37,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -37,14 +37,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
var systemWindowTypeDicArr = []; var systemWindowTypeDicArr = [];
var systemWindowTypeDic = { var systemWindowTypeDic = {
'TYPE_SYSTEM_ALERT': 1, 'TYPE_SYSTEM_ALERT': 1,
'TYPE_INPUT_METHOD': 2,
'TYPE_STATUS_BAR': 3,
'TYPE_PANEL': 4,
'TYPE_KEYGUARD': 5,
'TYPE_VOLUME_OVERLAY': 6,
'TYPE_NAVIGATION_BAR': 7,
'TYPE_FLOAT': 8, 'TYPE_FLOAT': 8,
'TYPE_FLOAT_CAMERA': 9
} }
var windowLayoutModeArr = []; var windowLayoutModeArr = [];
var windowLayoutModeDic = { var windowLayoutModeDic = {
...@@ -107,18 +100,21 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -107,18 +100,21 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
} }
function sleep(time) { async function sleep(time) {
return new Promise(resolve => { let timeoutId = null;
setTimeout(() => { let promise = new Promise(resolve => {
timeoutId = setTimeout(() => {
resolve('sleep finished'); resolve('sleep finished');
}, time); }, time);
}) })
let result = await promise;
clearTimeout(timeoutId)
} }
/** /**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_001 * @tc.number SUB_WINDOW_ON_OFF_JSAPI_001
* @tc.name Test listenerTest1 * @tc.name Test listenerTest1
* @tc.desc Verify whether the change monitoring of avoidance area can be started normally. * @tc.desc Verify whether the change monitoring of avoidance area can be started normally.
*/ */
it('listenerTest1', 0, async function (done) { it('listenerTest1', 0, async function (done) {
let caseName = 'listenerTest1'; let caseName = 'listenerTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -164,15 +160,15 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -164,15 +160,15 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_002 * @tc.number SUB_WINDOW_ON_OFF_JSAPI_002
* @tc.name Test listenerTest2 * @tc.name Test listenerTest2
* @tc.desc Verify that the window size avoidance area changes and monitor whether it can be opened normally. * @tc.desc Verify that the window size avoidance area changes and monitor whether it can be opened normally.
*/ */
it('listenerTest2', 0, async function (done) { it('listenerTest2', 0, async function (done) {
let caseName = 'listenerTest2'; let caseName = 'listenerTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
let wndId = 'listenerTest2'; let wndId = 'listenerTest2';
let baseType = 2; let baseType = ohosWindow.WindowType.TYPE_SYSTEM_ALERT;
let changedModel = 102; let changedModel = 102;
let baseValue = 100; let baseValue = 100;
let resizeValue = 200; let resizeValue = 200;
...@@ -228,10 +224,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -228,10 +224,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.resetSize(' + resizeValue + ', ' + resizeValue + ') success'); console.log(msgStr + 'tempWnd.resetSize(' + resizeValue + ', ' + resizeValue + ') success');
}) })
/** /**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_003 * @tc.number SUB_WINDOW_ON_OFF_JSAPI_003
* @tc.name Test listenerTest3 * @tc.name Test listenerTest3
* @tc.desc Verify whether the change monitoring of avoidance area can be started normally. * @tc.desc Verify whether the change monitoring of avoidance area can be started normally.
*/ */
it('listenerTest3', 0, async function (done) { it('listenerTest3', 0, async function (done) {
let caseName = 'listenerTest3'; let caseName = 'listenerTest3';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -273,15 +269,15 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -273,15 +269,15 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.setSystemBarEnable([status, navigation]) success'); console.log(msgStr + 'tempWnd.setSystemBarEnable([status, navigation]) success');
}) })
/** /**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_004 * @tc.number SUB_WINDOW_ON_OFF_JSAPI_004
* @tc.name Test listenerTest4 * @tc.name Test listenerTest4
* @tc.desc Verify whether the window size change monitoring can be closed normally. * @tc.desc Verify whether the window size change monitoring can be closed normally.
*/ */
it('listenerTest4', 0, async function (done) { it('listenerTest4', 0, async function (done) {
let caseName = 'listenerTest4'; let caseName = 'listenerTest4';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
let wndId = 'listenerTest4'; let wndId = 'listenerTest4';
let baseType = 2; let baseType = ohosWindow.WindowType.TYPE_SYSTEM_ALERT;
let changedModel = 102; let changedModel = 102;
let listenerOffFlag = false; let listenerOffFlag = false;
listenerData.on = true; listenerData.on = true;
...@@ -342,10 +338,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -342,10 +338,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'finished'); console.log(msgStr + 'finished');
}) })
/** /**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_001 * @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_001
* @tc.name Test setWindowTypeTest1 * @tc.name Test setWindowTypeTest1
* @tc.desc Test window.setWindowType API function test. * @tc.desc Test window.setWindowType API function test.
*/ */
it('setWindowTypeTest1', 0, async function (done) { it('setWindowTypeTest1', 0, async function (done) {
let caseName = 'setWindowTypeTest1'; let caseName = 'setWindowTypeTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -396,10 +392,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -396,10 +392,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
} }
}) })
/** /**
* @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_002 * @tc.number SUB_WINDOW_SETWINDOWTYPE_JSAPI_002
* @tc.name Test setWindowTypeTest2 * @tc.name Test setWindowTypeTest2
* @tc.desc Test window.setWindowType API function test. * @tc.desc Test window.setWindowType API function test.
*/ */
it('setWindowTypeTest2', 0, async function (done) { it('setWindowTypeTest2', 0, async function (done) {
let caseName = 'setWindowTypeTest2'; let caseName = 'setWindowTypeTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -433,10 +429,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -433,10 +429,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
} }
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_001 * @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_001
* @tc.name Test setSystemBarEnableTest1 * @tc.name Test setSystemBarEnableTest1
* @tc.desc Verify that the scene shows the status bar and hides the navigation bar * @tc.desc Verify that the scene shows the status bar and hides the navigation bar
*/ */
it('setSystemBarEnableTest1', 0, async function (done) { it('setSystemBarEnableTest1', 0, async function (done) {
let caseName = 'setSystemBarEnableTest1'; let caseName = 'setSystemBarEnableTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -494,10 +490,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -494,10 +490,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.setSystemBarEnable([navigation]) success'); console.log(msgStr + 'tempWnd.setSystemBarEnable([navigation]) success');
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_002 * @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_002
* @tc.name Test setSystemBarEnableTest2 * @tc.name Test setSystemBarEnableTest2
* @tc.desc Verify that the scene hides the status bar and displays the navigation bar * @tc.desc Verify that the scene hides the status bar and displays the navigation bar
*/ */
it('setSystemBarEnableTest2', 0, async function (done) { it('setSystemBarEnableTest2', 0, async function (done) {
let caseName = 'setSystemBarEnableTest2'; let caseName = 'setSystemBarEnableTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -555,10 +551,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -555,10 +551,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_003 * @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_003
* @tc.name Test setSystemBarEnableTest3 * @tc.name Test setSystemBarEnableTest3
* @tc.desc Verify that the scene displays both the status bar and the navigation bar * @tc.desc Verify that the scene displays both the status bar and the navigation bar
*/ */
it('setSystemBarEnableTest3', 0, async function (done) { it('setSystemBarEnableTest3', 0, async function (done) {
let caseName = 'setSystemBarEnableTest3'; let caseName = 'setSystemBarEnableTest3';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -616,10 +612,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -616,10 +612,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_004 * @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_004
* @tc.name Test setSystemBarEnableTest4 * @tc.name Test setSystemBarEnableTest4
* @tc.desc Verify that the scene hides both the status bar and the navigation bar * @tc.desc Verify that the scene hides both the status bar and the navigation bar
*/ */
it('setSystemBarEnableTest4', 0, async function (done) { it('setSystemBarEnableTest4', 0, async function (done) {
let caseName = 'setSystemBarEnableTest4'; let caseName = 'setSystemBarEnableTest4';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -677,10 +673,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -677,10 +673,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_005 * @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_005
* @tc.name Test setSystemBarEnableTest5 * @tc.name Test setSystemBarEnableTest5
* @tc.desc Verify the scene where illegal values are entered when the status bar and navigation bar are displayed * @tc.desc Verify the scene where illegal values are entered when the status bar and navigation bar are displayed
*/ */
it('setSystemBarEnableTest5', 0, async function (done) { it('setSystemBarEnableTest5', 0, async function (done) {
let caseName = 'setSystemBarEnableTest5'; let caseName = 'setSystemBarEnableTest5';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -712,10 +708,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -712,10 +708,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARPROPERTIES_JSAPI_001 * @tc.number SUB_WINDOW_SETSYSTEMBARPROPERTIES_JSAPI_001
* @tc.name Test setSystemBarPropertiesTest1 * @tc.name Test setSystemBarPropertiesTest1
* @tc.desc Verify the scene where the colors of the status bar and navigation bar are set in RGB * @tc.desc Verify the scene where the colors of the status bar and navigation bar are set in RGB
*/ */
it('setSystemBarPropertiesTest1', 0, async function (done) { it('setSystemBarPropertiesTest1', 0, async function (done) {
let caseName = 'setSystemBarPropertiesTest1'; let caseName = 'setSystemBarPropertiesTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -786,10 +782,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -786,10 +782,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARPROPERTIES_JSAPI_002 * @tc.number SUB_WINDOW_SETSYSTEMBARPROPERTIES_JSAPI_002
* @tc.name Test setSystemBarPropertiesTest2 * @tc.name Test setSystemBarPropertiesTest2
* @tc.desc Verify the scene where the status bar and navigation bar colors are set in hexadecimal form * @tc.desc Verify the scene where the status bar and navigation bar colors are set in hexadecimal form
*/ */
it('setSystemBarPropertiesTest2', 0, async function (done) { it('setSystemBarPropertiesTest2', 0, async function (done) {
let caseName = 'setSystemBarPropertiesTest2'; let caseName = 'setSystemBarPropertiesTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -884,10 +880,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -884,10 +880,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_SETSYSTEMBARPROPERTIES_JSAPI_003 * @tc.number SUB_WINDOW_SETSYSTEMBARPROPERTIES_JSAPI_003
* @tc.name Test setSystemBarPropertiesTest3 * @tc.name Test setSystemBarPropertiesTest3
* @tc.desc Verify the scene where the status bar and navigation bar colors are set as keywords * @tc.desc Verify the scene where the status bar and navigation bar colors are set as keywords
*/ */
it('setSystemBarPropertiesTest3', 0, async function (done) { it('setSystemBarPropertiesTest3', 0, async function (done) {
let caseName = 'setSystemBarPropertiesTest3'; let caseName = 'setSystemBarPropertiesTest3';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -960,10 +956,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -960,10 +956,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_CREATE_JSAPI_001 * @tc.number SUB_WINDOW_CREATE_JSAPI_001
* @tc.name Test create * @tc.name Test create
* @tc.desc Verify the scenario of creating the application type window * @tc.desc Verify the scenario of creating the application type window
*/ */
it('createTest1', 0, async function (done) { it('createTest1', 0, async function (done) {
let caseName = 'createTest1'; let caseName = 'createTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -991,10 +987,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -991,10 +987,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_CREATE_JSAPI_002 * @tc.number SUB_WINDOW_CREATE_JSAPI_002
* @tc.name Test createTest2 * @tc.name Test createTest2
* @tc.desc Verify the scenario of creating the system type window * @tc.desc Verify the scenario of creating the system type window
*/ */
it('createTest2', 0, async function (done) { it('createTest2', 0, async function (done) {
let caseName = 'createTest2'; let caseName = 'createTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1045,10 +1041,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1045,10 +1041,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_CREATE_JSAPI_003 * @tc.number SUB_WINDOW_CREATE_JSAPI_003
* @tc.name Test createTest3 * @tc.name Test createTest3
* @tc.desc Verify the scenario of creating a window of a type that does not exist * @tc.desc Verify the scenario of creating a window of a type that does not exist
*/ */
it('createTest3', 0, async function (done) { it('createTest3', 0, async function (done) {
let caseName = 'createTest3'; let caseName = 'createTest3';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1063,10 +1059,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1063,10 +1059,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}); });
}) })
/** /**
* @tc.number SUB_WINDOW_CREATE_JSAPI_004 * @tc.number SUB_WINDOW_CREATE_JSAPI_004
* @tc.name Test createTest4 * @tc.name Test createTest4
* @tc.desc Verify the scenario of creating a window with duplicate IDs * @tc.desc Verify the scenario of creating a window with duplicate IDs
*/ */
it('createTest4', 0, async function (done) { it('createTest4', 0, async function (done) {
let caseName = 'createTest4'; let caseName = 'createTest4';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1090,10 +1086,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1090,10 +1086,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'ohosWindow.create 1 twice ohosDataError: ' + JSON.stringify(ohosDataError)); console.log(msgStr + 'ohosWindow.create 1 twice ohosDataError: ' + JSON.stringify(ohosDataError));
}) })
/** /**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_001 * @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_001
* @tc.name Test loadContentTest1 * @tc.name Test loadContentTest1
* @tc.desc Verify the scenario of loading an existing page * @tc.desc Verify the scenario of loading an existing page
*/ */
it('loadContentTest1', 0, async function (done) { it('loadContentTest1', 0, async function (done) {
let caseName = 'loadContentTest1'; let caseName = 'loadContentTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1127,10 +1123,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1127,10 +1123,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_002 * @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_002
* @tc.name Test loadContentTest2 * @tc.name Test loadContentTest2
* @tc.desc Verify the scene of loading the page with illegal values * @tc.desc Verify the scene of loading the page with illegal values
*/ */
it('loadContentTest2', 0, async function (done) { it('loadContentTest2', 0, async function (done) {
let caseName = 'loadContentTest2'; let caseName = 'loadContentTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1177,27 +1173,27 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1177,27 +1173,27 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
/** /**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_003 * @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_003
* @tc.name Test loadContentTest3 * @tc.name Test loadContentTest3
* @tc.desc Verify the scenario of loading an existing page * @tc.desc Verify the scenario of loading an existing page
*/ */
it('loadContentTest3', 0, async function (done) { it('loadContentTest3', 0, async function (done) {
let caseName = 'loadContentTest3'; let caseName = 'loadContentTest3';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin'); console.log(msgStr + 'begin');
let load3 = await windowStage.loadContent('pages/index/index.ets').catch((err) => { let load3 = await windowStage.loadContent('MainAbility/pages/second/second').catch((err) => {
unexpectedError(err, caseName, 'tempWnd.loadContent', done); unexpectedError(err, caseName, 'windowStage loadContent', done);
console.log(msgStr + 'tempWnd.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent MainAbility/pages/second/second' + JSON.stringify(err));
}); });
expect(!load3).assertTrue(); expect(!load3).assertTrue();
console.log(msgStr + 'tempWnd.loadContent end load=' + JSON.stringify(load3)); console.log(msgStr + 'tempWnd.loadContent end load=' + JSON.stringify(load3));
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_004 * @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_004
* @tc.name Test loadContentTest4 * @tc.name Test loadContentTest4
* @tc.desc Verify the scenario of loading an existing page * @tc.desc Verify the scenario of loading an existing page
*/ */
it('loadContentTest4', 0, async function (done) { it('loadContentTest4', 0, async function (done) {
let caseName = 'loadContentTest4'; let caseName = 'loadContentTest4';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1205,21 +1201,21 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1205,21 +1201,21 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
try { try {
let load4 = await windowStage.loadContent(null).catch((err) => { let load4 = await windowStage.loadContent(null).catch((err) => {
expect(false).assertTrue(); expect(false).assertTrue();
console.log(msgStr + 'tempWnd.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent null' + JSON.stringify(err));
}); });
console.log(msgStr + 'tempWnd.loadContent end load5=' + JSON.stringify(load4)); console.log(msgStr + 'windowStage loadContent end load5=' + JSON.stringify(load4));
} }
catch (err) { catch (err) {
console.log(msgStr + 'tempWnd.loadContent catch err=' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent catch err=' + JSON.stringify(err));
expectedError(err.code, caseName, 'tempWnd.loadContent', done, 401); expectedError(err.code, caseName, 'tempWnd.loadContent', done, 401);
} }
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_005 * @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_005
* @tc.name Test loadContentTest5 * @tc.name Test loadContentTest5
* @tc.desc Verify the scenario of loading an existing page * @tc.desc Verify the scenario of loading an existing page
*/ */
it('loadContentTest5', 0, async function (done) { it('loadContentTest5', 0, async function (done) {
let caseName = 'loadContentTest5'; let caseName = 'loadContentTest5';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1227,37 +1223,37 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1227,37 +1223,37 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
try { try {
let load5 = await windowStage.loadContent(null, abilityStorage).catch((err) => { let load5 = await windowStage.loadContent(null, abilityStorage).catch((err) => {
expect(false).assertTrue(); expect(false).assertTrue();
console.log(msgStr + 'tempWnd.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent null' + JSON.stringify(err));
}); });
console.log(msgStr + 'tempWnd.loadContent end load5=' + JSON.stringify(load5)); console.log(msgStr + 'windowStage loadContent end load5=' + JSON.stringify(load5));
} }
catch (err) { catch (err) {
console.log(msgStr + 'tempWnd.loadContent catch err=' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent catch err=' + JSON.stringify(err));
expectedError(err.code, caseName, 'tempWnd.loadContent', done, 401); expectedError(err.code, caseName, 'windowStage loadContent', done, 401);
} }
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_006 * @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_006
* @tc.name Test loadContentTest6 * @tc.name Test loadContentTest6
* @tc.desc Verify the scenario of loading an existing page * @tc.desc Verify the scenario of loading an existing page
*/ */
it('loadContentTest6', 0, async function (done) { it('loadContentTest6', 0, async function (done) {
let caseName = 'loadContentTest6'; let caseName = 'loadContentTest6';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin'); console.log(msgStr + 'begin');
let load6 = await windowStage.loadContent('pages/index/index.ets', null).catch((err) => { let load6 = await windowStage.loadContent('MainAbility/pages/second/second', null).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.loadContent', done); unexpectedError(err, caseName, 'windowStage loadContent', done);
console.log(msgStr + 'tempWnd.loadContent(pages/index/index.ets)' + JSON.stringify(err)); console.log(msgStr + 'windowStage loadContent MainAbility/pages/second/second' + JSON.stringify(err));
}); });
expect(!load6).assertTrue(); expect(!load6).assertTrue();
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_CREATESUBWINDOW_JSAPI_001 * @tc.number SUB_WINDOW_CREATESUBWINDOW_JSAPI_001
* @tc.name Test createSubWindowTest1 * @tc.name Test createSubWindowTest1
* @tc.desc Verify the scenario of creating an auxiliary window * @tc.desc Verify the scenario of creating an auxiliary window
*/ */
it('createSubWindowTest1', 0, async function (done) { it('createSubWindowTest1', 0, async function (done) {
let caseName = 'createSubWindowTest1'; let caseName = 'createSubWindowTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1273,10 +1269,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1273,10 +1269,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_CREATESUBWINDOW_JSAPI_002 * @tc.number SUB_WINDOW_CREATESUBWINDOW_JSAPI_002
* @tc.name Test createSubWindowTest2 * @tc.name Test createSubWindowTest2
* @tc.desc Verify the scene of entering illegal values to create an auxiliary window * @tc.desc Verify the scene of entering illegal values to create an auxiliary window
*/ */
it('createSubWindowTest2', 0, async function (done) { it('createSubWindowTest2', 0, async function (done) {
let caseName = 'createSubWindowTest2'; let caseName = 'createSubWindowTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1295,10 +1291,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1295,10 +1291,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_GETSUBWINDOW_JSAPI_001 * @tc.number SUB_WINDOW_GETSUBWINDOW_JSAPI_001
* @tc.name Test getSubWindowTest1 * @tc.name Test getSubWindowTest1
* @tc.desc Verify the scene of obtaining all auxiliary sub windows * @tc.desc Verify the scene of obtaining all auxiliary sub windows
*/ */
it('getSubWindowTest1', 0, async function (done) { it('getSubWindowTest1', 0, async function (done) {
let caseName = 'getSubWindowTest1'; let caseName = 'getSubWindowTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1312,10 +1308,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1312,10 +1308,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_SETPRIVACYMODE_JSAPI_001 * @tc.number SUB_WINDOW_SETPRIVACYMODE_JSAPI_001
* @tc.name Test setPrivacyModeTest1 * @tc.name Test setPrivacyModeTest1
* @tc.desc Verify the scene where the application sub window is set as a security layer * @tc.desc Verify the scene where the application sub window is set as a security layer
*/ */
it('setPrivacyModeTest1', 0, async function (done) { it('setPrivacyModeTest1', 0, async function (done) {
let caseName = 'setPrivacyModeTest1'; let caseName = 'setPrivacyModeTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1362,10 +1358,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1362,10 +1358,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_DESTROY_JSAPI_001 * @tc.number SUB_WINDOW_DESTROY_JSAPI_001
* @tc.name Test destroyTest1 * @tc.name Test destroyTest1
* @tc.desc Verification window destruction scenario. * @tc.desc Verification window destruction scenario.
*/ */
it('destroyTest1', 0, async function (done) { it('destroyTest1', 0, async function (done) {
let caseName = 'destroyTest1'; let caseName = 'destroyTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1401,10 +1397,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1401,10 +1397,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_SETPREFERREDORIENTATION_JSAPI_001 * @tc.number SUB_WINDOW_SETPREFERREDORIENTATION_JSAPI_001
* @tc.name Test setPreferredOrientationTest1 * @tc.name Test setPreferredOrientationTest1
* @tc.desc Sets the display direction property of the window * @tc.desc Sets the display direction property of the window
*/ */
it('setPreferredOrientationTest1', 0, async function (done) { it('setPreferredOrientationTest1', 0, async function (done) {
let caseName = 'setPreferredOrientationTest1'; let caseName = 'setPreferredOrientationTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1429,13 +1425,14 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1429,13 +1425,14 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}).catch(err => { }).catch(err => {
console.log(msgStr + 'window.setPreferredOrientation failed set error:' + orientation); console.log(msgStr + 'window.setPreferredOrientation failed set error:' + orientation);
}); });
await sleep(3000)
} }
}) })
/** /**
* @tc.number SUB_WINDOW_SETFORBIDSPLITMOVE_JSAPI_001 * @tc.number SUB_WINDOW_SETFORBIDSPLITMOVE_JSAPI_001
* @tc.name Test setForbidSplitMoveTest1 * @tc.name Test setForbidSplitMoveTest1
* @tc.desc Sets whether Windows are forbidden to move in split screen mode * @tc.desc Sets whether Windows are forbidden to move in split screen mode
*/ */
it('setForbidSplitMoveTest1', 0, async function (done) { it('setForbidSplitMoveTest1', 0, async function (done) {
let caseName = 'setForbidSplitMoveTest1'; let caseName = 'setForbidSplitMoveTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1459,10 +1456,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1459,10 +1456,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_SNAPSHOT_JSAPI_001 * @tc.number SUB_WINDOW_SNAPSHOT_JSAPI_001
* @tc.name Test snapshotTest1 * @tc.name Test snapshotTest1
* @tc.desc Scenario of screenshot of verification window * @tc.desc Scenario of screenshot of verification window
*/ */
it('snapshotTest1', 0, async function (done) { it('snapshotTest1', 0, async function (done) {
let caseName = 'snapshotTest1'; let caseName = 'snapshotTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1472,6 +1469,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1472,6 +1469,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}); });
console.log(msgStr + 'windowStage.getMainWindow' + JSON.stringify(mainWin)); console.log(msgStr + 'windowStage.getMainWindow' + JSON.stringify(mainWin));
expect(!!mainWin).assertTrue(); expect(!!mainWin).assertTrue();
await sleep(2000)
let snapshotData = await mainWin.snapshot().catch((err) => { let snapshotData = await mainWin.snapshot().catch((err) => {
unexpectedError(err, caseName, 'mainWin.snapshot', done); unexpectedError(err, caseName, 'mainWin.snapshot', done);
console.log(msgStr + 'snapshot err.code:' + JSON.stringify(err.code)); console.log(msgStr + 'snapshot err.code:' + JSON.stringify(err.code));
...@@ -1480,10 +1478,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1480,10 +1478,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_DIALOGTARGETTOUCH_JSAPI_001 * @tc.number SUB_WINDOW_DIALOGTARGETTOUCH_JSAPI_001
* @tc.name Test dialogTargetTouchTest1 * @tc.name Test dialogTargetTouchTest1
* @tc.desc Verify the scenario of opening modal window * @tc.desc Verify the scenario of opening modal window
*/ */
it('dialogTargetTouchTest1', 0, async function (done) { it('dialogTargetTouchTest1', 0, async function (done) {
let caseName = 'dialogTargetTouchTest1'; let caseName = 'dialogTargetTouchTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1509,10 +1507,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1509,10 +1507,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_ANIMATIONFORSHOWN_JSAPI_001 * @tc.number SUB_WINDOW_ANIMATIONFORSHOWN_JSAPI_001
* @tc.name Test animationForShownTest1 * @tc.name Test animationForShownTest1
* @tc.desc Verify window custom animation configuration of the scene * @tc.desc Verify window custom animation configuration of the scene
*/ */
it('animationForShownTest1', 0, async function (done) { it('animationForShownTest1', 0, async function (done) {
let caseName = 'animationForShownTest1'; let caseName = 'animationForShownTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1561,10 +1559,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1561,10 +1559,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_GETCUTOUTINFO_JSAPI_001 * @tc.number SUB_WINDOW_GETCUTOUTINFO_JSAPI_001
* @tc.name Test getCutoutInfoTest1 * @tc.name Test getCutoutInfoTest1
* @tc.desc Obtain information about unavailable screen areas such as the hole screen, fringe screen, and waterfall screen * @tc.desc Obtain information about unavailable screen areas such as the hole screen, fringe screen, and waterfall screen
*/ */
it('getCutoutInfoTest1', 0, async function (done) { it('getCutoutInfoTest1', 0, async function (done) {
let caseName = 'getCutoutInfoTest1'; let caseName = 'getCutoutInfoTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1579,10 +1577,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1579,10 +1577,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}); });
}) })
/** /**
* @tc.number SUB_WINDOW_SHOWWITHANIMATION_JSAPI_001 * @tc.number SUB_WINDOW_SHOWWITHANIMATION_JSAPI_001
* @tc.name Test showWithAnimationTest1 * @tc.name Test showWithAnimationTest1
* @tc.desc Displays the current window, playing an animation in the process * @tc.desc Displays the current window, playing an animation in the process
*/ */
it('showWithAnimationTest1', 0, async function (done) { it('showWithAnimationTest1', 0, async function (done) {
let caseName = 'showWithAnimationTest1'; let caseName = 'showWithAnimationTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1615,10 +1613,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1615,10 +1613,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
}) })
/** /**
* @tc.number SUB_WINDOW_HIDEWITHANIMATION_JSAPI_001 * @tc.number SUB_WINDOW_HIDEWITHANIMATION_JSAPI_001
* @tc.name Test hideWithAnimationTest1 * @tc.name Test hideWithAnimationTest1
* @tc.desc Hide the current window and play an animation in the process * @tc.desc Hide the current window and play an animation in the process
*/ */
it('hideWithAnimationTest1', 0, async function (done) { it('hideWithAnimationTest1', 0, async function (done) {
let caseName = 'hideWithAnimationTest1'; let caseName = 'hideWithAnimationTest1';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1659,10 +1657,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1659,10 +1657,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}) })
}) })
/** /**
* @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_002 * @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_002
* @tc.name Test setAspectRatioTest2 * @tc.name Test setAspectRatioTest2
* @tc.desc Validate the scenario cancelled after setting the proportion of the content layout of the main window * @tc.desc Validate the scenario cancelled after setting the proportion of the content layout of the main window
*/ */
it('setAspectRatioTest2', 0, async function (done) { it('setAspectRatioTest2', 0, async function (done) {
let caseName = 'setAspectRatioTest2'; let caseName = 'setAspectRatioTest2';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1697,10 +1695,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1697,10 +1695,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
done(); done();
}) })
/** /**
* @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_004 * @tc.number SUB_WINDOW_SETASPECTRATIO_JSAPI_004
* @tc.name Test setAspectRatioTest4 * @tc.name Test setAspectRatioTest4
* @tc.desc Validate the scenario where the content layout proportion of the main window is abnormal * @tc.desc Validate the scenario where the content layout proportion of the main window is abnormal
*/ */
it('setAspectRatioTest4', 0, async function (done) { it('setAspectRatioTest4', 0, async function (done) {
let caseName = 'setAspectRatioTest4'; let caseName = 'setAspectRatioTest4';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1726,10 +1724,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1726,10 +1724,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
} }
}) })
/** /**
* @tc.number WINDOWEVENTTYPE_JSAPI_001 * @tc.number WINDOWEVENTTYPE_JSAPI_001
* @tc.name Test windowEventType_Test_001. * @tc.name Test windowEventType_Test_001.
* @tc.desc Test the enumeration value of WindowEventType * @tc.desc Test the enumeration value of WindowEventType
*/ */
it('windowEventType_Test_001', 0, async function (done) { it('windowEventType_Test_001', 0, async function (done) {
let caseName = 'windowEventType_Test_001'; let caseName = 'windowEventType_Test_001';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
...@@ -1748,10 +1746,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -1748,10 +1746,10 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
} }
}) })
/** /**
* @tc.number ORIENTATION_JSAPI_001 * @tc.number ORIENTATION_JSAPI_001
* @tc.name Test orientation_Test_001. * @tc.name Test orientation_Test_001.
* @tc.desc Test the enumeration value of Orientation * @tc.desc Test the enumeration value of Orientation
*/ */
it('orientation_Test_001', 0, async function (done) { it('orientation_Test_001', 0, async function (done) {
let caseName = 'orientation_Test_001'; let caseName = 'orientation_Test_001';
let msgStr = 'jsunittest ' + caseName + ' '; let msgStr = 'jsunittest ' + caseName + ' ';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册