wooly905 / Project2020

Project 2020 - What you see is what you test by computer vision
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Let tests configure size of app window #5

Closed MRayermannMSFT closed 6 years ago

MRayermannMSFT commented 6 years ago

At a minimum the test engine should maximize app windows before starting, but ideally a test could specify the size of their window (either in px's or %'s of current resolution).

wooly905 commented 6 years ago

I checked Win32 api. I don't see a way to set the size by using px or % of current solution. So I think I'll make it "maximum" by default after launching the program to test. If you see a way to make a custom size, please let me know.

MRayermannMSFT commented 6 years ago

Sounds good!

wooly905 commented 6 years ago

No need to add an Win32 api to call. Just change ProcessInfo class to launch program in maximized style. So, add a new property in test json file - MakeLaunchedProgramMaximized. For example, { "FullName": "dummy-test", "ShortName": "dummytest", "LastUpdated": "2018-07-01 13:14", "Skip": "false", "ProgramToLaunch": "mspaint.exe", "MakeLaunchedProgramMaximized": "false", "Steps": [ { "Target": "image", "Search": ".\images\dummytest2-1.jpg", "ScreenArea": "top", "Action": "mouse.click", "Waiting": "2", "FailureReport": "true", "Retry": "2" }, { "Target": "", "Search": "", "ScreenArea": "", "Action": "keyboard.sendkeys", "ActionArgument": "email", "Waiting": "2", "FailureReport": "true" } ] }

if "MakeLaunchedProgramMaximized" is not found, it is default to 'true' which means that test program will be maximized after it is launched.

Code is merged to v.1.1.2.