class TestDsdsReceiveCallOnBothSims(GaiaTestCase): def setUp(self): try: self.testvars['plivo'] except KeyError: raise SkipTest( 'Plivo account details not present in test variables') GaiaTestCase.setUp(self) @parameterized("1", 0, 'SIM1') @parameterized("2", 1, 'SIM2') def test_dsds_receive_call_on_both_sims(self, sim_value, sim_name): """Make a phone call from Plivo to each SIM.""" from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil(self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number']) self.call_uuid = self.plivo.make_call( to_number=self.environment.phone_numbers[sim_value].replace( '+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() # TODO Replace the following line by a check on the l10n ID # once bug 1104667 lands self.assertTrue(sim_name in call_screen.incoming_via_sim) call_screen.answer_call() self.plivo.wait_for_call_connected(self.call_uuid) Wait(self.marionette).until( lambda m: self.data_layer.active_telephony_state == 'connected') # TODO Replace the following line by a check on the l10n ID # once bug 1104667 lands self.assertTrue(sim_name in call_screen.incoming_via_sim) call_screen.hang_up() self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None def tearDown(self): # Switch back to main frame before Marionette loses track bug #840931 self.marionette.switch_to_frame() # In case an assertion fails this will still kill the call # An open call creates problems for future tests self.data_layer.kill_active_call() # Also ask Plivo to kill the call if needed if self.call_uuid: self.plivo.hangup_call(self.call_uuid) GaiaTestCase.tearDown(self)
class TestDsdsReceiveCallOnBothSims(GaiaTestCase): def setUp(self): try: self.testvars['plivo'] except KeyError: raise SkipTest('Plivo account details not present in test variables') GaiaTestCase.setUp(self) @parameterized("1", 0, 'SIM1') @parameterized("2", 1, 'SIM2') def test_dsds_receive_call_on_both_sims(self, sim_value, sim_name): """Make a phone call from Plivo to each SIM.""" from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number'] ) self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][sim_value].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() # TODO Replace the following line by a check on the l10n ID # once bug 1104667 lands self.assertTrue(sim_name in call_screen.incoming_via_sim) call_screen.answer_call() self.plivo.wait_for_call_connected(self.call_uuid) Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected') # TODO Replace the following line by a check on the l10n ID # once bug 1104667 lands self.assertTrue(sim_name in call_screen.incoming_via_sim) call_screen.hang_up() self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None def tearDown(self): # Switch back to main frame before Marionette loses track bug #840931 self.marionette.switch_to_frame() # In case an assertion fails this will still kill the call # An open call creates problems for future tests self.data_layer.kill_active_call() # Also ask Plivo to kill the call if needed if self.call_uuid: self.plivo.hangup_call(self.call_uuid) GaiaTestCase.tearDown(self)
class TestReceiveCall(GaiaTestCase): def setUp(self): try: self.testvars['plivo'] except KeyError: raise SkipTest('Plivo account details not present in test variables') GaiaTestCase.setUp(self) def test_receive_call(self): """Make a phone call from Plivo to the phone.""" from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number'] ) self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][0].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() call_screen.answer_call() self.plivo.wait_for_call_connected(self.call_uuid) Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected') call_screen.hang_up() self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None def tearDown(self): # Switch back to main frame before Marionette loses track bug #840931 self.marionette.switch_to_frame() # In case an assertion fails this will still kill the call # An open call creates problems for future tests self.data_layer.kill_active_call() # Also ask Plivo to kill the call if needed if self.call_uuid: self.plivo.hangup_call(self.call_uuid) GaiaTestCase.tearDown(self)
class TestReceiveCall(GaiaTestCase): def setUp(self): try: self.testvars['plivo'] except KeyError: raise SkipTest( 'Plivo account details not present in test variables') GaiaTestCase.setUp(self) def test_receive_call(self): """Make a phone call from Plivo to the phone.""" from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil(self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number']) self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][0].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call() call_screen.answer_call() self.plivo.wait_for_call_connected(self.call_uuid) Wait(self.marionette).until( lambda m: self.data_layer.active_telephony_state == 'connected') call_screen.hang_up() self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None def tearDown(self): # Switch back to main frame before Marionette loses track bug #840931 self.marionette.switch_to_frame() # In case an assertion fails this will still kill the call # An open call creates problems for future tests self.data_layer.kill_active_call() # Also ask Plivo to kill the call if needed if self.call_uuid: self.plivo.hangup_call(self.call_uuid) GaiaTestCase.tearDown(self)
class TestSetUpConferenceCall(GaiaTestCase): def setUp(self): try: self.testvars['plivo'] except KeyError: raise SkipTest('Plivo account details not present in test variables') GaiaTestCase.setUp(self) def test_set_up_conference_call(self): """Set up a conference between the remote phone and Plivo.""" test_phone_number = self.testvars['remote_phone_number'] from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil( self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number'] ) self.is_in_conference_call = False self.is_in_regular_call = False phone = Phone(self.marionette) phone.launch() call_screen = phone.keypad.call_number(test_phone_number) call_screen.wait_for_outgoing_call() self.is_in_regular_call = True Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected') self.call_uuid = self.plivo.make_call( to_number=self.environment.phone_numbers[0].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call_while_on_call() call_screen.answer_call_while_on_call() self.plivo.wait_for_call_connected(self.call_uuid) call_screen.merge_calls() self.is_in_regular_call = False self.is_in_conference_call = True self.assertEqual(call_screen.conference_label, 'Conference (2)') call_screen.hang_up() self.is_in_conference_call = False self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None def tearDown(self): # In case an assertion fails this will still kill the call # An open call creates problems for future tests if self.is_in_regular_call: self.data_layer.kill_active_call() if self.is_in_conference_call: self.data_layer.kill_conference_call() # Also ask Plivo to kill the call if needed if self.call_uuid: self.plivo.hangup_call(self.call_uuid) GaiaTestCase.tearDown(self)
class TestSetUpConferenceCall(GaiaTestCase): def setUp(self): try: self.testvars['plivo'] except KeyError: raise SkipTest( 'Plivo account details not present in test variables') GaiaTestCase.setUp(self) def test_set_up_conference_call(self): """Set up a conference between the remote phone and Plivo.""" test_phone_number = self.testvars['remote_phone_number'] from gaiatest.utils.plivo.plivo_util import PlivoUtil self.plivo = PlivoUtil(self.testvars['plivo']['auth_id'], self.testvars['plivo']['auth_token'], self.testvars['plivo']['phone_number']) self.is_in_conference_call = False self.is_in_regular_call = False phone = Phone(self.marionette) phone.launch() call_screen = phone.keypad.call_number(test_phone_number) call_screen.wait_for_outgoing_call() self.is_in_regular_call = True Wait(self.marionette).until( lambda m: self.data_layer.active_telephony_state == 'connected') self.call_uuid = self.plivo.make_call( to_number=self.testvars['local_phone_numbers'][0].replace('+', '')) call_screen = CallScreen(self.marionette) call_screen.wait_for_incoming_call_while_on_call() call_screen.answer_call_while_on_call() self.plivo.wait_for_call_connected(self.call_uuid) call_screen.merge_calls() self.is_in_regular_call = False self.is_in_conference_call = True self.assertEqual(call_screen.conference_label, 'Conference (2)') call_screen.hang_up() self.is_in_conference_call = False self.plivo.wait_for_call_completed(self.call_uuid) self.call_uuid = None def tearDown(self): # In case an assertion fails this will still kill the call # An open call creates problems for future tests if self.is_in_regular_call: self.data_layer.kill_active_call() if self.is_in_conference_call: self.data_layer.kill_conference_call() # Also ask Plivo to kill the call if needed if self.call_uuid: self.plivo.hangup_call(self.call_uuid) GaiaTestCase.tearDown(self)