Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add condition check to determine if the IntelliJ window is currently full screen #1201

Conversation

vaisakhkannan
Copy link
Contributor

@vaisakhkannan vaisakhkannan commented Dec 18, 2024

Fixes #1165

Updated the UI test to check whether the IntelliJ IDE is already in a maximized or minimized state before performing the maximize or minimize 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.

Screenshot 2024-12-18 182613

Copy link
Contributor

@dessina-devasia dessina-devasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vaisakhkannan vaisakhkannan merged commit ebc7a3c into OpenLiberty:main Jan 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows Automated Test Failure: component must be showing on the screen
3 participants