duyminh1998 / pycmo

Command Modern Operations Learning Environment
Other
49 stars 23 forks source link

Enter scenario mouse click is flaky #26

Closed duyminh1998 closed 9 months ago

duyminh1998 commented 9 months ago

Summary

Sometimes the MoveMouseEnterScenario.ps1 script is flaky and we miss the "Enter scenario" button

Steps to reproduce

  1. Run the floridistan/restart_demo.py several times and you might see the mouse gets moved beyond the "Enter scenario" button.

What is the current bug behavior?

MoveMouseEnterScenario.ps1 does not always guarantee the movement of the mouse to the "Enter scenario" button and click on it

What is the expected correct behavior?

MoveMouseEnterScenario.ps1 will always move the mouse to the "Enter scenario" button and click on it

Relevant logs and/or screenshots

image

duyminh1998 commented 9 months ago

Helpful links What is the difference between subprocess.popen and subprocess.run about_Execution_Policies Capturing output from Powershell command and saving it in a variable Find all window titles of application through command line

duyminh1998 commented 9 months ago

Per this commit, we should think about making a clicker class that will run .bat or .ps1 scripts to click something (usually to close a window), but also check that the window has indeed been closed and restart the script as necessary. This will remove some flakiness induced by timing issues with our code. One piece of code that might break is the closeScenarioEndMessage.bat script, which closes the message that displays when the scenario ends. If this message takes too slow to show up and we fire the script before its appearance, we will throw off our timing.