diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-15 00:42:12 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-15 00:42:12 +0000 |
commit | ae3a4433e60227e08712031653b3d3cf9c6b8dfb (patch) | |
tree | fbd5a3e5e5ff6339de6704f0d4a9e9c2c5f0b5b9 | |
parent | ad41b7f1f0cf40770937b7ebe49531b5dd3e6522 (diff) | |
parent | 26e34aa2e6e80ea1fcad6a78154e9832a4013add (diff) | |
download | platform_testing-android14-qpr2-s3-release.tar.gz |
Snap for 11220357 from 26e34aa2e6e80ea1fcad6a78154e9832a4013add to 24Q1-releaseandroid-14.0.0_r33android-14.0.0_r32android-14.0.0_r31android-14.0.0_r30android-14.0.0_r29android14-qpr2-s3-releaseandroid14-qpr2-s2-releaseandroid14-qpr2-s1-releaseandroid14-qpr2-release
Change-Id: Ic2a143807cbd18af3583da232aead40a7a0e9c0a
3 files changed, 121 insertions, 9 deletions
diff --git a/tests/automotive/mobly_tests/sms/Android.bp b/tests/automotive/mobly_tests/sms/Android.bp index 78367ddcf..3d5053cad 100644 --- a/tests/automotive/mobly_tests/sms/Android.bp +++ b/tests/automotive/mobly_tests/sms/Android.bp @@ -207,4 +207,31 @@ name: "SMSReadAutoSync", embedded_launcher: true, }, }, +} +python_test_host { +name: "SMSReadMessageDBSync", + main: "bt_sms_read_messagebd_sync_test.py", + srcs: ["bt_sms_read_messagebd_sync_test.py"], + libs: [ + "mobly", + "utilities", + "BluetoothSMSTestLibrary" + ], + test_suites: [ + "catbox", + ], + test_options: { + unit_test: false, + }, + data: [ + // Package the snippet with the mobly test + ":AutomotiveSnippet", + ":PhoneSnippet", + "bt_sms_config.yaml", + ], + version: { + py3: { + embedded_launcher: true, + }, + }, }
\ No newline at end of file diff --git a/tests/automotive/mobly_tests/sms/bt_sms_read_auto_sync_test.py b/tests/automotive/mobly_tests/sms/bt_sms_read_auto_sync_test.py index ebb11e909..413ad16bd 100644 --- a/tests/automotive/mobly_tests/sms/bt_sms_read_auto_sync_test.py +++ b/tests/automotive/mobly_tests/sms/bt_sms_read_auto_sync_test.py @@ -53,30 +53,26 @@ class SMSReadAutoSync(bluetooth_sms_base_test.BluetoothSMSBaseTest): self.call_utils.wait_with_log(30) self.target.load_snippet('mbs', android_device.MBS_PACKAGE) - def test_read_sms_auto_sync(self): - # Open the sms app - self.call_utils.open_sms_app() - - # Verify that there is no new sms currently - self.call_utils.verify_sms_app_unread_message(False) - # send a new sms target_phone_number = self.target.mbs.getPhoneNumber() self.phone_notpaired.mbs.sendSms(target_phone_number,constants.SMS_TEXT) self.call_utils.wait_with_log(10) + def test_read_sms_auto_sync(self): + # Verify the new UNREAD sms in IVI device self.call_utils.open_sms_app() self.call_utils.verify_sms_app_unread_message(True) # READ the message on paired phone self.call_utils.open_notification_on_phone(self.target) + self.call_utils.wait_with_log(5) self.target.mbs.clickUIElementWithText(constants.SMS_TEXT) + self.call_utils.wait_with_log(5) # Verify the SYNC READ sms in IVI device - self.call_utils.press_home() - self.call_utils.open_sms_app() self.call_utils.verify_sms_app_unread_message(False) + self.call_utils.verify_sms_preview_timestamp(True) def teardown_test(self): # Go to home screen diff --git a/tests/automotive/mobly_tests/sms/bt_sms_read_messagebd_sync_test.py b/tests/automotive/mobly_tests/sms/bt_sms_read_messagebd_sync_test.py new file mode 100644 index 000000000..7b4be1711 --- /dev/null +++ b/tests/automotive/mobly_tests/sms/bt_sms_read_messagebd_sync_test.py @@ -0,0 +1,89 @@ +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from utilities import constants +from utilities.main_utils import common_main +from utilities.common_utils import CommonUtils +from bluetooth_sms_test import bluetooth_sms_base_test +from mobly.controllers import android_device + +class SMSReadMessageDBSync(bluetooth_sms_base_test.BluetoothSMSBaseTest): + + def setup_class(self): + super().setup_class() + self.common_utils = CommonUtils(self.target, self.discoverer) + + def setup_test(self): + + # pair the devices + self.bt_utils.pair_primary_to_secondary() + + # wait for user permissions popup & give contacts and sms permissions + self.call_utils.wait_with_log(20) + self.common_utils.click_on_ui_element_with_text('Allow') + + # Clearing the sms from the phone + self.call_utils.clear_sms_app(self.target) + # Reboot Phone + self.target.unload_snippet('mbs') + self.call_utils.reboot_device(self.target) + self.call_utils.wait_with_log(30) + self.target.load_snippet('mbs', android_device.MBS_PACKAGE) + + def test_read_sms_messagedb_sync(self): + # Open the sms app + self.call_utils.open_sms_app() + + # Verify that there is no new sms currently + #self.call_utils.verify_sms_app_unread_message(False) + + # send a new sms + target_phone_number = self.target.mbs.getPhoneNumber() + self.phone_notpaired.mbs.sendSms(target_phone_number,constants.SMS_TEXT) + self.call_utils.wait_with_log(10) + + # Verify the new UNREAD sms in IVI device + self.call_utils.open_sms_app() + self.call_utils.verify_sms_app_unread_message(True) + + # READ the message on paired phone + self.call_utils.open_notification_on_phone(self.target) + self.call_utils.wait_with_log(5) + self.target.mbs.clickUIElementWithText(constants.SMS_TEXT) + + # Verify the SYNC READ sms in IVI device + self.call_utils.press_home() + self.call_utils.open_sms_app() + self.call_utils.verify_sms_app_unread_message(False) + self.call_utils.verify_sms_preview_timestamp(True) + + def teardown_test(self): + # Go to home screen + self.call_utils.press_home() + super().teardown_test() + +if __name__ == '__main__': + common_main()
\ No newline at end of file |