Skip to content

[Testing] Enabling CV related UITests in Appium #27012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ public class CollectionViewTabbedPageUITests : _IssuesUITest
const string Add1 = "Add1";
const string Add2 = "Add2";
const string Success = "Success";
#if ANDROID
const string FirstPage = "7700 FIRST PAGE";
const string Tab2 = "TAB2";
const string Tab3 = "TAB3";
#else
const string FirstPage = "7700 First Page";
const string Tab2 = "Tab2";
const string Tab3 = "Tab3";
#endif
protected override bool ResetAfterEachTest => true;

public CollectionViewTabbedPageUITests(TestDevice device)
Expand All @@ -32,19 +25,17 @@ public void AddingItemToUnviewedCollectionViewShouldNotCrash()
{
App.WaitForElement(Add1);
App.Tap(Add1);
App.WaitForElement(Tab2);
App.Tap(Tab2);
App.TapTab(Tab2);
App.WaitForElementTillPageNavigationSettled(Success);
}

[Test]
[Category(UITestCategories.CollectionView)]
public void AddingGroupToUnviewedGroupedCollectionViewShouldNotCrash()
public void AddingGroupToUnviewedGroupedCollectionViewShouldNotCrash()
{
App.WaitForElement(Add2);
App.Tap(Add2);
App.WaitForElement(Tab3);
App.Tap(Tab3);
App.TapTab(Tab3);
App.WaitForElementTillPageNavigationSettled(Success);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ public EmptyViewNoCrashUITests(TestDevice device)
// EmptyViewShouldNotCrash (src\Compatibility\ControlGallery\src\Issues.Shared\Issue9196.xaml.cs)
[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnIOSWhenRunningOnXamarinUITest("This test is failing, likely due to product issue")]
[FailsOnMacWhenRunningOnXamarinUITest("This test is failing, likely due to product issue")]
[FailsOnWindowsWhenRunningOnXamarinUITest("This test is failing, likely due to product issue")]
public void EmptyViewShouldNotCrash()
{
App.WaitForNoElement("Success");
App.WaitForElement("Success");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ public Issue10454(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void ChildAddedShouldFire()
{
App.WaitForNoElement(Success);
App.WaitForElement(Success);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if TEST_FAILS_ON_WINDOWS // EmptyView is not accessible through the test framework on Windows.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -14,16 +15,17 @@ public Issue12374(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Issue12374Test()
{
App.WaitForElement("TestReady");
App.WaitForElement("RemoveItems");
App.Tap("RemoveItems");
App.WaitForElement("AddItems");
App.Tap("AddItems");
App.WaitForElement("RemoveItems");
App.Tap("RemoveItems");
App.Screenshot("CollectionViewWithEmptyView");
App.WaitForElement("Empty View");
}
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ public Issue12714(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]

public void InitiallyInvisbleCollectionViewSurvivesiOSLayoutNonsense()
{
App.WaitForElement(Show);
App.Tap(Show);
App.WaitForNoElement(Success);
App.WaitForElement(Success);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ public Issue13126_2(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void CollectionViewShouldSourceShouldResetWhileInvisible()
{
App.WaitForNoElement(Success);
App.WaitForElement(Success);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -18,12 +17,10 @@ public Issue18702(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
public void CollectionViewGroupFooterTemplateShouldNotCrash()
{
App.WaitForElement(element);
VerifyScreenshot();
}
}
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public Issue18751(TestDevice device) : base(device)
[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnAndroidWhenRunningOnXamarinUITest("Currently fails on Android; see https://github.com/dotnet/maui/issues/15994")]
[FailsOnIOSWhenRunningOnXamarinUITest("This test is failing on iOS17, https://github.com/dotnet/maui/issues/20582")]
[FailsOnMacWhenRunningOnXamarinUITest("This test is failing on Catalyst, https://github.com/dotnet/maui/issues/20582")]
[FailsOnWindowsWhenRunningOnXamarinUITest("Currently fails on Windows; see https://github.com/dotnet/maui/issues/15994")]
public async Task Issue18751Test()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ public Issue2777(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Issue2777Test()
{
App.Screenshot("I am at Issue 2965");
App.WaitForNoElement("The letter A");
App.WaitForElement("The letter A");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if IOS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -15,14 +14,11 @@ public Issue4600(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
public void InitiallyEmptySourceDisplaysAddedItem()
{
App.WaitForNoElement("Insert");
App.WaitForElement("Insert");
App.Tap("btnInsert");
App.WaitForNoElement("Inserted");
App.WaitForElement("Inserted");
}
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if TEST_FAILS_ON_WINDOWS // EmptyView is not able to access via test framework.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -14,23 +15,20 @@ public Issue5535(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
[FailsOnWindowsWhenRunningOnXamarinUITest]
public void SwappingEmptyViews()
{
App.WaitForElement("FilterItems");
App.Tap("FilterItems");
App.EnterText("FilterItems", "abcdef");

// Default empty view
App.WaitForNoElement("Nothing to see here.");
App.WaitForElement("Nothing to see here.");

App.Tap("ToggleEmptyView");

// Other empty view
App.WaitForNoElement("No results matched your filter.");
App.WaitForElement("No results matched your filter.");
}
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if TEST_FAILS_ON_WINDOWS // StackLayout AutomationId and EmptyView are not accessible through appium.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -23,34 +24,25 @@ public Issue6932(TestDevice testDevice) : base(testDevice)
[FailsOnWindowsWhenRunningOnXamarinUITest]
public void EmptyViewBecomesVisibleWhenItemsSourceIsCleared()
{
App.Screenshot("Screen opens, items are shown");

App.WaitForElement(LayoutAutomationId);
App.WaitForElement(ClearAutomationId);
App.Tap(ClearAutomationId);
App.WaitForElement(EmptyViewAutomationId);

App.Screenshot("Empty view is visible");
}

[Test]
[Category(UITestCategories.CollectionView)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
[FailsOnWindowsWhenRunningOnXamarinUITest]
public void EmptyViewHidesWhenItemsSourceIsFilled()
{
App.Screenshot("Screen opens, items are shown");

App.WaitForElement(LayoutAutomationId);
App.WaitForElement(ClearAutomationId);
App.Tap(ClearAutomationId);
App.WaitForElement(EmptyViewAutomationId);

App.Screenshot("Items are cleared, empty view visible");

App.WaitForElement(AddAutomationId);
App.Tap(AddAutomationId);
App.WaitForNoElement(EmptyViewAutomationId);

App.Screenshot("Item is added, empty view is not visible");
}
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if TEST_FAILS_ON_ANDROID // Sample level issue, btnInsert is not visible on Android
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -14,22 +15,21 @@ public Issue7102(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest]
public void HeaderDoesNotBreakIndexes()
{
App.WaitForElement("entryInsert");
App.Tap("entryInsert");
App.ClearText("entryInsert");
App.EnterText("entryInsert", "1");
App.WaitForElement("btnInsert");
App.Tap("btnInsert");

// If the bug is still present, then there will be
// two "Item: 0" items instead of the newly inserted item
// Or the header will have disappeared
App.WaitForNoElement("Inserted");
App.WaitForNoElement("This is the header");
App.WaitForElement("Inserted");
App.WaitForElement("This is the header");
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms Android and iOS.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -17,8 +18,6 @@ public Issue8870(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
[FailsOnMacWhenRunningOnXamarinUITest("SetOrientationPortrait method not implemented")]
[FailsOnWindowsWhenRunningOnXamarinUITest("SetOrientationPortrait method not implemented")]
public async Task RotatingCollectionViewWithHTMLShouldNotHangOrCrash()
Expand All @@ -45,7 +44,8 @@ public async Task RotatingCollectionViewWithHTMLShouldNotHangOrCrash()
App.WaitForElement(CheckResult);
App.Tap(CheckResult);

App.WaitForNoElement(Success);
App.WaitForElement(Success);
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if IOS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -18,14 +17,11 @@ public Issue8899(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.CollectionView)]
[Category(UITestCategories.Compatibility)]
[FailsOnIOSWhenRunningOnXamarinUITest]
public void ClearingGroupedCollectionViewShouldNotCrash()
{
App.WaitForElement(Go);
App.Tap(Go);
App.WaitForElement(Success);
}
}
}
#endif
}
Loading
Loading