-
Notifications
You must be signed in to change notification settings - Fork 2k
Reset opacity when view is being reused #22820
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19955.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| using System.Drawing; | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
| using OpenQA.Selenium.Interactions; | ||
| using NUnit.Framework.Legacy; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
| public class Issue19955: _IssuesUITest | ||
| { | ||
| public Issue19955(TestDevice device) : base(device) { } | ||
|
|
||
| public override string Issue => "Navigating Back to FlyoutPage Renders Blank Page"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.FlyoutPage)] | ||
| public void NavigatingBackToFlyoutPageRendersBlankPage() | ||
| { | ||
| App.WaitForElement("NavigateToSecondPageButton"); | ||
| App.Tap("NavigateToSecondPageButton"); | ||
| App.WaitForElement("NavigateBackToFirstPageButton"); | ||
| App.Tap("NavigateBackToFirstPageButton"); | ||
| App.WaitForElement("NavigateToSecondPageButton"); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| using System; | ||
| using System.Diagnostics; | ||
| using Microsoft.Maui.Controls; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [Issue(IssueTracker.Github, 19955, "Navigating Back to FlyoutPage Renders Blank Page")] | ||
| public class Issue19955 : NavigationPage | ||
| { | ||
| public Issue19955() : base(new MainFlyout()) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public partial class MainFlyout : FlyoutPage | ||
| { | ||
| public MainFlyout() | ||
| { | ||
| Flyout = new MainFlyoutMenu(); | ||
| Detail = new MarkerNavigationPage(); | ||
| } | ||
|
|
||
| class MarkerNavigationPage : NavigationPage | ||
| { | ||
| public MarkerNavigationPage() : base(new FirstPage()) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| class MarkerNavigationPage2 : NavigationPage | ||
| { | ||
| public MarkerNavigationPage2() : base(new FirstPage()) | ||
| { | ||
| } | ||
| } | ||
| } | ||
|
|
||
| public partial class MainFlyoutMenu : ContentPage | ||
| { | ||
| public MainFlyoutMenu() | ||
| { | ||
| Title = "MainFlyoutMenu"; | ||
| Content = new VerticalStackLayout(){ | ||
| new Label() | ||
| { | ||
| Text = "I'm the Flyout Page" | ||
| } | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| public partial class FirstPage : ContentPage | ||
| { | ||
| public FirstPage() | ||
| { | ||
| Content = new VerticalStackLayout(){ | ||
| new Button(){ | ||
| Text = "Navigate to Second page", | ||
| Command = new Command(Button_Clicked), | ||
| AutomationId = "NavigateToSecondPageButton" | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| async void Button_Clicked() | ||
| { | ||
| await Application.Current.MainPage.Navigation.PushAsync(new SecondPage()); | ||
| } | ||
| } | ||
|
|
||
| public partial class SecondPage : ContentPage | ||
| { | ||
| public SecondPage() | ||
| { | ||
| Content = new VerticalStackLayout() | ||
| { | ||
| new Button(){ | ||
| Text = "Navigate back to first page", | ||
| Command = new Command(Button_Clicked), | ||
| AutomationId = "NavigateBackToFirstPageButton" | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| async void Button_Clicked() | ||
| { | ||
| await Application.Current.MainPage.Navigation.PopAsync(); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How does
WaitForElementtest for visibility?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.
It looks like if the opacity is zero then appium can't find it.
I was curious about this as well :-)
If I remove my fix, the test fails, if I put the fix back, the test passes.
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.
If the element is not visible on the screen, appium can't find it. So, it's valid. Just could be nice to include a comment here.