Skip to content

Commit cdbf93d

Browse files
Enabled 48th set of Migrated test cases from XamarinUITest into Appium (#47) (#26607)
* migrated the issues from xamarian to appium * Updated migrated test changes --------- Co-authored-by: LogishaSelvarajSF4525 <logisha.selvaraj@syncfusion.com>
1 parent bd844b4 commit cdbf93d

File tree

8 files changed

+141
-96
lines changed

8 files changed

+141
-96
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ protected override void Init()
1515
Content = new StackLayout
1616
{
1717
Spacing = 10,
18-
VerticalOptions = LayoutOptions.Start,
1918
Children = { userNameEditor }
2019
};
2120
}
22-
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:viewportWidth="104"
4+
android:viewportHeight="97"
5+
android:width="104dp"
6+
android:height="97dp">
7+
<path
8+
android:pathData="M14 85l3 9 72 0c0 0 5 -9 4 -10 -2 -2 -79 0 -79 1"
9+
android:fillColor="#7c4e32" />
10+
<path
11+
android:pathData="M19 47c0 0 -9 7 -13 14 -5 6 3 7 3 7l1 14c0 0 10 8 23 8 14 0 26 1 28 0 2 -1 9 -2 9 -4 1 -1 27 1 27 -9C97 67 104 57 86 48 69 39 19 47 19 47"
12+
android:fillColor="#e30000" />
13+
<path
14+
android:pathData="M17 32C14 80 97 75 88 29L53 14"
15+
android:fillColor="#ffe1c4" />
16+
<path
17+
android:pathData="M17 32C26 -4 78 0 88 29 68 20 48 20 17 32"
18+
android:fillColor="#8ed8f8" />
19+
<path
20+
android:pathData="M54 35a10 8 60 1 1 0 0.1zm-17 3a10 8 -60 1 1 0 0.1z"
21+
android:fillColor="#ffffff" />
22+
<path
23+
android:pathData="M41 6c1 -1 4 -3 8 -3 3 0 9 -1 14 3L62 8 60 8 58 8C58 8 55 9 53 8 51 7 52 7 52 7L49 8 47 7 46 7c0 0 -1 2 -3 2 0 0 -2 -1 -2 -3m-24 28l0 -2c0 0 35 -20 71 -3l0 2C88 31 53 14 17 34M5 62c3 -2 5 -2 8 0 3 2 13 6 8 11 -2 2 -6 0 -8 0 -1 1 -4 2 -6 1C3 71 1 66 5 62m94 -3c0 0 -9 -2 -11 4l-3 5c0 1 -2 3 3 3 5 0 5 2 7 2 3 0 7 -1 7 -4 0 -4 -1 -11 -3 -10"
24+
android:fillColor="#fff200" />
25+
<path
26+
android:pathData="M56 78l0 1m-1 -10l0 1m0 17l0 1"
27+
android:strokeWidth="1"
28+
android:fillColor="#000000"
29+
android:strokeColor="#000000"
30+
android:strokeLineCap="round" />
31+
<path
32+
android:pathData="M60 36a1 1 0 1 1 0 -0.1M49 36a1 1 0 1 1 0 -0.1M57 55a2 3 0 1 1 0 -0.1M12 94c0 0 20 -4 42 0 0 0 27 -4 39 0z"
33+
android:fillColor="#000000" />
34+
<path
35+
android:pathData="M50 59c0 0 4 3 10 0m-4 7l2 12 -2 12M25 50c0 0 10 12 23 12 13 0 24 0 35 -15"
36+
android:strokeWidth="0.5"
37+
android:strokeColor="#000000" />
38+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="356dp"
4+
android:height="508dp"
5+
android:viewportWidth="356"
6+
android:viewportHeight="508">
7+
<path android:fillColor="#000000" android:pathData="M330.4 0H25.6C11.6 0 .2 11.4.2 25.4v457.2c0 14 11.4 25.4 25.4 25.4h304.8c14 0 25.4-11.4 25.4-25.4V25.4c0-14-11.4-25.4-25.4-25.4zM178 482.6c-14 0-25.4-11.4-25.4-25.4 0-14 11.4-25.4 25.4-25.4 14 0 25.4 11.4 25.4 25.4 0 14-11.4 25.4-25.4 25.4zm127-86.4c0 5.6-4.5 10.2-10.2 10.2H61.2c-5.6 0-10.2-4.6-10.2-10.2V61c0-5.6 4.5-10.2 10.2-10.2h233.7c5.6 0 10.2 4.6 10.2 10.2v335.2h-.1z"/>
8+
<path android:fillColor="#000000" android:pathData="M178 101.6c-14 0-25.4 11.4-25.4 25.4 0 14 11.4 25.4 25.4 25.4 14 0 25.4-11.4 25.4-25.4 0-14-11.4-25.4-25.4-25.4zM178 203.2c-14 0-25.4 11.4-25.4 25.4v101.6c0 14 11.4 25.4 25.4 25.4 14 0 25.4-11.4 25.4-25.4V228.6c0-14-11.4-25.4-25.4-25.4z"/>
9+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- res/drawable/heart.xml -->
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:height="256dp"
4+
android:width="256dp"
5+
android:viewportWidth="32"
6+
android:viewportHeight="32">
7+
8+
<!-- draw a path -->
9+
<path android:fillColor="#8fff"
10+
android:pathData="M20.5,9.5
11+
c-1.955,0,-3.83,1.268,-4.5,3
12+
c-0.67,-1.732,-2.547,-3,-4.5,-3
13+
C8.957,9.5,7,11.432,7,14
14+
c0,3.53,3.793,6.257,9,11.5
15+
c5.207,-5.242,9,-7.97,9,-11.5
16+
C25,11.432,23.043,9.5,20.5,9.5z" />
17+
</vector>
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,35 @@
1-
#if WINDOWS
2-
using NUnit.Framework;
1+
using NUnit.Framework;
32
using UITest.Appium;
43
using UITest.Core;
54

