Skip to content

Commit 167e9b1

Browse files
david-allisonmikehardy
authored andcommitted
test: add AlertDialog.message helper
1 parent 1a563a3 commit 167e9b1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AnkiDroid/src/test/java/com/ichi2/anki/dialogs/utils/AlertDialogUtils.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ val AlertDialog.title
3838
"androidx.appcompat.R.id.alertTitle not found"
3939
}.text.toString()
4040

41+
val AlertDialog.message
42+
get() =
43+
requireNotNull(this.findViewById<TextView>(android.R.id.message)) {
44+
"android.R.id.message not found"
45+
}.text.toString()
46+
4147
fun AlertDialog.performPositiveClick() {
4248
// This exists as callOnClick did not call the listener
4349
val positiveButton = assertNotNull(getButton(DialogInterface.BUTTON_POSITIVE), message = "positive button")

0 commit comments

Comments
 (0)