我需要在缩放/平移/旋转中间截取屏幕截图,即我希望有这样的代码:
element.startPressAndHold(.twoTouches)
// at this point my app renders differently, so I capture a screenshot
// for snapshot testing
let shot = element.screenshot()
element.stopPressAndHold()
XCUIElement
事实上,钥匙有类似的东西:
XCUIElement.perform(withKeyModifiers: .command) {
let shot = element.screenshot()
}
但我找不到鼠标/触摸/手势类似的东西。
有什么诀窍可以做到这一点吗?