Timer overhaul: update tests

This commit is contained in:
John McCardle 2026-01-03 22:44:53 -05:00
commit cec76b63dc
78 changed files with 521 additions and 495 deletions

View file

@ -15,12 +15,12 @@ frame = mcrfpy.Frame(pos=(100, 100), size=(200, 200))
frame.fill_color = mcrfpy.Color(255, 100, 100, 255)
ui.append(frame)
def test_mode(runtime):
def test_mode(timer, runtime):
try:
# Try to take a screenshot - this should work in both modes
automation.screenshot("test_screenshot.png")
print("PASS: Screenshot capability available")
# Check if we can interact with the window
try:
# In headless mode, this should still work but via the headless renderer
@ -28,12 +28,12 @@ def test_mode(runtime):
print("PASS: Click automation available")
except Exception as e:
print(f"Click failed: {e}")
except Exception as e:
print(f"Screenshot failed: {e}")
print("Test complete")
sys.exit(0)
# Run test after render loop starts
mcrfpy.setTimer("test", test_mode, 100)
test_timer = mcrfpy.Timer("test", test_mode, 100, once=True)