-
Notifications
You must be signed in to change notification settings - Fork 572
Test: deselect on escape #11685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Test: deselect on escape #11685
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
538c120
Add hierarchical queries to Harness
aedm bd3f600
Work on panel selector
aedm 6bf2ba4
Progess
aedm 4a5c995
Updates
aedm 937753d
Progress
aedm 5e8f959
Work
aedm 8d818b7
Work
aedm 676d246
work
aedm 1d765c4
Lint
aedm c7153ec
lint
aedm 33b638b
Clippy
aedm c000f96
Merge branch 'main' into aedm/11628-add-hierarchical-queries-to-harness
aedm 1ce498f
Removes run_ok()
aedm 2ed981a
Adds a comment
aedm 313c19f
Adds deselect on escape test
aedm d29d4b2
Merge branch 'main' into aedm/deselect-on-escape
aedm 4f2e10c
Update
aedm b80317b
Merge branch 'main' into aedm/deselect-on-escape
aedm b47e1ec
Updates snapshots
aedm 2a8e041
Updates
aedm e198f6b
Adds comment
aedm 8d85301
Merge branch 'main' into aedm/deselect-on-escape
aedm 1d07bee
Adds another snapshot
aedm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
tests/python/release_checklist/check_deselect_on_escape.py
This file was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
tests/rust/re_integration_test/tests/deselect_on_escape.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| //! Test that pressing the Escape key will back out of dialogs etc. | ||
|
|
||
| use re_integration_test::HarnessExt as _; | ||
| use re_sdk::TimePoint; | ||
| use re_sdk::log::RowId; | ||
| use re_viewer::external::re_viewer_context::ViewClass as _; | ||
| use re_viewer::external::{re_types, re_view_spatial}; | ||
| use re_viewer::viewer_test_utils::{self, HarnessOptions}; | ||
| use re_viewport_blueprint::ViewBlueprint; | ||
|
|
||
| fn make_test_harness<'a>() -> egui_kittest::Harness<'a, re_viewer::App> { | ||
| let mut harness = viewer_test_utils::viewer_harness(&HarnessOptions { | ||
| window_size: Some(egui::vec2(1024.0, 1024.0)), | ||
| ..Default::default() | ||
| }); | ||
| harness.init_recording(); | ||
| harness.set_selection_panel_opened(false); | ||
|
|
||
| // Log some data | ||
| harness.log_entity("boxes3d", |builder| { | ||
| builder.with_archetype( | ||
| RowId::new(), | ||
| TimePoint::STATIC, | ||
| &re_types::archetypes::Boxes3D::from_centers_and_half_sizes( | ||
| [(0.0, 0.0, 0.0)], | ||
| [(1.0, 0.4, 0.2)], | ||
| ) | ||
| .with_colors([0xFF9001FF]), | ||
| ) | ||
| }); | ||
|
|
||
| harness.clear_current_blueprint(); | ||
| harness.setup_viewport_blueprint(move |_viewer_context, blueprint| { | ||
| let mut view3d = | ||
| ViewBlueprint::new_with_root_wildcard(re_view_spatial::SpatialView3D::identifier()); | ||
| view3d.display_name = Some("3D view".into()); | ||
| blueprint.add_view_at_root(view3d); | ||
| }); | ||
|
|
||
| harness | ||
| } | ||
|
|
||
| #[tokio::test(flavor = "multi_thread")] | ||
| pub async fn test_deselect_on_escape() { | ||
| let mut harness = make_test_harness(); | ||
|
|
||
| // Select view then press escape, view should be deselected | ||
| harness.blueprint_tree().click_label("3D view"); | ||
| harness.key_press(egui::Key::Escape); | ||
| harness.snapshot_app("deselect_on_escape_1"); | ||
|
|
||
| // Select view, click on dropdown, then press escape, view remains selected | ||
| harness.blueprint_tree().click_label("3D view"); | ||
| harness.set_selection_panel_opened(true); | ||
| harness.click_label("GradientDark"); | ||
| harness.snapshot_app("deselect_on_escape_2"); | ||
| harness.key_press(egui::Key::Escape); | ||
| harness.snapshot_app("deselect_on_escape_3"); | ||
|
|
||
| // Select view, open "add view or container" modal, escape, view remains selected | ||
| harness.blueprint_tree().click_label("3D view"); | ||
| harness.click_label("Open menu with more options"); | ||
| harness.click_label_contains("Add view or container"); | ||
| harness.snapshot_app("deselect_on_escape_4"); | ||
| harness.key_press(egui::Key::Escape); | ||
| harness.snapshot_app("deselect_on_escape_5"); | ||
|
|
||
| // Select view, right click on blueprint tree, escape, view remains selected | ||
| harness.blueprint_tree().click_label("3D view"); | ||
| harness.blueprint_tree().right_click_label("3D view"); | ||
| harness.snapshot_app("deselect_on_escape_6"); | ||
| harness.key_press(egui::Key::Escape); | ||
| harness.snapshot_app("deselect_on_escape_7"); | ||
aedm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Whatever was selected should become deselected after pressing escape again | ||
| harness.key_press(egui::Key::Escape); | ||
| harness.set_selection_panel_opened(false); | ||
| harness.snapshot_app("deselect_on_escape_8"); | ||
| } | ||
aedm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
tests/rust/re_integration_test/tests/snapshots/deselect_on_escape_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "xtemp"? |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.