Skip to content

[Testing] Fix for UITest Catalyst screenshot dimension inconsistency and image cropping issue #29204

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anandhan-rajagopal
Copy link
Contributor

@anandhan-rajagopal anandhan-rajagopal commented Apr 25, 2025

Description

This PR removes the previous workaround for handling Mac Catalyst screenshots in full-screen mode, as the underlying screenshot capture mechanism has been improved.

Issue

Screenshot verification tests for Mac Catalyst were inconsistent due to some test cases running in full-screen mode while others didn't. This was happening because:

  1. App.EnterFullScreen was called in one of the ScrollView test cases.
  2. Subsequent test cases continued to run in full-screen mode.
  3. In full-screen mode (1920x1051), screenshots were cropped at the top, leading to missing UI content (https://github.com/dotnet/maui/pull/28495/files#diff-5ae4a689264bc7e948ca6805e6e36cacd196a31179aa3e53d3ce1fa82f1a2605 )
  4. This led to inconsistent screenshots with cropped top content for several control categories:
    • ScrollView, SearchBar, Shape, Slider, SoftInput, Stepper, Switch, SwipeView
dimensions issue

Solution

  • Removed the conditional workaround in the ScrollViewUITest method that handled full-screen screenshots. The workaround was originally introduced to adjust for content cropping caused by full-screen dimensions. With the updated screenshot mechanism, this workaround is no longer necessary.
  • Screenshots now have consistent dimensions (789x563) across test runs.
  • This change also resolves the content cropping issue previously observed with dimensions of 1920x1051.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Apr 25, 2025
@anandhan-rajagopal anandhan-rajagopal marked this pull request as ready for review April 25, 2025 14:13
@Copilot Copilot AI review requested due to automatic review settings April 25, 2025 14:13
@anandhan-rajagopal anandhan-rajagopal requested a review from a team as a code owner April 25, 2025 14:13
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the legacy workaround for handling Mac Catalyst full-screen mode in the ScrollView UI tests. The changes aim to improve screenshot consistency by eliminating the conditional full-screen mode code.

  • Removed conditional full-screen mode adjustments in three test methods.
  • Ensured tests now rely on the updated screenshot capture mechanism.
Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.Shared.Tests/Tests/ScrollViewUITests.cs:24

  • Ensure that the removal of the full-screen workaround is fully validated by updated CI screenshots, as the tests now rely on the updated screenshot mechanism to maintain consistent dimensions.
#if MACCATALYST

@anandhan-rajagopal anandhan-rajagopal added the area-testing Unit tests, device tests label Apr 25, 2025
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants