forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix display of ActionSheet in modal view on Windows (dotnet#21295)
* Fix display of ActionSheet in modal view on Windows * Add ui test to validate DisplayActionSheet behaviro in modal dialog * Give ActionSheet title an AutomationId to improve testing * Replace baseline with image from ci/cd * Undo change to app.xaml * Update AlertManager.Windows.cs
- Loading branch information
Showing
5 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/Controls/samples/Controls.Sample.UITests/Issues/Issue14829.cs
This file contains 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,44 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Graphics; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 14829, "DisplayActionSheet still not working on Windows", PlatformAffected.UWP)] | ||
public class Issue14829 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var navPage = new NavigationPage(new MainPage()); | ||
NavigatedTo += Issue14829_NavigatedTo; | ||
|
||
async void Issue14829_NavigatedTo(object sender, NavigatedToEventArgs e) | ||
{ | ||
NavigatedTo -= Issue14829_NavigatedTo; | ||
|
||
await Navigation.PushModalAsync(navPage); | ||
} | ||
} | ||
|
||
public partial class MainPage : ContentPage | ||
{ | ||
protected override void OnAppearing() | ||
{ | ||
Content = new VerticalStackLayout() | ||
{ | ||
new Button() | ||
{ | ||
AutomationId = "DisplayActionSheetButton", | ||
Command = new Command(async () => | ||
{ | ||
await DisplayActionSheet("ActionSheet: Send to?", "Cancel", null, "Email", "Twitter", "Facebook"); | ||
}), | ||
Text = "Click to Display Action Sheet" | ||
} | ||
}; | ||
Content.BackgroundColor = Colors.White; | ||
|
||
base.OnAppearing(); | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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,27 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue14829 : _IssuesUITest | ||
{ | ||
public Issue14829(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "DisplayActionSheet still not working on Windows"; | ||
|
||
[Test] | ||
[Category(UITestCategories.ActionSheet)] | ||
public void Issue14829Test() | ||
{ | ||
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.iOS }, "Only affects Windows."); | ||
|
||
App.WaitForElement("DisplayActionSheetButton", timeout: TimeSpan.FromSeconds(4)).Click(); | ||
App.WaitForElement("ActionSheetTitle", timeout: TimeSpan.FromSeconds(4)); | ||
|
||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.