Reputation: 5371
Related to XCTest UI Testing - How to close and open an app without relaunch? is there any way to lock the screen from a UI test? XCUIDevice.Button
only has three cases, home, volume up and volume down.
Upvotes: 1
Views: 349
Reputation: 4549
XCUIDevice has a private method for this. Shh, it's kinda secret.
XCUIDevice.shared.perform(NSSelectorFromString("pressLockButton"))
Upvotes: 2