Skip to content

Commit d1acef5

Browse files
[Testing] Enabling ported UITests from Xamarin.UITests to Appium - 49 (#26609)
* Enabled 49th set of UITests migrated from XamarinUITest into Appium (#48) * Migrated Issues from XamarinUIest into Appium * Updated ShellInsets tests * Modified the enabled tests * Updated comments * Changed Test cases order * Modified Issue ShellInsets * Revert the changes --------- Co-authored-by: NafeelaNazhir <nafeela.nazhirhussain@syncfusion.com> * Updated the comments * Enabled 49th set of UITests migrated from XamarinUITest into Appium (#48) * Migrated Issues from XamarinUIest into Appium * Updated ShellInsets tests * Modified the enabled tests * Updated comments * Changed Test cases order * Modified Issue ShellInsets * Revert the changes --------- Co-authored-by: NafeelaNazhir <nafeela.nazhirhussain@syncfusion.com> * Updated the comments * Ignore CI fails test for catalyst --------- Co-authored-by: NafeelaNazhir <nafeela.nazhirhussain@syncfusion.com>
1 parent c002ecb commit d1acef5

File tree

7 files changed

+178
-138
lines changed

7 files changed

+178
-138
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla31602.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class SidemenuPage : ContentPage
2222
public SidemenuPage()
2323
{
2424
Title = "Side";
25-
IconImageSource = "menuIcon.png";
25+
IconImageSource = "menu_icon.png";
2626
var lbl = new Label { Text = "SideMenu", AutomationId = "SideMenu" };
2727
var btn = new Button { Text = "Menu Opener" };
2828

src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla32902.cs

+8-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ namespace Maui.Controls.Sample.Issues;
22

33

44
[Issue(IssueTracker.Bugzilla, 32902, "[iOS | iPad] App Crashes (without debug log) when Flyout Detail isPresented and navigation being popped")]
5-
public class Bugzilla32902 : TestContentPage
5+
public class Bugzilla32902 : TestNavigationPage
66
{
77
ContentPage FirstContentPage { get; set; }
88

99
FlyoutPage HomePage { get; set; }
1010

1111
NavigationPage DetailPage { get; set; }
1212

13-
ContentPage RootPage { get; set; }
13+
ContentPage NewRootPage { get; set; }
1414

1515
protected override void Init()
1616
{
@@ -28,13 +28,13 @@ protected override void Init()
2828
};
2929

3030
rootContentPageLayout.Children.Add(rootContentPageButton);
31-
Content = rootContentPageLayout;
31+
3232

3333
Title = "RootPage";
3434
BackgroundColor = Color.FromArgb("#2c3e50");
3535

3636
//ROOT PAGE
37-
RootPage = new ContentPage()
37+
NewRootPage = new ContentPage()
3838
{
3939
Title = "Flyout",
4040
BackgroundColor = Color.FromArgb("#1abc9c")
@@ -53,7 +53,7 @@ protected override void Init()
5353
await Navigation.PopToRootAsync();
5454
};
5555
rootPageLayout.Children.Add(rootPageButton);
56-
RootPage.Content = rootPageLayout;
56+
NewRootPage.Content = rootPageLayout;
5757

5858

5959
//DETAIL PAGE
@@ -75,7 +75,8 @@ protected override void Init()
7575
//FLYOUTPAGE PAGE
7676
HomePage = new FlyoutPage()
7777
{
78-
Flyout = RootPage,
78+
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover,// To ensure uniform behavior across platforms, set the FlyoutBehavior to Popover.
79+
Flyout = NewRootPage,
7980
Detail = DetailPage
8081
};
8182

@@ -99,5 +100,6 @@ protected override void Init()
99100
};
100101
firstContentPageLayout.Children.Add(firstContentPageButton);
101102
FirstContentPage.Content = firstContentPageLayout;
103+
Navigation.PushAsync(new ContentPage() { Content = rootContentPageLayout });
102104
}
103105
}

src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ShellInsets.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ShellInsets : TestShell
1616

1717
const string EntrySuccess = "EntrySuccess";
1818
const string ResetKeyboard = "Hide Keyboard";
19-
const string ResetKeyboard2 = "Hide Keyboard 2";
19+
const string ResetKeyboard2 = "HideKeyboard2";
2020
const string Reset = "Reset";
2121

2222
const string ToggleSafeArea = "ToggleSafeArea";
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !WINDOWS || MACCATALYST // Setting orientation is not supported on Windows and Mac
1+
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST // Setting orientation is not supported on Windows and Mac
22
using NUnit.Framework;
33
using UITest.Appium;
44
using UITest.Core;
@@ -13,28 +13,35 @@ public Bugzilla31602(TestDevice testDevice) : base(testDevice)
1313

1414
public override string Issue => "not possible to programmatically open master page after iPad landscape -> portrait rotation, also tests 31664";
1515

16-
// [Test]
17-
// [FailsOnIOSWhenRunningOnXamarinUITest]
18-
// [Category(UITestCategories.FlyoutPage)]
19-
// public void Bugzilla31602Test()
20-
// {
21-
// if (Devices.DeviceInfo.Idiom == Devices.DeviceIdiom.Tablet)
22-
// {
23-
// App.Tap("Sidemenu Opener");
24-
// App.WaitForElement("SideMenu");
25-
// App.SetOrientationLandscape();
26-
// App.WaitForElement("SideMenu");
27-
// App.SetOrientationPortrait();
28-
// App.WaitForNoElement("SideMenu");
29-
// App.Tap("Sidemenu Opener");
30-
// App.WaitForElement("SideMenu");
31-
// }
32-
// }
33-
34-
// [TearDown]
35-
// public void TearDown()
36-
// {
37-
// App.SetOrientationPortrait();
38-
// }
16+
[Test]
17+
18+
[Category(UITestCategories.FlyoutPage)]
19+
public void Bugzilla31602Test()
20+
{
21+
App.WaitForElement("Sidemenu Opener");
22+
App.Tap("Sidemenu Opener");
23+
App.WaitForElement("SideMenu");
24+
App.SetOrientationLandscape();
25+
OpenFlyout();
26+
App.SetOrientationPortrait();
27+
OpenFlyout();
28+
29+
}
30+
31+
void OpenFlyout()
32+
{
33+
// Condition to ensure consistent behavior across platforms, for the flyout remains open on Android but closes on iOS during device orientation changes.
34+
#if IOS
35+
App.WaitForElement("Sidemenu Opener");
36+
App.Tap("Sidemenu Opener");
37+
#endif
38+
App.WaitForElement("SideMenu");
39+
}
40+
41+
[TearDown]
42+
public void TearDown()
43+
{
44+
App.SetOrientationPortrait();
45+
}
3946
}
4047
#endif

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Bugzilla/Bugzilla32902.cs

