Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion addons/gdUnit4/src/GdUnitSceneRunner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ extends RefCounted
## [/codeblock]
@abstract func await_func(func_name: String, ...args: Array) -> GdUnitFuncAssert


## The await_func_on function extends the functionality of await_func by allowing you to specify a source node within the scene.[br]
## It waits for a specified function on that node to return a value and returns a [GdUnitFuncAssert] object for assertions.[br]
## [member source] : The object where implements the function.[br]
Expand Down Expand Up @@ -319,6 +318,16 @@ extends RefCounted
@abstract func move_window_to_background() -> GdUnitSceneRunner


## Loads existing reference screenshot or saves current screenshot as new reference
## [param path]: Relative path from test file location (e.g., "screenshots/button_normal.png")
## [param source_node]: Optional node to capture (default: full scene viewport)
@warning_ignore("unused_parameter")
func capture_initial_screen_shot(source_node: Node, path: String) -> Image:
@warning_ignore("assert_always_true")
assert(true, "'initial_screen_shot' is not implemented!")
return null


## Return the current value of the property with the name <name>.[br]
## [member name] : name of property[br]
## [member return] : the value of the property
Expand Down
17 changes: 11 additions & 6 deletions addons/gdUnit4/src/GdUnitTestSuite.gd
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ func reset(obj: Variant) -> void:
## [/codeblock]
func monitor_signals(source: Object, _auto_free := true) -> Object:
@warning_ignore("unsafe_method_access")
__lazy_load("res://addons/gdUnit4/src/core/thread/GdUnitThreadManager.gd")\
.get_current_context()\
.get_signal_collector()\
__lazy_load("res://addons/gdUnit4/src/core/thread/GdUnitThreadManager.gd") \
.get_current_context() \
.get_signal_collector() \
.register_emitter(source, true) # force recreate to start with a fresh monitoring
return auto_free(source) if _auto_free else source

Expand Down Expand Up @@ -533,7 +533,7 @@ func any_packed_color_array() -> GdUnitArgumentMatcher:


## Argument matcher to match any instance of given class
func any_class(clazz :Object) -> GdUnitArgumentMatcher:
func any_class(clazz: Object) -> GdUnitArgumentMatcher:
@warning_ignore("unsafe_method_access")
return __gdunit_argument_matchers().any_class(clazz)

Expand Down Expand Up @@ -593,8 +593,8 @@ func assert_that(current: Variant) -> GdUnitAssert:
return assert_vector(current, false)
TYPE_DICTIONARY:
return assert_dict(current)
TYPE_ARRAY, TYPE_PACKED_BYTE_ARRAY, TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_INT64_ARRAY,\
TYPE_PACKED_FLOAT32_ARRAY, TYPE_PACKED_FLOAT64_ARRAY, TYPE_PACKED_STRING_ARRAY,\
TYPE_ARRAY, TYPE_PACKED_BYTE_ARRAY, TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_INT64_ARRAY, \
TYPE_PACKED_FLOAT32_ARRAY, TYPE_PACKED_FLOAT64_ARRAY, TYPE_PACKED_STRING_ARRAY, \
TYPE_PACKED_VECTOR2_ARRAY, TYPE_PACKED_VECTOR3_ARRAY, TYPE_PACKED_COLOR_ARRAY:
return assert_array(current, false)
TYPE_OBJECT, TYPE_NIL:
Expand Down Expand Up @@ -653,6 +653,11 @@ func assert_object(current: Variant) -> GdUnitObjectAssert:
return __lazy_load("res://addons/gdUnit4/src/asserts/GdUnitObjectAssertImpl.gd").new(current)


## An assertion for UI and visual testing of Godot nodes
func assert_ui(current: Node) -> GdUnitUIAssert:
return __lazy_load("res://addons/gdUnit4/src/asserts/GdUnitUIAssertImpl.gd").new(current)


func assert_result(current: Variant) -> GdUnitResultAssert:
return __lazy_load("res://addons/gdUnit4/src/asserts/GdUnitResultAssertImpl.gd").new(current)

Expand Down
Loading
Loading