mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
feat: 优化锁屏解锁
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2409301134
|
v4.6.8
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ type PowerStatus string
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
POWER_STATUS_SUSPEND PowerStatus = "POWER_STATUS_SUSPEND"
|
POWER_STATUS_SUSPEND PowerStatus = "POWER_STATUS_SUSPEND"
|
||||||
|
POWER_STATUS_OFF PowerStatus = "POWER_STATUS_OFF"
|
||||||
POWER_STATUS_ON PowerStatus = "POWER_STATUS_ON"
|
POWER_STATUS_ON PowerStatus = "POWER_STATUS_ON"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ func (hd *hdcDriver) Unlock() (err error) {
|
|||||||
if len(match) <= 1 {
|
if len(match) <= 1 {
|
||||||
return fmt.Errorf("failed to unlock; failed to find powerstatus")
|
return fmt.Errorf("failed to unlock; failed to find powerstatus")
|
||||||
}
|
}
|
||||||
if match[1] == string(POWER_STATUS_SUSPEND) {
|
if match[1] == string(POWER_STATUS_SUSPEND) || match[1] == string(POWER_STATUS_OFF) {
|
||||||
err = hd.uiDriver.PressPowerKey()
|
err = hd.uiDriver.PressPowerKey()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user