+13-12
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ public Bugzilla32902(TestDevice testDevice) : base(testDevice)
1111
}
1212

1313
public override string Issue => "[iOS | iPad] App Crashes (without debug log) when Flyout Detail isPresented and navigation being popped";
14+
[Test]
15+
[Category(UITestCategories.FlyoutPage)]
16+
public void Bugzilla32902Test()
17+
{
18+
App.WaitForElement("btnNext");
19+
App.Tap("btnNext");
20+
App.WaitForElementTillPageNavigationSettled("btnPushModal");
21+
App.Tap("btnPushModal");
22+
App.WaitForElementTillPageNavigationSettled("PopModal");
23+
App.TapFlyoutPageIcon("Flyout");
24+
App.WaitForElementTillPageNavigationSettled("btnPop");
25+
App.Tap("btnPop");
1426

15-
// [Test]
16-
// [Category(UITestCategories.FlyoutPage)]
17-
// public void Bugzilla32902Test()
18-
// {
19-
// if (Devices.DeviceInfo.Idiom == Devices.DeviceIdiom.Tablet)
20-
// {
21-
// App.Tap("btnNext");
22-
// App.Tap("btnPushModal");
23-
// App.Tap("Flyout");
24-
// App.Tap("btnPop");
25-
// }
26-
// }
27+
}
2728
}

0 commit comments

Comments
 (0)