Skip to content

Commit 4b51243

Browse files
authoredJan 11, 2025··
[Testing] Resolved bunch of Android UI Test random failures in CI. (#27066)
* Resolved android bunch test failure cases in CI * Addressed review concerns
1 parent 844b6c7 commit 4b51243

15 files changed

+29
-39
lines changed
 

‎src/Controls/tests/TestCases.Shared.Tests/Tests/BorderUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
public class BorderUITests : UITest
7+
public class BorderUITests : CoreGalleryBasePageTest
88
{
99
const string BorderGallery = "Border Gallery";
1010

@@ -13,9 +13,8 @@ public BorderUITests(TestDevice device)
1313
{
1414
}
1515

16-
protected override void FixtureSetup()
16+
protected override void NavigateToGallery()
1717
{
18-
base.FixtureSetup();
1918
App.NavigateToGallery(BorderGallery);
2019
}
2120

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
public abstract class CollectionViewUITests : UITest
7+
public abstract class CollectionViewUITests : CoreGalleryBasePageTest
88
{
99
const string CollectionViewGallery = "CollectionView Gallery";
1010

@@ -13,9 +13,8 @@ public CollectionViewUITests(TestDevice device)
1313
{
1414
}
1515

16-
protected override void FixtureSetup()
16+
protected override void NavigateToGallery()
1717
{
18-
base.FixtureSetup();
1918
App.NavigateToGallery(CollectionViewGallery);
2019
}
2120

‎src/Controls/tests/TestCases.Shared.Tests/Tests/CoreGalleryBasePageTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using NUnit.Framework;
2+
using UITest.Appium;
23
using UITest.Core;
34

45
namespace Microsoft.Maui.TestCases.Tests
@@ -23,6 +24,7 @@ protected override void FixtureSetup()
2324
TestContext.Error.WriteLine($">>>>> {DateTime.Now} The FixtureSetup threw an exception. Attempt {retries}/{SetupMaxRetries}.{Environment.NewLine}Exception details: {e}");
2425
if (retries++ < SetupMaxRetries)
2526
{
27+
App.Back();
2628
Reset();
2729
}
2830
else

‎src/Controls/tests/TestCases.Shared.Tests/Tests/DragAndDropUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66

77
namespace Microsoft.Maui.TestCases.Tests
88
{
9-
public class DragAndDropUITests : UITest
9+
public class DragAndDropUITests : CoreGalleryBasePageTest
1010
{
1111
const string DragAndDropGallery = "Drag and Drop Gallery";
1212
public DragAndDropUITests(TestDevice device)
1313
: base(device)
1414
{
1515
}
1616

17-
protected override void FixtureSetup()
17+
protected override void NavigateToGallery()
1818
{
19-
base.FixtureSetup();
2019
App.NavigateToGallery(DragAndDropGallery);
2120
}
2221

‎src/Controls/tests/TestCases.Shared.Tests/Tests/GestureRecognizerUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55

66
namespace Microsoft.Maui.TestCases.Tests
77
{
8-
public class GestureRecognizerUITests : UITest
8+
public class GestureRecognizerUITests : CoreGalleryBasePageTest
99
{
1010
const string GestureRecognizerGallery = "Gesture Recognizer Gallery";
1111
public GestureRecognizerUITests(TestDevice device)
1212
: base(device)
1313
{
1414
}
1515

16-
protected override void FixtureSetup()
16+
protected override void NavigateToGallery()
1717
{
18-
base.FixtureSetup();
1918
App.NavigateToGallery(GestureRecognizerGallery);
2019
}
2120

‎src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ protected override void FixtureSetup()
3535
TestContext.Error.WriteLine($">>>>> {DateTime.Now} The FixtureSetup threw an exception. Attempt {retries}/{SetupMaxRetries}.{Environment.NewLine}Exception details: {e}");
3636
if (retries++ < SetupMaxRetries)
3737
{
38+
App.Back();
3839
Reset();
3940
}
4041
else

‎src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrollingGridTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
public class KeyboardScrollingGridTests : UITest
7+
public class KeyboardScrollingGridTests : CoreGalleryBasePageTest
88
{
99
const string KeyboardScrollingGallery = "Keyboard Scrolling Gallery - Grid with Star Row";
1010

@@ -13,9 +13,8 @@ public KeyboardScrollingGridTests(TestDevice device)
1313
{
1414
}
1515

16-
protected override void FixtureSetup()
16+
protected override void NavigateToGallery()
1717
{
18-
base.FixtureSetup();
1918
App.NavigateToGallery(KeyboardScrollingGallery);
2019
}
2120

‎src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrollingNonScrollingPageLargeTitlesTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
namespace Microsoft.Maui.TestCases.Tests
66
{
77
[Category(UITestCategories.Layout)]
8-
public class KeyboardScrollingNonScrollingPageLargeTitlesTests : UITest
8+
public class KeyboardScrollingNonScrollingPageLargeTitlesTests : CoreGalleryBasePageTest
99
{
1010
const string KeyboardScrollingGallery = "Keyboard Scrolling Gallery - NonScrolling Page / Large Titles";
1111
public KeyboardScrollingNonScrollingPageLargeTitlesTests(TestDevice device)
1212
: base(device)
1313
{
1414
}
1515

16-
protected override void FixtureSetup()
16+
protected override void NavigateToGallery()
1717
{
18-
base.FixtureSetup();
1918
App.NavigateToGallery(KeyboardScrollingGallery);
2019
}
2120

‎src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrollingNonScrollingPageSmallTitlesTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
public class KeyboardScrollingNonScrollingPageSmallTitlesTests : UITest
7+
public class KeyboardScrollingNonScrollingPageSmallTitlesTests : CoreGalleryBasePageTest
88
{
99
const string KeyboardScrollingGallery = "Keyboard Scrolling Gallery - NonScrolling Page / Small Titles";
1010
public KeyboardScrollingNonScrollingPageSmallTitlesTests(TestDevice device)
1111
: base(device)
1212
{
1313
}
1414

15-
protected override void FixtureSetup()
15+
protected override void NavigateToGallery()
1616
{
17-
base.FixtureSetup();
1817
App.NavigateToGallery(KeyboardScrollingGallery);
1918
}
2019

‎src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrollingScrollingPageLargeTitlesTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
public class KeyboardScrollingScrollingPageLargeTitlesTests : UITest
7+
public class KeyboardScrollingScrollingPageLargeTitlesTests : CoreGalleryBasePageTest
88
{
99
const string KeyboardScrollingGallery = "Keyboard Scrolling Gallery - Scrolling Page / Large Titles";
1010
public KeyboardScrollingScrollingPageLargeTitlesTests(TestDevice device)
1111
: base(device)
1212
{
1313
}
1414

15-
protected override void FixtureSetup()
15+
protected override void NavigateToGallery()
1616
{
17-
base.FixtureSetup();
1817
App.NavigateToGallery(KeyboardScrollingGallery);
1918
}
2019

‎src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrollingScrollingPageSmallTitlesTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44

55
namespace Microsoft.Maui.TestCases.Tests
66
{
7-
public class KeyboardScrollingScrollingPageSmallTitlesTests : UITest
7+
public class KeyboardScrollingScrollingPageSmallTitlesTests : CoreGalleryBasePageTest
88
{
99
const string KeyboardScrollingGallery = "Keyboard Scrolling Gallery - Scrolling Page / Small Titles";
1010
public KeyboardScrollingScrollingPageSmallTitlesTests(TestDevice device)
1111
: base(device)
1212
{
1313
}
1414

15-
protected override void FixtureSetup()
15+
protected override void NavigateToGallery()
1616
{
17-
base.FixtureSetup();
1817
App.NavigateToGallery(KeyboardScrollingGallery);
1918
}
2019

‎src/Controls/tests/TestCases.Shared.Tests/Tests/ScrollViewUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Microsoft.Maui.TestCases.Tests
66
{
77
[Category(UITestCategories.ScrollView)]
8-
public class ScrollToUITests : UITest
8+
public class ScrollToUITests : CoreGalleryBasePageTest
99
{
1010
const string LayoutGallery = "ScrollView Gallery";
1111

@@ -14,9 +14,8 @@ public ScrollToUITests(TestDevice device)
1414
{
1515
}
1616

17-
protected override void FixtureSetup()
17+
protected override void NavigateToGallery()
1818
{
19-
base.FixtureSetup();
2019
App.NavigateToGallery(LayoutGallery);
2120
}
2221

‎src/Controls/tests/TestCases.Shared.Tests/Tests/SliderUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Microsoft.Maui.TestCases.Tests
77
{
8-
public class SliderUITests : UITest
8+
public class SliderUITests : CoreGalleryBasePageTest
99
{
1010
public const string SliderGallery = "Slider Gallery";
1111

@@ -14,9 +14,8 @@ public SliderUITests(TestDevice device)
1414
{
1515
}
1616

17-
protected override void FixtureSetup()
17+
protected override void NavigateToGallery()
1818
{
19-
base.FixtureSetup();
2019
App.NavigateToGallery(SliderGallery);
2120
}
2221

‎src/Controls/tests/TestCases.Shared.Tests/Tests/StepperUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Microsoft.Maui.TestCases.Tests
88
{
99
[Category(UITestCategories.Stepper)]
10-
public class StepperUITests : UITest
10+
public class StepperUITests : CoreGalleryBasePageTest
1111
{
1212
public const string StepperGallery = "Stepper Gallery";
1313

@@ -16,9 +16,8 @@ public StepperUITests(TestDevice device)
1616
{
1717
}
1818

19-
protected override void FixtureSetup()
19+
protected override void NavigateToGallery()
2020
{
21-
base.FixtureSetup();
2221
App.NavigateToGallery(StepperGallery);
2322
}
2423

‎src/Controls/tests/TestCases.Shared.Tests/Tests/SwipeViewUITests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.Maui.TestCases.Tests
88
{
9-
public class SwipeViewUITests : UITest
9+
public class SwipeViewUITests : CoreGalleryBasePageTest
1010
{
1111
const string ScrollViewGallery = "SwipeView Gallery";
1212

@@ -20,9 +20,8 @@ public SwipeViewUITests(TestDevice device)
2020
{
2121
}
2222

23-
protected override void FixtureSetup()
23+
protected override void NavigateToGallery()
2424
{
25-
base.FixtureSetup();
2625
App.NavigateToGallery(ScrollViewGallery);
2726
}
2827

0 commit comments

Comments
 (0)
Please sign in to comment.