mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-18 03:48:08 +00:00
37 lines
No EOL
1.1 KiB
Python
37 lines
No EOL
1.1 KiB
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):
|
|
# Run Linphone
|
|
runComponent = 'org.linphone' + '/' + 'org.linphone.setup.LinphoneActivity'
|
|
self.device.startActivity(component=runComponent)
|
|
|
|
# Be sure to be on dialer screen
|
|
dialer = self.find('dialer')
|
|
self.easyDevice.touch(dialer, MonkeyDevice.DOWN_AND_UP)
|
|
|
|
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() |