使用XCUI进行两指旋转

时间:2016-07-19 16:27:43

标签: ios swift xcode-ui-testing

我有一个测试案例,我必须使用两个手指手势旋转地图,我试图自动化。我尝试过使用录音机,它只录制一个水龙头,而不是旋转。是否可以使用XCUI框架模拟双指旋转?

1 个答案:

答案 0 :(得分:1)

使用旋转功能尝试。这里有一个旋转文件:

/*!
     * Sends a rotation gesture with two touches.
     *
     * The system makes a best effort to synthesize the requested rotation and velocity: absolute accuracy is not guaranteed.
     * Some values may not be possible based on the size of the element's frame - these will result in test failures.
     *
     * @param rotation
     * The rotation of the gesture in radians.
     *
     * @param velocity
     * The velocity of the rotation gesture in radians per second.
     */
    public func rotate(rotation: CGFloat, withVelocity velocity: CGFloat)

欢呼声