SeleniumLibrary icon indicating copy to clipboard operation
SeleniumLibrary copied to clipboard

Added minimize keyword

Open lmartorella opened this issue 3 years ago • 8 comments

Added the access to minimize method, symmetrical to the maximize one.

lmartorella avatar Aug 30 '21 10:08 lmartorella

Please write test, acceptance or unit, for the new keyword.

aaltat avatar Aug 30 '21 12:08 aaltat

Hello, I would like to edit/copy the tests for the existing maximize_browser_window, the sister keyword. Could you please point me to the acceptance tests for that one? Thx, L

lmartorella avatar Aug 30 '21 13:08 lmartorella

It seems that we do not have one. But easy way would be to use https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Set%20Window%20Size and set window size something small Then use new keyword and verify that size is bigger.

aaltat avatar Aug 30 '21 14:08 aaltat

Added an acceptance test, using the underlying selenium tests as inspiration. However it seems that even in the selenium library such tests are disabled, perhaps due to instability or unable to access to the browser's maximized/minimized state on all the platforms and OSes.

The minimize test is only checking for windows.hidden. It seems that accessing to window position and size doesn't provide correct information (position unchanged, horizontal size changes to a random value but height is not). The maximize test is more robust and size/pos can be used as reference.

lmartorella avatar Aug 31 '21 08:08 lmartorella

Looks good for me. @emanlove what you want to do with the PR?

aaltat avatar Sep 01 '21 06:09 aaltat

Hi, I've rebased the branch, but I don't fully understand how to make the checks to pass.

lmartorella avatar Jul 29 '22 15:07 lmartorella

Checking against latest version of unit and acceptance tests but failing tests. Investigating at the moment and wondering if we are running in headless mode if this affects the Page Visibility correctness in reporting .. Did note that the Page Visibility API is supported by all major browsers so concern about browser support shouldn't be an issue.

emanlove avatar Oct 09 '22 13:10 emanlove

Mmm yes, it seems that the Windows suite runs in headless mode (browser created only once in the Suite Setup), so it will be quite hard to test the Minimize behavior there. There are no explicit documentation about Visibility API and headless mode interaction. Probably the best approach for such specific test is to run without the --headless flag, but I'm not sure if this violates some policy of the test suite.

lmartorella avatar Oct 11 '22 08:10 lmartorella