2013-05-11 1 views
2

현재 안드로이드의 UI 오토메이터에서 현재 프로젝트의 테스트 케이스를 자동화하고 있습니다. 지금까지 패키지 com.myapp.testautomation에서 개별 공용 클래스로 작성했습니다 소수의 테스트 케이스는 장치 대시 보드 새 사용자 등록 로그 아웃 가 어떻게 한 번에 모든 경우를 runn하고 구축 할 로그인에서 앱 실행을 포함 테스트 스위트? 현재 다음과 같은 명령을 실행하여 이러한 경우를 개별적으로 실행하고 있습니다. adb 쉘 uiautomator runtest PrjoectXYZ.jar -c com.myapp.testautomation.New 사용자 등록 adb 쉘 uiautomator runtest PrjoectXYZ.jar -c com.myapp.testautomation.Login adb 쉘 uiautomator runtest PrjoectXYZ.jar -c com.myapp.testautomation.Logout안드로이드의 UI 오토메이터를 사용하여 테스트 케이스를 실행하는 방법

답변

0

하나의 방법으로 여러 개의 테스트 케이스를 실행하는 것이 발견되었습니다. 테스트 케이스가 포함 된 쉘 스크립트를 실행하는 것입니다. 예 :

0

한 클래스에서 모든 테스트를 실행하려면 대신이 작업을 수행 할 수 있습니다.

ant build 
    adb push /Users/xyz/Documents/workspace/ProjectXYZ/bin/ProjectXYZ.jar /data/local/tmp/ 
    adb shell uiautomator runtest PrjoectXYZ.jar -c com.myapp.testautomation.testCases#NewUserRegistration 
    adb shell uiautomator runtest PrjoectXYZ.jar -c com.myapp.testautomation.testCases#Login 
    adb shell uiautomator runtest PrjoectXYZ.jar -c com.myapp.testautomation.testCases#Logout 

공지 사항 테스트 케이스와 NewUserRegistration 사이에 '#'가합니다 (user2040344의 대답에서 작업). 이것은 동일한 클래스에서 하나의 메소드 만 호출한다는 것을 나타냅니다. 그 밖의 모든 것은 모든 테스트 케이스를 제어하는 ​​하나의 클래스를 가질 수 있다는 점을 제외하고는 동일하지만 여전히 개별적으로 사용할 수 있습니다.

0

가장 간단한 방법은 .bat 파일을 만드는 것입니다. 그 안에 모든 명령을 넣어 라. 이것을 여러 번 해본 적이있다. 다음과 같이 가장 쉬운 방법입니다. 예 :

adb shell uiautomator runtest dialler.jar -c sprd.performance.dialler.Dialler 
adb shell uiautomator runtest contactscroll.jar -c sprd.performance.contactscroll.ContactScroll 

다음은 실행하기위한 두 가지 스크립트입니다. 그들을 위해서 .bat 파일을 만들고 .bat 파일을 더블 클릭하십시오.

관련 문제