-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mike Corsaro
committed
Dec 10, 2024
1 parent
d6e64c3
commit 79248e9
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
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,36 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 26466, "Button is not released on unload", PlatformAffected.WinRT)] | ||
public partial class Issue26466 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var button = new Button() | ||
{ | ||
Text = "Hello", | ||
AutomationId = "thebutton" | ||
}; | ||
|
||
var success = new Label | ||
{ | ||
Text = "If you see this, the test has passed", | ||
AutomationId = "success" | ||
}; | ||
|
||
var layout = new Microsoft.Maui.Controls.StackLayout(); | ||
layout.Children.Add(button); | ||
|
||
button.Pressed += (s, e) => | ||
{ | ||
layout.Children.Remove(button); | ||
}; | ||
|
||
button.Released += (s, e) => | ||
{ | ||
layout.Children.Add(success); | ||
}; | ||
|
||
Content = layout; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26466.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,33 @@ | ||
#if WINDOWS | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue26466 : _IssuesUITest | ||
{ | ||
const string ButtonId = "thebutton"; | ||
const string SuccessId = "success"; | ||
|
||
public Issue26466(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "Button is not released on unload"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Button)] | ||
public async Task SwitchColorTest() | ||
{ | ||
App.WaitForElement(ButtonId); | ||
App.ClickPress(ButtonId); | ||
|
||
await Task.Delay(200); | ||
|
||
// Button should be unloaded, so we should see the success label | ||
App.WaitForElement(SuccessId); | ||
} | ||
} | ||
} | ||
#endif |
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