Add condition check to determine if the IntelliJ window is currently full screen #1201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1165
Updated the UI test to check whether the IntelliJ IDE is already in a
maximized
orminimized
state before performing themaximize
orminimize
actions on the IntelliJ IDE window.This fix checks the size of the IntelliJ window against the screen size to decide if the window is maximized or not. If the window's width or height is greater than or equal to the screen size, it is considered full screen.
The reason for checking whether the window's width or height is greater than or equal to the screen size is that sometimes the IntelliJ window size exceeds the screen size. In such cases, it can be considered as full screen. It is not necessary for both the width and height of the IntelliJ IDE window to be greater than or equal to the screen size; if at least one dimension exceeds the screen size, the window can be considered as full screen.
If both the width and height of the IntelliJ IDE window are less than the screen size, then the window is not in full screen.
In the below screenshot:
During Maximization Method Call:
Dimension of the Windows OS screen: 1536x864
Dimension of the IntelliJ IDE window: 1550x830
In this case, the IntelliJ IDE width is greater than the screen size, so this is considered full screen.
During Minimization Method Call:
Dimension of the Windows OS screen: 1536x864
Dimension of the IntelliJ IDE window: 1400x776
In this case, both the width and height of the IntelliJ IDE window are less than the screen size, so the IDE is not in full screen.
I tested multiple scenarios by running the same and different tests without performing a cleanup. Everything worked as expected, even though maximizing the window was not performed. Minimizing the window worked correctly and vice versa.