65
namespace Microsoft.Maui.TestCases.Tests.Issues;
76

87
public class Bugzilla43663 : _IssuesUITest
98
{
10-
const string PushModal = "Push Modal";
11-
12-
const string PopModal = "Pop Modal";
13-
14-
const string Modal = "Modal";
9+
#if MACCATALYST
10+
const string AlertCancelButton = "action-button--999";
11+
#else
12+
const string AlertCancelButton = "Cancel";
13+
#endif
1514

1615
public Bugzilla43663(TestDevice testDevice) : base(testDevice)
1716
{
1817
}
1918

2019
public override string Issue => "ModalPushed and ModalPopped not working on WinRT";
2120

22-
// [Test]
23-
// [Category(UITestCategories.Navigation)]
24-
// public void ModalNavigation()
25-
// {
26-
// var i = 0;
27-
// while(App.GetAlerts().Count == 0 && i < 3)
28-
// {
29-
// i++;
30-
// Task.Delay(1000);
31-
// }
32-
33-
// App.GetAlert()?.DismissAlert();
34-
// App.WaitForElement(PushModal);
35-
// App.Tap(PushModal);
36-
// App.GetAlert()?.DismissAlert();
37-
// App.WaitForElement(Modal);
38-
// App.Tap(PopModal);
39-
// App.GetAlert()?.DismissAlert();
40-
// App.WaitForElement(PushModal);
41-
// }
42-
}
43-
#endif
21+
[Test]
22+
[Category(UITestCategories.Navigation)]
23+
public void ModalNavigation()
24+
{
25+
App.WaitForElement("Click to push Modal");
26+
App.Tap("Click to push Modal");
27+
App.WaitForElementTillPageNavigationSettled(AlertCancelButton);
28+
App.Tap(AlertCancelButton);
29+
App.WaitForElement("Modal");
30+
App.Tap("Click to dismiss modal");
31+
App.WaitForElementTillPageNavigationSettled(AlertCancelButton);
32+
App.Tap(AlertCancelButton);
33+
App.WaitForElement("Click to push Modal");
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if ANDROID
1+
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST// This test uses a platform-specific API relevant only to Android.
22
using NUnit.Framework;
33
using UITest.Appium;
44
using UITest.Core;
@@ -7,33 +7,33 @@ namespace Microsoft.Maui.TestCases.Tests.Issues;
77

88
public class Bugzilla44044 : _IssuesUITest
99
{
10-
//string _btnToggleSwipe = "btnToggleSwipe";
11-
//string _btnDisplayAlert = "btnDisplayAlert";
10+
string _btnToggleSwipe = "btnToggleSwipe";
11+
string _btnDisplayAlert = "btnDisplayAlert";
1212

1313
public Bugzilla44044(TestDevice testDevice) : base(testDevice)
1414
{
1515
}
1616

1717
public override string Issue => "TabbedPage steals swipe gestures";
1818

19-
// [Test]
20-
// [Category(UITestCategories.TabbedPage)]
21-
// public void Bugzilla44044Test()
22-
// {
23-
// App.WaitForElement(_btnToggleSwipe);
24-
25-
// App.SwipeRightToLeft();
26-
// App.WaitForNoElement(_btnToggleSwipe);
27-
// App.WaitForElement(_btnDisplayAlert);
28-
29-
// App.SwipeLeftToRight();
30-
// App.WaitForNoElement(_btnDisplayAlert);
31-
// App.WaitForElement(_btnToggleSwipe);
32-
33-
// App.Tap(_btnToggleSwipe);
34-
// App.SwipeRightToLeft();
35-
// App.WaitForNoElement(_btnDisplayAlert);
36-
// App.WaitForElement(_btnToggleSwipe);
37-
// }
19+
[Test]
20+
[Category(UITestCategories.TabbedPage)]
21+
public void Bugzilla44044Test()
22+
{
23+
App.WaitForElement(_btnToggleSwipe);
24+
25+
App.SwipeRightToLeft();
26+
App.WaitForNoElement(_btnToggleSwipe);
27+
App.WaitForElement(_btnDisplayAlert);
28+
29+
App.SwipeLeftToRight();
30+
App.WaitForNoElement(_btnDisplayAlert);
31+
App.WaitForElement(_btnToggleSwipe);
32+
33+
App.Tap(_btnToggleSwipe);
34+
App.SwipeRightToLeft();
35+
App.WaitForNoElement(_btnDisplayAlert);
36+
App.WaitForElement(_btnToggleSwipe);
37+
}
3838
}
3939
#endif
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
using NUnit.Framework;
1+
# if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // This test uses a vector image resources which applicable only for Android.
2+
using NUnit.Framework;
23
using UITest.Appium;
34
using UITest.Core;
45

56
namespace Microsoft.Maui.TestCases.Tests.Issues;
7+
68
public class Bugzilla47923 : _IssuesUITest
79
{
810
public Bugzilla47923(TestDevice testDevice) : base(testDevice)
911
{
1012
}
1113

12-
public override string Issue => "TapGestureRecognizer blocks List View Context Actions1";
14+
public override string Issue => "Vectors don\'t work in Images, and work badly in Buttons";
1315

14-
// [FailsOnAndroidWhenRunningOnXamarinUITest]
15-
// [FailsOnIOSWhenRunningOnXamarinUITest]
16-
// [Test]
17-
// public void Bugzilla47923Test()
18-
// {
19-
// foreach (var testString in new[] { "AspectFit", "AspectFill", "Fill", "Test cell views" })
20-
// {
21-
// App.WaitForElement(q => q.Marked(testString));
22-
// App.Tap(q => q.Marked(testString));
23-
// App.Back();
24-
// }
25-
// }
26-
}
16+
17+
[Test]
18+
[Category(UITestCategories.ListView)]
19+
public void Bugzilla47923Test()
20+
{
21+
foreach (var testString in new[] { "AspectFit", "AspectFill", "Fill", "Test cell views" })
22+
{
23+
App.WaitForElement((testString));
24+
App.Tap((testString));
25+
App.Back();
26+
}
27+
}
28+
}
29+
#endif
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using NUnit.Framework;
1+
# if TEST_FAILS_ON_CATALYST //While invoking EnterText("1") results in the text being cleared before appending "1", leading to test fails on Catalyst.
2+
using NUnit.Framework;
23
using UITest.Appium;
34
using UITest.Core;
45

