I am writing a UI automation test for a view on Apple TV. The view has a numeric input field(TVDigitEntryViewController
) which accepts 5 digits password. When the view loads the focus is on key '1' of the numeric apple input keyboard for tvOS. However when I try po pinEntryKeyboard.keys["1"].hasFocus
in the debug terminal it says false
.
Is there a way to find out which keyboard key has focus for tvOS input keyboard?
For more context I am adding some debug terminal output here:
(lldb) po pinEntryKeyboard.keys
...
...
↪︎Find: Descendants matching type Key
Output: {
Key, 0x102e4d2f0, {{645.0, 691.5}, {70.0, 80.0}}, label: '1'
Key, 0x102e4d410, {{707.0, 699.5}, {54.0, 64.0}}, label: '2'
Key, 0x102e4d530, {{761.0, 699.5}, {54.0, 64.0}}, label: '3'
Key, 0x102e4d650, {{815.0, 699.5}, {54.0, 64.0}}, label: '4'
Key, 0x102e4d770, {{869.0, 699.5}, {54.0, 64.0}}, label: '5'
Key, 0x102e4d890, {{923.0, 699.5}, {54.0, 64.0}}, label: '6'
Key, 0x102e4d9b0, {{977.0, 699.5}, {54.0, 64.0}}, label: '7'
Key, 0x102e4dad0, {{1031.0, 699.5}, {54.0, 64.0}}, label: '8'
Key, 0x102e4dbf0, {{1085.0, 699.5}, {54.0, 64.0}}, label: '9'
Key, 0x102e4dd10, {{1139.0, 699.5}, {54.0, 64.0}}, label: '0'
Key, 0x102e4de30, {{1193.0, 699.5}, {74.0, 64.0}}, identifier: 'delete', label: 'delete'
}
(lldb) po pinEntryKeyboard.keys["1"]
...
...
↪︎Find: Elements matching predicate '"1" IN identifiers'
Output: {
Key, 0x1032baa80, {{645.0, 691.5}, {70.0, 80.0}}, label: '1'
}
(lldb) po pinEntryKeyboard.keys["1"].hasFocus
t = 956.09s Find the "1" Key
false