Skip to content

Commit 1bc4bcb

Browse files
committed
fix windows tests
1 parent 45092cf commit 1bc4bcb

File tree

1 file changed

+14
-10
lines changed
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues

1 file changed

+14
-10
lines changed

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Issue30690 : _IssuesUITest
1414
private const string ToggleIsRefreshEnabledButton = "ToggleIsRefreshEnabled";
1515
private const string Element = "StartRefresh";
1616
private const string StatusLabel = "StatusLabel";
17-
private const string TestRefreshView = "TestRefreshView";
17+
private const string ScrollViewContent = "ScrollViewContent";
1818

1919
public Issue30690(TestDevice device) : base(device)
2020
{
@@ -106,19 +106,23 @@ public void IsEnabledDisablesEntireViewAndPreventsChildInteraction()
106106
catch (InvalidElementStateException) // Expected as the entry should not be interactable
107107
{
108108
}
109+
#if WINDOWS
110+
Assert.That(App.FindElement(TestEntry).GetText(), Is.EqualTo(""));
111+
#else
109112
Assert.That(App.FindElement(TestEntry).GetText(), Is.EqualTo("Type here to test child interaction"));
113+
#endif
110114
}
111115

112-
#if TEST_FAILS_ON_CATALYST // Overscroll gesture is not working
116+
//#if TEST_FAILS_ON_CATALYST // Overscroll gesture is not working
113117
[Test]
114118
public void PullToRefreshWorksWhenEnabled()
115119
{
116120
// Find the scroll view content to perform pull gesture on
117-
App.WaitForElement(TestRefreshView);
121+
App.WaitForElement(ScrollViewContent);
118122

119123
// Perform pull-to-refresh
120124
PullToRefresh();
121-
Assert.That(GetStatusText(), Contains.Substring("Refreshing..."));
125+
App.WaitForTextToBePresentInElement(StatusLabel, "Refreshing...", timeout: TimeSpan.FromSeconds(5));
122126

123127
// Wait for refresh to complete and verify it worked
124128
App.WaitForTextToBePresentInElement(StatusLabel, "Refresh completed", timeout: TimeSpan.FromSeconds(5));
@@ -134,8 +138,8 @@ public void PullToRefreshBlockedWhenIsRefreshEnabledFalse()
134138
// Perform pull-to-refresh
135139
PullToRefresh();
136140

137-
// Wait for refresh to complete and verify it worked
138-
App.WaitForTextToBePresentInElement(StatusLabel, "IsRefreshEnabled: False", timeout: TimeSpan.FromSeconds(5));
141+
// Wait for refresh to complete and verify it failed
142+
Assert.That(GetStatusText(), Contains.Substring("IsRefreshEnabled: False"));
139143
}
140144

141145
[Test]
@@ -148,14 +152,14 @@ public void PullToRefreshBlockedWhenIsEnabledFalse()
148152
// Perform pull-to-refresh
149153
PullToRefresh();
150154

151-
// Wait for refresh to complete and verify it worked
152-
App.WaitForTextToBePresentInElement(StatusLabel, "IsEnabled: False", timeout: TimeSpan.FromSeconds(5));
155+
// Wait for refresh to complete and verify it failed
156+
Assert.That(GetStatusText(), Contains.Substring("IsEnabled: False"));
153157
}
154-
#endif
158+
//#endif
155159

156160
string GetStatusText() =>
157161
App.FindElement(StatusLabel).GetText() ?? "";
158162

159163
void PullToRefresh() =>
160-
App.ScrollUp(TestRefreshView);
164+
App.ScrollUp(ScrollViewContent);
161165
}

0 commit comments

Comments
 (0)