Add test for clearing password

Switch clear element tests to use `TableLayout10`, so that we can also test against a password field (see #3610). Also clean up some redundancy in testing hide keyboard.