Fixed Test case failure in PR 28867#28964
Fixed Test case failure in PR 28867#28964PureWeen merged 4 commits intodotnet:inflight/candidatefrom
Conversation
|
|
||
| <VerticalStackLayout Padding="10"> | ||
| <CollectionView | ||
| <local:CollectionView2 |
There was a problem hiding this comment.
Could you share more details about the differences found? Is it necessary to open an issue?
There was a problem hiding this comment.
While manually testing this drag-and-drop test of CollectionView items locally, we didn't observe any visible differences between CV1 and CV2. However, in CV1, the test consistently fails due to slight differences in the snapshot, even after applying a delay before capturing the image. Therefore, we are adding the test only for CV2 @jsuarezruiz
There was a problem hiding this comment.
@Ahamed-Ali can you compare these results to main?
The main thing that would be useful to determine here is if the candidate branch has a different behavior from the main branch.
Once we know that we can figure out if we want to
- fix this on candidate it there is a difference
- just take what you have here and fix on inflight/current at a later point in time.
There was a problem hiding this comment.
@Ahamed-Ali there's a bug in MauiLabel
RectangleF AlignVertical(RectangleF rect)
{
var frameSize = Frame.Size;
var height = Lines == 1 ? Font.LineHeight : SizeThatFits(frameSize).Height;
// ----------------------------------------- ^^^^^^^^ bug here ^^^^^^^^
if (height < frameSize.Height)Font.LineHeight does not account for padding, but SizeThatFits does, so that generates a rendering issue under some conditions.
To fix this, we just have to remove the padding on SizeThatFits:
RectangleF AlignVertical(RectangleF rect)
{
var frameSize = Frame.Size;
var height = Lines == 1 ? Font.LineHeight : SizeThatFits(frameSize).Height - TextInsets.Top - TextInsets.Bottom;
if (height < frameSize.Height)If you do this, you'll see that screenshot will work fine and we also solve a long standing bug.
There was a problem hiding this comment.
Will someone open a PR to fix the MauiLabel bug or should I do that?
There was a problem hiding this comment.
Will someone open a PR to fix the MauiLabel bug or should I do that?
Please do so :)
There was a problem hiding this comment.
Even after including your fix from #29031, Cv1 still fails when setting the font size on the label @albyrock87
There was a problem hiding this comment.
@Ahamed-Ali may you expand on this topic?
I clearly remember trying it out in this branch and the vertical alignment of the text was finally right.
So what's failing precisely?
There was a problem hiding this comment.
In the Issue28530 test, a FontSize was previously set for the Label inside the CollectionView template. Due to this, the test consistently failed because of slight differences in the snapshot comparison between cv1 and cv2, as discussed earlier - discussion
I have now removed the FontSize from the Label inside the CollectionView, and the test passes successfully.
However, based on your comment in this discussion, I re-tested the Issue28530 with the FontSize added back in the Label, along with the changes from your PR #29031. The same slight differences between cv1 and cv2 in the snapshot still occur after applying the changes from your PR. @albyrock87
ce792da to
53ccbaa
Compare
adab9b4 to
13bc3ba
Compare
|
/azp run MAUI-UITests-public |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* Resolved the flakey 28530 test * Resolved the test failures * Removed unwanted changes * Committed the Android image for the modified test
To fix the flaky
ReorderBetweenGroupsShouldNotOccurWhenCanMixGroupsIsFalsetest on iOS, I noticed a slight difference between cv1 and cv2. I have now used cv2 to resolve the test case issue.