diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-05-27 23:21:49 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-05-27 23:21:52 +0200 |
| commit | 454ec831111273bfe37b9f397b21bc77786c0bc8 (patch) | |
| tree | fb2769ed6243b41341119fa01df97f52e66695fc /Tests/ui_helpers.gd | |
| parent | 98776908265c4b4d6e6a3a41df0f8e534b44e406 (diff) | |
| download | texty-454ec831111273bfe37b9f397b21bc77786c0bc8.tar.xz texty-454ec831111273bfe37b9f397b21bc77786c0bc8.zip | |
tests: extract UI helper functions
Diffstat (limited to 'Tests/ui_helpers.gd')
| -rw-r--r-- | Tests/ui_helpers.gd | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/ui_helpers.gd b/Tests/ui_helpers.gd new file mode 100644 index 0000000..858a639 --- /dev/null +++ b/Tests/ui_helpers.gd @@ -0,0 +1,17 @@ +extends Node + +class_name UiHelpers + +static func click_control(sender, control: Control): + var rect = control.get_global_rect() + var center = (rect.end - rect.size / 2) + sender.mouse_left_button_down(center, center) \ + .hold_for('1f') \ + .wait('1f') + return sender + +static func press_key(sender, key): + sender.key_down(key) \ + .hold_for('1f') \ + .wait('1f') + return sender |
