Commit graph

13 commits

Author SHA1 Message Date
phantom
7c4b6f5ad8 UI: Add tests for operator poll
- Add a regression test verifying operator search respects poll() and
  only exposes an operator when its poll condition is satisfied.
- Add a poll sweep test that checks registered operators across
  supported editor types and verifies poll() always returns a `bool`
  without raising exceptions.
- Add a  `poll_sweep()` helper that reuses a single area while switching
  editor types and runs each operator's `poll()`  under the
  appropriate window, area, and region context.

Pull Request: https://projects.blender.org/blender/blender/pulls/162764
2026-08-26 07:07:19 +02:00
phantomsoldierking
e41a83b6f4 UI: Add UI tests for opening editors
Editor initialization by dynamically constructing a grid layout,
iterating through all settable editor variants, applying editor-specific
modes/subtypes, and validating successful initialization of each editor
instance.

These tests already proved themselves useful, we already found and fixed
a number of issues during development.

Pull Request: https://projects.blender.org/blender/blender/pulls/158780
2026-08-14 11:04:50 +02:00
phantomsoldierking
c3be8ecb22 UI: Add UI tests for Searching
UI simulation tests covering search/filter functionality (Ctrl + F),
verifies search behavior in the following editors:

- Properties Editor: Tests modifier search (Subdivision Surface)
- Outliner: Tests object filtering using object name search
- Dope Sheet: Tests F-Curve name filtering (location)
- Graph Editor: Tests animation curve search/filter behavior
- File Browser: Creates a temporary directory during runtime and Tests filename filtering through search.

Added dedicated test blend file: `tests/files/ui_tests/test_search_in_editors.blend`
`__search_test_cube__` a mesh object with Subdivision Surface modifier

Pull Request: https://projects.blender.org/blender/blender/pulls/159720
2026-06-22 12:19:03 +02:00
Bastien Montagne
52054aba9f Fix #155797: WM: Break events handling after an undo/redo.
This commit introduces a new `WM_event_handling_break` API, that allows
some code executed during event handling (e.g. operators etc.) to
request the `WM_main` main event loop to stop processing the event
queues and to do a full loop (including redraw step) before resuming
handling of the events.

`test_undo.py` undo tests had to be modified to add a small delay when
batch-triggering undo/redo events, to give Blender enough time to
process all the relevant events and reach the expected state.

Co-authored-by: Campbell Barton <ideasman42@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/156375
2026-03-31 10:42:04 +02:00
Sean Kim
1a47f7f1a0 Tests: Add UI tests for "gesture tools" in Sculpt Mode
Adds basic tests for the following types of operations:
* Hide
* Mask
* Face Set
* Trim

With the following types of gesture / selection modes:
* Box
* Lasso
* Line

Note that "Polyline" is not explicitly tested for now, since it is
primarily a form of the lasso tool that requires clicks to define the
area.

A new helper method is also added to `ui_test_utils.py` for drawing
the path of a circle.

Pull Request: https://projects.blender.org/blender/blender/pulls/153790
2026-02-03 02:32:22 +01:00
Sean Kim
51854e26db Refactor: Tests: Extract cursor_motion_data methods to helper module
This commit extracts a number of methods useful for paint strokes and
selection tools and moves them to the helper module to avoid further
duplication.

Pull Request: https://projects.blender.org/blender/blender/pulls/153680
2026-02-02 18:33:04 +01:00
Brecht Van Lommel
cdc6751be2 Tests: Make UI tests support loading blend files
The timer needs to be persistent then.

Pull Request: https://projects.blender.org/blender/blender/pulls/153631
2026-01-30 14:21:16 +01:00
Brecht Van Lommel
27b2b9646f Refactor: Tests: Move utilities to common module
* Some functions were copied between tests, now import a common
  module for these.
* Merge _test_vars and _test_window into a single function, and
  use the window index instead of excluding windows.
* Rename idle_until to not be a hack, and explain that it can be
  used for testing operator jobs while keeping the disclaimer that
  it should not typically be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/153159
2026-01-23 14:45:03 +01:00
Jesse Yurkovich
024f396d06 Cleanup: Fix typos in tests subdirectory
Fixes various typos

Co-authored-by: luz paz
Pull Request: https://projects.blender.org/blender/blender/pulls/148090
2025-10-14 22:35:54 +02:00
Sean Kim
f1c87d1bd2 Fix: Multi-window UI tests can produce inconsistent results
After creating a new scene in a separate window when performing UI
tests, the respective view layer for the window may not be updated
immediately in the event loop.

Previously, this was mitigated with a single `yield` statement that
would delay processing by a single tick. To fix this issue, this commit
adds the capability to yield for a specific `timedelta` and waits this
amount of time for the two affected tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/136012
2025-04-02 21:38:05 +02:00
Campbell Barton
61d857eba4 Tests: add Hyper modifier support to the "easy_keys" module 2025-03-27 12:13:29 +11:00
Campbell Barton
dfd363edbd Cleanup: add SPDX-FileCopyrightText 2023-11-07 15:37:47 +11:00
Campbell Barton
f2fcfc8730 Tests: move undo tests from SVN into tests/python/ui_simulate 2023-11-07 14:55:30 +11:00