@@ -10,32 +11,18 @@ public Issue2272(TestDevice testDevice) : base(testDevice)
1011
{
1112
}
1213

13-
public override string Issue => "Setting a different Detail page from a FlyoutPage after 2nd time on MainPage";
14+
public override string Issue => "Entry text updating set focus on the beginning of text not the end of it";
1415

15-
// [Test]
16-
// [Category(UITestCategories.Navigation)]
17-
// [FailsOnIOSWhenRunningOnXamarinUITest]
18-
// #if MACCATALYST // Check if this is still try for MAUI?
19-
// [Ignore("EnterText problems in UITest Desktop")]
20-
// #endif
21-
// public void TestFocusIsOnTheEndAfterSettingText ()
22-
// {
23-
// App.WaitForElement("userNameEditorEmptyString");
24-
// App.Tap (c => c.Marked ("userNameEditorEmptyString"));
25-
// App.EnterText ("1");
26-
// PressEnter ();
27-
// var q = App.Query(c => c.Marked("userNameEditorEmptyString"));
28-
// Assert.AreEqual("focused1", q[0].Text);
29-
// }
30-
31-
// void PressEnter ()
32-
// {
33-
// var androidApp = RunningApp as AndroidApp;
34-
// if (androidApp != null) {
35-
// androidApp.PressUserAction (UserAction.Done);
36-
// }
37-
// else {
38-
// App.PressEnter ();
39-
// }
40-
// }
16+
[Test]
17+
[Category(UITestCategories.Entry)]
18+
public void TestFocusIsOnTheEndAfterSettingText()
19+
{
20+
App.WaitForElement("userNameEditorEmptyString");
21+
App.Tap("userNameEditorEmptyString");
22+
App.EnterText("userNameEditorEmptyString", "1");
23+
App.PressEnter();
24+
var q = App.FindElement("userNameEditorEmptyString");
25+
Assert.That("focused1", Is.EqualTo(q.GetText()));
26+
}
4127
}
28+
#endif

0 commit comments

Comments
 (0)