Skip to content

testWindowMaximize is prone to failure #66

@uuf6429

Description

@uuf6429

First of all, the code is not very clear - it took me a few moments to realise what it was doing, all the while I was thinking "but where is the screen height defined and is 100 a sane maximised window height?"

$this->assertLessThanOrEqual(100, $session->evaluateScript($script));

It turns out that the test assumes that when a window is maximized, it will be the height of the screen minus some height for desktop widgets such as a taskbar. This extra height is defined as a buffer of up to 100px.

(it could be helpful to assign values to aptly named variables)

Anyway, while testing with Firefox on Selenium (standalone v2.53.1), it seems that the OS needs 102px - causing the test to fail.

A cursory search resulted in this fairly available API that could be used instead of manually checking the window size:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/WindowState#browser_compatibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions