2017-05-19 3 views

답변

1

소스를 살펴 보자 : 나는 기간 및/또는 단계를 변경할 때 또한, 그 많은 차이를

vc.device.drag (시작, 종료, 기간, 단계, 방향을)하지 않습니다 코드 (오픈 소스의 가장 큰) : 또한

def drag(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1): 
    ''' 
    Sends drag event in PX (actually it's using C{input swipe} command). 

    @param (x0, y0): starting point in PX 
    @param (x1, y1): ending point in PX 
    @param duration: duration of the event in ms 
    @param steps: number of steps (currently ignored by @{input swipe}) 
    @param orientation: the orientation (-1: undefined) 
    ''' 

    self.__checkTransport() 
    if orientation == -1: 
     orientation = self.display['orientation'] 
    (x0, y0) = self.__transformPointByOrientation((x0, y0), orientation, self.display['orientation']) 
    (x1, y1) = self.__transformPointByOrientation((x1, y1), orientation, self.display['orientation']) 

    version = self.getSdkVersion() 
    if version <= 15: 
     raise RuntimeError('drag: API <= 15 not supported (version=%d)' % version) 
    elif version <= 17: 
     self.shell('input swipe %d %d %d %d' % (x0, y0, x1, y1)) 
    else: 
     self.shell('input touchscreen swipe %d %d %d %d %d' % (x0, y0, x1, y1, duration)) 

은 염두에 두어야 AndroidViewClient의 주요 목표 중 하나 culebra 조건의 넓은 범위에서 실행할 수있는 테스트를 생성하는 것이 아니라 하나 개의 존재 그들이 생성되었을 때. 다른 장치, 화면 또는 해상도에서 동일한 테스트를 실행할 수 있습니다. 또한 다른 오리엔테이션에서 동일한 테스트를 실행할 수 있으며 해당 사실의 영향을받지 않으려면 테스트가 생성 될 때 방향가 저장되고 결과적으로 장치가 회전되었습니다.

기간 사용법은 소스에서 볼 수 있듯이 안드로이드 버전에 따라 다릅니다.

단계은 현재 무시됩니다.

관련 문제