Opening the curtains (iOS/Android)
Swiping, swiping, swiping. From dusk till dawn.
iOS
extension XCUIApplication {
func openNotifications() {
let up = self.coordinate(withNormalizedOffset: CGVector(dx: 0.1, dy: 0.001))
let down = self.coordinate(withNormalizedOffset: CGVector(dx: 0.1, dy: 0.8))
up.press(forDuration: 0.1, thenDragTo: down)
}
}
extension XCUIApplication {
func openControlCenter() {
let down = self.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.999))
let up = self.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.2))
down.press(forDuration: 0.1, thenDragTo: up)
}
}
Android
fun openNotifications() {
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.executeShellCommand("input swipe 0 0 0 500")
}
fun openLaunchPad() {
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.executeShellCommand("input swipe 0 500 0 0")
}