Я пытаюсь имитировать автоматический видеозвонок с помощью adb, используя прикосновения и прокрутки. Сценарий:
Звуковые вызовы Device1 Device2, ответы Device2, Device1 запрашивает видеовызов (двунаправленный), Device2 пытается ответить и не удается. Связанная с проводкой вещь заключается в том, что иногда она работает, но большая часть ее не срабатывает в тот момент, когда устройство2 пытается ответить через прокрутку adb.
вот код:
@Test(timeout = 60000000)
/**
*
*/
@TestProperties(name = "Video call / Normal video call")
public void VT111_0011() throws InterruptedException, IOException, AWTException {
initTestVariable("Normal_Video_Call_Test_VT111_0011");
sleep(idleBeforeTest);
System.out.println("Starting normal video test");
Android.adbCommand(secondDevice.getDevice1(), "adb -s " + secondDevice.getDeviceID() + " shell input touchscreen swipe 355 858 590 858");
for(int i=0; i<Iteration; i++) {
moveMouse();
Jsystem.broadCastMessage("\nIteration " + i, globalVar.nameForLogFile);
cleanLogs();
firstDevice.call(secondDevice);
Thread.sleep(2000);
if(secondDevice.isRinging())
secondDevice.answerCall(1000);
else{
ringingFail();
}
// Start video by gui
Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 650 380");
Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 420 470");
Thread.sleep(1000);
Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 197 780"); // 197 920 Video bidirectional
Thread.sleep(5500);
// Device2 answers video
Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 355 858"); // 197 920 Video bidirectional
Android.adbCommand(secondDevice.getDevice1(), "adb -s " + secondDevice.getDeviceID() + " shell input touchscreen swipe 355 858 590 858");
Thread.sleep(200);
Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 60 372");
Android.adbCommand(secondDevice.getDevice1(),"adb -s " + secondDevice.getDeviceID() + " shell input tap 60 372");
/* Thread.sleep(5000);
if((!firstDevice.isInCall()) || (!secondDevice.isInCall())){
inCallFail();
continue;
} */
int failsCounter = 0;
VerifyVideo verifyVideo = new VerifyVideo();
for(int j = 8; j<10; j++){
if(verifyVideo.verrfiyVideo(firstDevice, secondDevice) == false)
failsCounter++;
}
if(failsCounter>2) {
Jsystem.broadCastMessage("****** TEST FAILED, VIDEO DOSENT WORK GOOD ENOUGH ****** " , globalVar.nameForLogFile);
System.out.println("Number of fails: " + failsCounter);
comparePhototsFail();
}
firstDevice.endCall();
secondDevice.endCall();
sleep(TimeBetweenIteration);
}
}
Любые идеи? Спасибо.