提交 b8b0088a 编写于 作者: Z zhouke

arkXtest测试用例调整,适配黄区设备 .Signed-off-by: <zhouke35@huawei.com>.

Signed-off-by: Nzhouke <zhouke35@huawei.com>
上级 285742c8
...@@ -20,11 +20,17 @@ ...@@ -20,11 +20,17 @@
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"param set persist.sys.suspend_manager_enabled 0",
"reboot",
"power-shell wakeup", "power-shell wakeup",
"hilog -Q pidoff", "hilog -Q pidoff",
"hilog -b DEBUG", "hilog -b DEBUG",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100",
"power-shell setmode 602" "power-shell setmode 602"
],
"teardown-command": [
"param set persist.sys.suspend_manager_enabled 1",
"reboot"
] ]
} }
] ]
......
...@@ -70,7 +70,7 @@ export default function UiTest() { ...@@ -70,7 +70,7 @@ export default function UiTest() {
expect(await Button1.getText() == 'next page').assertTrue() expect(await Button1.getText() == 'next page').assertTrue()
let Button2 = await driver.findComponent(BY.text('next', MatchPattern.STARTS_WITH)) let Button2 = await driver.findComponent(BY.text('next', MatchPattern.STARTS_WITH))
expect(await Button2.getText() == 'next page').assertTrue() expect(await Button2.getText() == 'next page').assertTrue()
let Button3 = await driver.findComponent(BY.text('page', MatchPattern.ENDS_WITH)) let Button3 = await driver.findComponent(BY.text('xt page', MatchPattern.ENDS_WITH))
expect(await Button3.getText() == 'next page').assertTrue() expect(await Button3.getText() == 'next page').assertTrue()
let Button4 = await driver.findComponent(BY.text('ext', MatchPattern.CONTAINS)) let Button4 = await driver.findComponent(BY.text('ext', MatchPattern.CONTAINS))
expect(await Button4.getText() == 'next page').assertTrue() expect(await Button4.getText() == 'next page').assertTrue()
...@@ -476,7 +476,7 @@ export default function UiTest() { ...@@ -476,7 +476,7 @@ export default function UiTest() {
expect(await Button1.getText() == 'next page').assertTrue() expect(await Button1.getText() == 'next page').assertTrue()
let Button2 = await driver.findComponent(ON.text('next',MatchPattern.STARTS_WITH)) let Button2 = await driver.findComponent(ON.text('next',MatchPattern.STARTS_WITH))
expect(await Button2.getText() == 'next page').assertTrue() expect(await Button2.getText() == 'next page').assertTrue()
let Button3 = await driver.findComponent(ON.text('page',MatchPattern.ENDS_WITH)) let Button3 = await driver.findComponent(ON.text('xt page',MatchPattern.ENDS_WITH))
expect(await Button3.getText() == 'next page').assertTrue() expect(await Button3.getText() == 'next page').assertTrue()
let Button4 = await driver.findComponent(ON.text('ext',MatchPattern.CONTAINS)) let Button4 = await driver.findComponent(ON.text('ext',MatchPattern.CONTAINS))
expect(await Button4.getText() == 'next page').assertTrue() expect(await Button4.getText() == 'next page').assertTrue()
...@@ -1372,25 +1372,49 @@ export default function UiTest() { ...@@ -1372,25 +1372,49 @@ export default function UiTest() {
await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility') await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
await driver.delayMs(waitUiReadyMs)
await driver.setDisplayRotation(DisplayRotation.ROTATION_90)
let rotation1 = await driver.getDisplayRotation()
expect(rotation1 == DisplayRotation.ROTATION_90).assertTrue()
await driver.delayMs(waitUiReadyMs)
await driver.setDisplayRotation(DisplayRotation.ROTATION_180) await driver.setDisplayRotation(DisplayRotation.ROTATION_180)
let rotation2 = await driver.getDisplayRotation() let rotation = await driver.getDisplayRotation()
expect(rotation2 == DisplayRotation.ROTATION_180).assertTrue() if (rotation == DisplayRotation.ROTATION_180) {
await driver.delayMs(waitUiReadyMs) console.info('The device is displayed in vertical on default')
await driver.setDisplayRotation(DisplayRotation.ROTATION_90)
await driver.delayMs(waitUiReadyMs)
let rotation1 = await driver.getDisplayRotation()
expect(rotation1 == DisplayRotation.ROTATION_90)
await driver.setDisplayRotation(DisplayRotation.ROTATION_180)
await driver.delayMs(waitUiReadyMs)
let rotation2 = await driver.getDisplayRotation()
expect(rotation2 == DisplayRotation.ROTATION_180)
await driver.setDisplayRotation(DisplayRotation.ROTATION_270)
await driver.delayMs(waitUiReadyMs)
let rotation3 = await driver.getDisplayRotation()
expect(rotation3 == DisplayRotation.ROTATION_270)
await driver.setDisplayRotation(DisplayRotation.ROTATION_0)
await driver.delayMs(waitUiReadyMs)
let rotation4 = await driver.getDisplayRotation()
expect(rotation4 == DisplayRotation.ROTATION_0)
} else if (rotation == DisplayRotation.ROTATION_270) {
console.info('The device is displayed in horizontal on default')
await driver.setDisplayRotation(DisplayRotation.ROTATION_90)
await driver.delayMs(waitUiReadyMs)
let rotation1 = await driver.getDisplayRotation()
expect(rotation1 == DisplayRotation.ROTATION_0)
await driver.setDisplayRotation(DisplayRotation.ROTATION_270) await driver.setDisplayRotation(DisplayRotation.ROTATION_180)
let rotation3 = await driver.getDisplayRotation() await driver.delayMs(waitUiReadyMs)
expect(rotation3 == DisplayRotation.ROTATION_270).assertTrue() let rotation2 = await driver.getDisplayRotation()
await driver.delayMs(waitUiReadyMs) expect(rotation2 == DisplayRotation.ROTATION_270)
await driver.setDisplayRotation(DisplayRotation.ROTATION_270)
await driver.delayMs(waitUiReadyMs)
let rotation3 = await driver.getDisplayRotation()
expect(rotation3 == DisplayRotation.ROTATION_180)
await driver.setDisplayRotation(DisplayRotation.ROTATION_0) await driver.setDisplayRotation(DisplayRotation.ROTATION_0)
let rotation4 = await driver.getDisplayRotation() await driver.delayMs(waitUiReadyMs)
expect(rotation4== DisplayRotation.ROTATION_0).assertTrue() let rotation4 = await driver.getDisplayRotation()
expect(rotation4 == DisplayRotation.ROTATION_90)
await driver.setDisplayRotation(DisplayRotation.ROTATION_90)
}
await stopApplication('com.uitestScene.acts') await stopApplication('com.uitestScene.acts')
}) })
...@@ -1402,14 +1426,20 @@ export default function UiTest() { ...@@ -1402,14 +1426,20 @@ export default function UiTest() {
it('testSetDisplayRotationEnabled', 0, async function () { it('testSetDisplayRotationEnabled', 0, async function () {
await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility') await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
let driver = Driver.create() let driver = Driver.create()
await driver.setDisplayRotationEnabled(false)
await driver.setDisplayRotation(DisplayRotation.ROTATION_180) await driver.setDisplayRotation(DisplayRotation.ROTATION_180)
await driver.delayMs(waitUiReadyMs) let rotation = await driver.getDisplayRotation()
await driver.setDisplayRotationEnabled(true) await driver.setDisplayRotationEnabled(true)
await driver.setDisplayRotation(DisplayRotation.ROTATION_90) await driver.setDisplayRotation(DisplayRotation.ROTATION_90)
await driver.delayMs(waitUiReadyMs)
let rotation2 = await driver.getDisplayRotation() let rotation2 = await driver.getDisplayRotation()
expect(rotation2 == DisplayRotation.ROTATION_90).assertTrue() if (rotation == DisplayRotation.ROTATION_180) {
await driver.setDisplayRotation(DisplayRotation.ROTATION_0) console.info('The device is displayed in vertical on default')
expect(rotation2 == DisplayRotation.ROTATION_90)
await driver.setDisplayRotation(DisplayRotation.ROTATION_0)
} else {
expect(rotation2 == DisplayRotation.ROTATION_0)
console.info('The device is displayed in horizontal on default')
}
await stopApplication('com.uitestScene.acts') await stopApplication('com.uitestScene.acts')
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册