Skip to content

Commit c8c2bed

Browse files
Test case modified
1 parent 013f30e commit c8c2bed

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/Controls/tests/TestCases.HostApp/Issues/Issue33706.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class Issue33706 : ContentPage
77
{
88
private readonly ActivityIndicator _activityIndicator;
99
private readonly Label _statusLabel;
10+
private readonly Label _resumedLabel;
1011

1112
public Issue33706()
1213
{
@@ -31,6 +32,12 @@ public Issue33706()
3132
HorizontalOptions = LayoutOptions.Center
3233
};
3334

35+
_resumedLabel = new Label
36+
{
37+
Text = "",
38+
AutomationId = "ResumedLabel"
39+
};
40+
3441
Content = new VerticalStackLayout
3542
{
3643
Padding = 20,
@@ -45,9 +52,14 @@ public Issue33706()
4552
},
4653
pickButton,
4754
_activityIndicator,
48-
_statusLabel
55+
_statusLabel,
56+
_resumedLabel
4957
}
5058
};
59+
this.Loaded += (s, e) =>
60+
{
61+
this.Window.Resumed += (s, e) => _resumedLabel.Text = "Resumed";
62+
};
5163
}
5264

5365
private async void OnPickMediaClicked(object sender, EventArgs e)

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33706.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ public void Issue33706Test()
2121
var initialStatus = App.FindElement("StatusLabel").GetText();
2222
Assert.That(initialStatus, Is.EqualTo("Ready"), "Initial status should be 'Ready'");
2323
App.Tap("PickMediaButton");
24-
Task.Delay(500).Wait();
2524
App.BackgroundApp();
26-
// Wait for app to background and resume
27-
Task.Delay(500).Wait();
2825
App.ForegroundApp();
26+
App.WaitForElement("ResumedLabel");
2927
App.WaitForElement("StatusLabel");
3028
App.WaitForElement("PickMediaButton");
3129
var finalStatus = App.FindElement("StatusLabel").GetText();
@@ -34,4 +32,4 @@ public void Issue33706Test()
3432
}
3533
}
3634
}
37-
#endif
35+
#endif

0 commit comments

Comments
 (0)