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

Use a fixed WinUI window size for Appium test app #16956

Merged
merged 9 commits into from
Aug 25, 2023

Conversation

BretJohnson
Copy link
Member

This makes the screenshots more deterministic, more likely to match between dev machines and CI.

Previously the window size was the WinUI default, taking up maybe 2/3 of the screen width - so it
was huge on huge monitors, small on small monitors.

This makes the screenshots more deterministic, more likely
to match between dev machines and CI.
@BretJohnson BretJohnson requested a review from a team as a code owner August 23, 2023 16:59

protected override Window CreateWindow(IActivationState activationState)
{
#if WINDOWS
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't we have the same problem on catalyst?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good point. Updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

(And I updated this again, with the Catalyst sizing workaround code suggested by @mattleibow)

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(56,14): error CS0219: The variable 'desktopWindowWidth' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-ios]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(57,14): error CS0219: The variable 'desktopWindowHeight' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-ios]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(56,14): error CS0219: The variable 'desktopWindowWidth' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-tizen]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(57,14): error CS0219: The variable 'desktopWindowHeight' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-tizen]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(56,14): error CS0219: The variable 'desktopWindowWidth' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-android]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(57,14): error CS0219: The variable 'desktopWindowHeight' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-android]
    256 Warning(s)
    6 Error(s)

https://dev.azure.com/xamarin/public/_build/results?buildId=94655&view=logs&j=22083a8f-f531-5d1a-9d1c-44debe18920a&t=83e331f4-aaf7-5ed2-1ec8-d953254e90ba&l=9384

@BretJohnson
Copy link
Member Author

D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(56,14): error CS0219: The variable 'desktopWindowWidth' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-ios]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(57,14): error CS0219: The variable 'desktopWindowHeight' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-ios]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(56,14): error CS0219: The variable 'desktopWindowWidth' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-tizen]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(57,14): error CS0219: The variable 'desktopWindowHeight' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-tizen]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(56,14): error CS0219: The variable 'desktopWindowWidth' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-android]
D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\MauiProgram.cs(57,14): error CS0219: The variable 'desktopWindowHeight' is assigned but its value is never used [D:\a\_work\1\s\src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj::TargetFramework=net7.0-android]
    256 Warning(s)
    6 Error(s)

https://dev.azure.com/xamarin/public/_build/results?buildId=94655&view=logs&j=22083a8f-f531-5d1a-9d1c-44debe18920a&t=83e331f4-aaf7-5ed2-1ec8-d953254e90ba&l=9384

fixed

@Eilon Eilon added the area-testing Unit tests, device tests label Aug 24, 2023
sbanni
sbanni previously approved these changes Aug 24, 2023
mattleibow
mattleibow previously approved these changes Aug 25, 2023
@BretJohnson BretJohnson dismissed stale reviews from mattleibow and sbanni via a918ec6 August 25, 2023 09:06
@rmarinho rmarinho merged commit cdaa4e5 into main Aug 25, 2023
38 of 41 checks passed
@rmarinho rmarinho deleted the fix-window-size-test-app branch August 25, 2023 13:57
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
@samhouts samhouts added the fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing Unit tests, device tests fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants