Files
MosisService/designer/test/test_manual_clicks.ahk
2026-01-16 12:43:06 +01:00

78 lines
2.3 KiB
AutoHotkey

; Mosis Designer Manual Click Test
; AutoHotkey v2
; Tests clicking on specific app icons with an already-running designer
#Requires AutoHotkey v2.0
#Include "lib\utils.ahk"
; Wait for designer to be running
LogMessage("Looking for designer window...")
LogMessage("Please start the designer manually if not running:")
LogMessage(" cd designer && build\\Debug\\mosis-designer.exe ..\\src\\main\\assets\\apps\\home\\home.rml")
hwnd := WaitForDesignerWindow(30000) ; 30 second timeout
if (!hwnd) {
MsgBox("Designer window not found after 30 seconds. Exiting.")
ExitApp()
}
LogMessage("Found designer window: " . hwnd)
; Get and display client area info
client := GetClientArea(hwnd)
if (client) {
LogMessage("Client area: x=" . client.x . " y=" . client.y . " w=" . client.w . " h=" . client.h)
}
; Interactive test loop
MsgBox("Designer found! Click OK to start click tests.`n`nWe will click on the Phone app icon.")
; Test 1: Click Phone app
LogMessage("Test 1: Clicking Phone app at (67, 120)")
ClickPhone(67, 120, hwnd)
Sleep(500)
result := MsgBox("Did the screen change to the Dialer?", "Verify", "YesNo")
if (result = "Yes") {
LogMessage("Test 1 PASSED: Phone app click worked")
} else {
LogMessage("Test 1 FAILED: Phone app click did not work")
}
; Give user time to see result
Sleep(1000)
; Test 2: Click Messages dock
MsgBox("Now testing Messages dock item. Click OK to continue.")
LogMessage("Test 2: Clicking Messages dock at (202, 920)")
ClickPhone(202, 920, hwnd)
Sleep(500)
result := MsgBox("Did the screen change to Messages?", "Verify", "YesNo")
if (result = "Yes") {
LogMessage("Test 2 PASSED: Messages dock click worked")
} else {
LogMessage("Test 2 FAILED: Messages dock click did not work")
}
Sleep(1000)
; Test 3: Different coordinates for Messages (in case dock is higher)
MsgBox("Testing alternative dock position. Click OK to continue.")
LogMessage("Test 3: Clicking Messages at alternative position (202, 880)")
ClickPhone(202, 880, hwnd)
Sleep(500)
result := MsgBox("Did anything happen?", "Verify", "YesNo")
if (result = "Yes") {
LogMessage("Test 3: Alternative position worked better")
} else {
LogMessage("Test 3: Alternative position also failed")
}
; Summary
MsgBox("Tests complete! Check test_run.log for results.`n`nPath: " . A_ScriptDir . "\test_run.log")
ExitApp()