-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix Disabling some image tests after updating net9.0 with main #25770
base: main
Are you sure you want to change the base?
Fix Disabling some image tests after updating net9.0 with main #25770
Conversation
Hey there @devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a delay, ensuring the second button becomes visible and clickable, which resolved the issue and allowed the test to pass as expected.
Can we add a WaitForElement on the second button opposed to just adding delays?
@@ -32,7 +32,7 @@ public MainPage() | |||
|
|||
popOnAppearing.Appearing += async (sender, args) => | |||
{ | |||
await Task.Yield(); | |||
await Task.Delay(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just include a View, like a Label, and wait for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the test case host app, a new page is being pushed and then immediately popped on the page's Appearing event. As a result, the page's UI does not load, making it impossible to validate views like labels. Here, added a slight delay before popping the page in the Appearing event to avoid exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the exception? Adding a delay to fix the issue may mean something else went wrong.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@@ -32,7 +32,7 @@ public MainPage() | |||
|
|||
popOnAppearing.Appearing += async (sender, args) => | |||
{ | |||
await Task.Yield(); | |||
await Task.Delay(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we wire into an event on the page we're popping back to and add a label?
like
- push
- pop from appearing
- and then incremented a counter or inside "OnNavigatedTo" we could add a label indicating it was popped back to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a different test case? If there is a problem popping from Appearing, do we want to fix that of just say "don't do that"?
We can still use your idea of a label update because the NavigatedTo will fire again on the first/initial page? When you pop the new page, we can increment the counter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if this is because of animations, then we will have to document that you can't pop in Appearing while pushing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a delay might be changing the test here. It seems that the test may have been testing the logic of popping in the Appearing? So, we may have to see if that is the main issue and maui has a bug.
Or, maybe this is not a supported operation? We can only pop in some Appeared and/or NavigatedTo. Either way, this is either a bug in maui or just a case of the Windows limitations and we need to document that it is not supported.
I assume it was working until @PureWeen fixed some navigation issue and events. Since we like those changes, we should see if there needs to be some fine tuning or indicate that removing a page while it is still coming in is not really supported.
Or we can rather queue the navigation operation until the page is settled?
@@ -32,7 +32,7 @@ public MainPage() | |||
|
|||
popOnAppearing.Appearing += async (sender, args) => | |||
{ | |||
await Task.Yield(); | |||
await Task.Delay(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the exception? Adding a delay to fix the issue may mean something else went wrong.
@@ -32,7 +32,7 @@ public MainPage() | |||
|
|||
popOnAppearing.Appearing += async (sender, args) => | |||
{ | |||
await Task.Yield(); | |||
await Task.Delay(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a different test case? If there is a problem popping from Appearing, do we want to fix that of just say "don't do that"?
We can still use your idea of a label update because the NavigatedTo will fire again on the first/initial page? When you pop the new page, we can increment the counter.
@@ -32,7 +32,7 @@ public MainPage() | |||
|
|||
popOnAppearing.Appearing += async (sender, args) => | |||
{ | |||
await Task.Yield(); | |||
await Task.Delay(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if this is because of animations, then we will have to document that you can't pop in Appearing while pushing.
@devanathan-vaithiyanathan if the Windows test is going to take some time, maybe just move the Android fix into a new PR and we can approve faster and then this PR can become a long discussion on the Appearings. |
The android fix has been added in the PR and it has been merged. |
Agreed, the original test is a little interesting because it always had the yield it seems so it was never really testing doing the operation from "Appearing" correctly But we really shouldn't modify the hostapp to make a test pass in this way |
@PureWeen When using Task.Yield, the page does not pop properly during the appearing event, and a blank screen appears. We have logged a separate issue report for this. Shall we proceed by moving this test case with Task.Delay as a temporary fix, or should we close this PR and move the test case once the reported issue is resolved? |
Yea, I don't think adding |
Description of Change
After merging the net9 branch into main, two UI tests were failing:
1. Android Test: ImageDoesntDisappearWhenNavigatingBack
2. Windows Test: Issue31366PushingWithModalStackCausesIncorrectStackOrder
Issues Fixed
Fixes #24243
Output Screenshot
Android:

Windows
