Skip to content

Commit fc83835

Browse files
NafeelaNazhirrmarinho
authored andcommitted
[Testing] Enabling more UI Tests by removing platform specific condition - 18 (#28033)
* Enabled CollectionViewUITests * Updated Issue Link * Addressed Feedbacks * Updated changes * Added images * Revert Changes * Changes updated * updated changes * Changes updated * Changes updated * Reverted Issue18896 * Changes updated * Reverted issue1583_1 * Reverted Issue18896
1 parent 88825e2 commit fc83835

File tree

12 files changed

+17
-16
lines changed

12 files changed

+17
-16
lines changed
76.9 KB
Loading

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33

44
[Issue(IssueTracker.Github, 11962, "[iOS] Cannot access a disposed object. Object name: 'WkWebViewRenderer",
5-
PlatformAffected.iOS)]
5+
PlatformAffected.iOS, isInternetRequired: true)]
66
public class Issue11962 : TestShell
77
{
88
protected override void Init()

src/Controls/tests/TestCases.HostApp/Issues/Issue14825.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
x:DataType="local:Issue14825">
77

88
<VerticalStackLayout>
9-
<Label Text="WebView"/>
10-
<WebView x:Name="myWebView" WidthRequest="400" HeightRequest="150">
9+
<Label Text="WebView" AutomationId="TestLabel"/>
10+
<WebView x:Name="myWebView" WidthRequest="400" HeightRequest="150" HorizontalOptions="Start">
1111
<WebView.Source>
1212
<HtmlWebViewSource>
1313
<HtmlWebViewSource.Html>

src/Controls/tests/TestCases.HostApp/Issues/Issue14825.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private async void CaptureButton_Clicked(object sender, EventArgs e)
1919
Stream stream = await result.OpenReadAsync(ScreenshotFormat.Png, 100);
2020

2121
screenshotResult.Add(new Label() { Text = $"Your screenshot ({myWebView.Width}x{myWebView.Height}):" });
22-
screenshotResult.Add(new Image() { Source = ImageSource.FromStream(() => stream), WidthRequest = myWebView.Width, HeightRequest = myWebView.Height });
22+
screenshotResult.Add(new Image() { Source = ImageSource.FromStream(() => stream), WidthRequest = myWebView.Width, HeightRequest = myWebView.Height, HorizontalOptions = LayoutOptions.Start });
2323
}
2424
}
2525
}
34.2 KB
Loading

src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.EmptyView.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
#if TEST_FAILS_ON_WINDOWS // EmptyView Elements not accessible via Automation on Windows, Issue Link: https://github.com/dotnet/maui/issues/28022
12
using NUnit.Framework;
23
using UITest.Appium;
34
using UITest.Core;
45

56
namespace Microsoft.Maui.TestCases.Tests
67
{
7-
#if IOS
8+
89
public class CollectionViewEmptyViewTests : CollectionViewUITests
910
{
1011
protected override bool ResetAfterEachTest => true;
@@ -38,5 +39,6 @@ public void EmptyViewItemsSourceNullViewWorks()
3839
App.WaitForElement("Nothing to display.");
3940
}
4041
}
41-
#endif
42-
}
42+
43+
}
44+
#endif

src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.Grouping.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
#if IOS
7+
88
public class CollectionViewGroupingTests : CollectionViewUITests
99
{
1010
protected override bool ResetAfterEachTest => true;
@@ -30,5 +30,5 @@ public void GroupingAndHeaderWorks()
3030
App.WaitForElement("Total members: 12");
3131
}
3232
}
33-
#endif
33+
3434
}

src/Controls/tests/TestCases.Shared.Tests/Tests/CollectionView/CollectionViewUITests.MultipleBoundSelection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // Multiselection not working in Catalyst and iOS, Issue: https://github.com/dotnet/maui/issues/26942 & https://github.com/dotnet/maui/issues/26943
1+
#if TEST_FAILS_ON_CATALYST // Multiselection not working in Catalyst , Issue: https://github.com/dotnet/maui/issues/26942
22
using NUnit.Framework;
33
using UITest.Appium;
44
using UITest.Core;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public Issue11962(TestDevice testDevice) : base(testDevice)
1717
[Category(UITestCategories.Compatibility)]
1818
public void WebViewDisposesProperly()
1919
{
20+
VerifyInternetConnectivity();
2021
App.WaitForElement("NextButton");
2122
App.Tap("NextButton");
2223
App.WaitForElement("BackButton");

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if WINDOWS
2-
using NUnit.Framework;
1+
using NUnit.Framework;
32
using UITest.Appium;
43
using UITest.Core;
54

@@ -18,11 +17,10 @@ public Issue14825(TestDevice device) : base(device)
1817
public void ValidateWebViewScreenshot()
1918
{
2019
App.WaitForElement("TestInstructions");
21-
20+
Thread.Sleep(2000); // Wait for the WebView to load
2221
// Click the capture button to capture a WebView screenshot.
2322
App.Click("Capture");
24-
23+
App.WaitForElement("TestInstructions", timeout: TimeSpan.FromSeconds(2));
2524
VerifyScreenshot();
2625
}
27-
}
28-
#endif
26+
}

0 commit comments

Comments
 (0)