Target visible controls in dialog tests

This commit is contained in:
Dylan M. Taylor
2026-11-20 13:18:43 -05:00
parent 88a8d6e6dd
commit c91b117fb1
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -72,7 +72,8 @@ fn run_and_create_actions() {
arg.focus();
arg.type_text("DRAFT");
h.run_steps(2);
h.get_by_label("Save").click();
// Exiting overlays remain in the accessibility tree while hidden during their fade.
h.get_by(|node| node.role() == Role::Button && !node.is_hidden() && node.label().as_deref() == Some("Save")).click();
h.run_steps(3);
assert_eq!(h.state().custom_actions.len(), 1);
h.get_by_label("1. Add watermark: DRAFT");
+1 -1
View File
@@ -58,7 +58,7 @@ fn space_audit_tab_measures_the_file() {
crate::support::wait_until(&mut h, "the space audit", |app| !audit(app).is_empty());
h.run_steps(2);
let card = dialog_rect(&h);
let total = h.get_by_label("Total").rect();
let total = h.get_by_role_and_label(egui::accesskit::Role::ListItem, "Total").rect();
assert!(card.contains_rect(total), "the Total row {total:?} lies in the dialog {card:?}");
}