diff --git a/crates/ui-egui/tests/it/text_select.rs b/crates/ui-egui/tests/it/text_select.rs index 064bd0d956..251f822b37 100644 --- a/crates/ui-egui/tests/it/text_select.rs +++ b/crates/ui-egui/tests/it/text_select.rs @@ -59,8 +59,11 @@ fn harness_clip( app } }); - // Wait for the text layer itself (#1277), not for a fixed second. - crate::support::wait_until(&mut h, "the page's text layer", |app| app.views[0].glyph_screen_pos(0, 5).is_some() && !app.render_pending()); + // Wait for the text layer itself (#1277), not for a fixed second. An encrypted document opens + // in the background after `setup` submits its password, so its view may not exist yet. + crate::support::wait_until(&mut h, "the page's text layer", |app| { + app.views.first().is_some_and(|view| view.glyph_screen_pos(0, 5).is_some()) && !app.render_pending() + }); let at = h.state().views[0].glyph_screen_pos(0, 5).expect("text layer loaded"); h.hover_at(at); h.run_steps(1);