1#  Copyright (C) 2023 The Android Open Source Project
2#
3#  Licensed under the Apache License, Version 2.0 (the "License");
4#  you may not use this file except in compliance with the License.
5#  You may obtain a copy of the License at
6#
7#       http://www.apache.org/licenses/LICENSE-2.0
8#
9#  Unless required by applicable law or agreed to in writing, software
10#  distributed under the License is distributed on an "AS IS" BASIS,
11#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#  See the License for the specific language governing permissions and
13#  limitations under the License.
14
15
16
17
18from bluetooth_test import bluetooth_base_test
19from mobly import asserts
20from utilities.main_utils import common_main
21from utilities import constants
22
23
24
25class BluetoothPalette(bluetooth_base_test.BluetoothBaseTest):
26  """Bluetooth Palette Verification."""
27
28  def setup_test(self):
29    # Pair the devices
30    self.bt_utils.pair_primary_to_secondary()
31
32  def test_bluetooth_palette_verification(self):
33    """Tests Bluetooth Palette Verification."""
34    self.call_utils.open_bluetooth_palette()
35    self.call_utils.wait_with_log(5)
36    asserts.assert_true(self.call_utils.has_bluetooth_button(),'Unable to verify Bluetooth')
37    asserts.assert_true(self.call_utils.has_bluetooth_palette_phone_button(),'Unable to verify Phone')
38    asserts.assert_true(self.call_utils.has_bluetooth_palette_media_button(),'Unable to verify Media')
39    asserts.assert_true(self.call_utils.verify_device_name(),'Unable to verify Device Name')
40    self.call_utils.click_bluetooth_button()
41    self.call_utils.wait_with_log(10)
42    asserts.assert_false(self.call_utils.is_bluetooth_button_enabled(),'Bluetooth Button is Not disabled')
43    asserts.assert_false(self.call_utils.is_bluetooth_phone_button_enabled(),'Phone Button is Not disabled')
44    asserts.assert_false(self.call_utils.is_bluetooth_media_button_enabled(),'Media Button is Not disabled')
45
46
47if __name__ == '__main__':
48    common_main()
49