mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
34 lines
No EOL
995 B
Python
34 lines
No EOL
995 B
Python
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
|
|
from com.android.monkeyrunner.easy import EasyMonkeyDevice
|
|
|
|
from lib.LinphoneTest import LinphoneTest
|
|
|
|
class CallTest(LinphoneTest):
|
|
def precond(self):
|
|
# Be sure to be on dialer screen
|
|
dialer = self.find('dialer')
|
|
self.easyDevice.touch(dialer, MonkeyDevice.DOWN_AND_UP)
|
|
MonkeyRunner.sleep(1)
|
|
|
|
def test(self):
|
|
# Type a SIP address
|
|
address = self.find('Adress')
|
|
self.easyDevice.type(address, 'cotcot@sip.linphone.org')
|
|
self.device.press('KEYCODE_BACK', MonkeyDevice.DOWN_AND_UP)
|
|
|
|
# Try to call previously typed address
|
|
call = self.find('Call')
|
|
self.easyDevice.touch(call, MonkeyDevice.DOWN_AND_UP)
|
|
MonkeyRunner.sleep(2)
|
|
|
|
# Check if the call is outgoing correctly
|
|
contact = self.find('contactNameOrNumber')
|
|
return contact
|
|
|
|
def postcond(self):
|
|
# Stop the call
|
|
hangUp = self.find('hangUp')
|
|
self.easyDevice.touch(hangUp, MonkeyDevice.DOWN_AND_UP)
|
|
|
|
callTest = CallTest('Call')
|
|
callTest.run() |