New test : automatic configuration

This commit is contained in:
Sylvain Berfini 2012-09-04 15:39:58 +02:00
parent 6694eb7a4c
commit 00d1541e94
2 changed files with 55 additions and 1 deletions

View file

@ -5,10 +5,13 @@ from lib.LinphoneTest import LinphoneTest
class CallTest(LinphoneTest): class CallTest(LinphoneTest):
def precond(self): def precond(self):
# Run Linphone
runComponent = 'org.linphone' + '/' + 'org.linphone.setup.LinphoneActivity'
self.device.startActivity(component=runComponent)
# Be sure to be on dialer screen # Be sure to be on dialer screen
dialer = self.find('dialer') dialer = self.find('dialer')
self.easyDevice.touch(dialer, MonkeyDevice.DOWN_AND_UP) self.easyDevice.touch(dialer, MonkeyDevice.DOWN_AND_UP)
MonkeyRunner.sleep(1)
def test(self): def test(self):
# Type a SIP address # Type a SIP address

51
tests/config.py Normal file
View file

@ -0,0 +1,51 @@
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
from com.android.monkeyrunner.easy import EasyMonkeyDevice
from lib.LinphoneTest import LinphoneTest
class ConfigurationTest(LinphoneTest):
def setAccount(self, username, password, domain):
self.username = username
self.password = password
self.domain = domain
def precond(self):
# Run the setup assistant
runComponent = 'org.linphone' + '/' + 'org.linphone.setup.SetupActivity'
self.device.startActivity(component=runComponent)
MonkeyRunner.sleep(2)
def next(self):
# Press next button
next = self.find('setup_next')
self.easyDevice.touch(next, MonkeyDevice.DOWN_AND_UP)
def test(self):
self.next()
# Choose SIP account
login = self.find('setup_login_generic')
self.easyDevice.touch(login, MonkeyDevice.DOWN_AND_UP)
# Fill the fields
username = self.find('setup_username')
self.easyDevice.type(username, self.username)
password = self.find('setup_password')
self.easyDevice.type(password, self.password)
domain = self.find('setup_domain')
self.easyDevice.type(domain, self.domain)
# Hide the keyboard
self.press_back()
# Apply config
apply = self.find('setup_apply')
self.easyDevice.touch(apply, MonkeyDevice.DOWN_AND_UP)
return True
configTest = ConfigurationTest('Account configuration')
configTest.setAccount('monkey', 'cotcot', 'test.linphone.org')
configTest.run()