Test suite modernization
This commit is contained in:
parent
0969f7c2f6
commit
52fdfd0347
141 changed files with 9947 additions and 4665 deletions
|
|
@ -7,33 +7,32 @@ import sys
|
|||
|
||||
# Create scene
|
||||
detect_test = mcrfpy.Scene("detect_test")
|
||||
mcrfpy.current_scene = detect_test
|
||||
ui = detect_test.children
|
||||
detect_test.activate()
|
||||
|
||||
# Create a frame
|
||||
frame = mcrfpy.Frame(pos=(100, 100), size=(200, 200))
|
||||
frame.fill_color = mcrfpy.Color(255, 100, 100, 255)
|
||||
ui.append(frame)
|
||||
|
||||
def test_mode(timer, runtime):
|
||||
# Render a frame so screenshot has content
|
||||
mcrfpy.step(0.01)
|
||||
|
||||
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:
|
||||
# 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
|
||||
automation.click(200, 200)
|
||||
print("PASS: Click automation available")
|
||||
except Exception as e:
|
||||
print(f"Click failed: {e}")
|
||||
|
||||
# In headless mode, this should still work but via the headless renderer
|
||||
automation.click(200, 200)
|
||||
print("PASS: Click automation available")
|
||||
except Exception as e:
|
||||
print(f"Screenshot failed: {e}")
|
||||
print(f"Click failed: {e}")
|
||||
|
||||
print("Test complete")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f"Screenshot failed: {e}")
|
||||
|
||||
# Run test after render loop starts
|
||||
test_timer = mcrfpy.Timer("test", test_mode, 100, once=True)
|
||||
print("Test complete")
|
||||
sys.exit(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue