github emilk/egui 0.30.0
0.30.0 - egui_kittest and modals

2 days ago

egui is an easy-to-use immediate mode GUI for Rust that runs on both web and native.

Try it now: https://www.egui.rs/

egui development is sponsored by Rerun, a startup building an SDK for visualizing streams of multimodal data.

egui_kittest

This release welcomes a new crate to the family: egui_kittest.
egui_kittest is a testing framework for egui, allowing you to test both automation (simulated clicks and other events),
and also do screenshot testing (useful for regression tests).
egui_kittest is built using kittest, which is a general GUI testing framework that aims to work with any Rust GUI (not just egui!).
kittest uses the accessibility library AccessKit for automatation and to query the widget tree.

kittest and egui_kittest are written by @lucasmerlin.

Here's a quick example of how to use egui_kittest to test a checkbox:

use egui::accesskit::Toggled;
use egui_kittest::{Harness, kittest::Queryable};

fn main() {
    let mut checked = false;
    let app = |ui: &mut egui::Ui| {
        ui.checkbox(&mut checked, "Check me!");
    };

    let mut harness = egui_kittest::Harness::new_ui(app);

    let checkbox = harness.get_by_label("Check me!");
    assert_eq!(checkbox.toggled(), Some(Toggled::False));
    checkbox.click();

    harness.run();

    let checkbox = harness.get_by_label("Check me!");
    assert_eq!(checkbox.toggled(), Some(Toggled::True));

    // You can even render the ui and do image snapshot tests
    #[cfg(all(feature = "wgpu", feature = "snapshot"))]
    harness.wgpu_snapshot("readme_example");
}

egui changelog

✨ Highlights

⭐ Added

🔧 Changed

🐛 Fixed

eframe changelog

BREAKING: you now need to enable the wayland and/or x11 features to get Linux support, including getting it to work on most CI systems.

⭐ Added

🔧 Changed

🐛 Fixed

  • iOS: Support putting UI next to the dynamic island #5211 by @frederik-uni
  • Prevent panic when copying text outside of a secure context #5326 by @YgorSouza
  • Fix accidental change of FallbackEgl to PreferEgl #5408 by @e00E

Don't miss a new egui release

NewReleases is sending notifications on new releases.