Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: unlockDevice method would make the phone back to desktop #519

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ public Boolean isDriverAlive(AppiumDriver driver) {

public Boolean isDriverAlive(IOSDriver driver) {
try {
driver.unlockDevice();
// use getBatteryInfo to check if driver is alive
// getStatus would return from cache when session was closed and can't check if driver is alive
driver.getBatteryInfo();
zhou9584 marked this conversation as resolved.
Show resolved Hide resolved
return true;
} catch (WebDriverException e) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void screenCapture(@NotNull DeviceInfo deviceInfo, @NotNull String path,

@Override
public void wakeUpDevice(DeviceInfo deviceInfo, Logger logger) {
classLogger.info("Unlocking may not work as expected, please keep your device wake.");
getAppiumServerManager().getIOSDriver(deviceInfo, logger).unlockDevice();
// unlockDevice can wake up device, but sometimes it would make the phone go back to home which is not expected
classLogger.info("Nothing Implemented for iOS in " + currentMethodName());
}

@Override
Expand Down