Skip to content

Commit

Permalink
[Testing] Enabling ported UITests from Xamarin.UITests to Appium - 19 (
Browse files Browse the repository at this point in the history
…#26100)

* Enable xamarinuitest 19th Set (#16)

* Migrated for Issue1323, Issue3342, Issue3798, Issue7396 and Bugzilla30166

* Updated the migrated code changes

* Update Issue3798.cs

* Removed unwanted line space

* Added images for android and ios

---------

Co-authored-by: Harish <harish.kumar@syncfusion.com>

* Added windows images

---------

Co-authored-by: Harish <harish.kumar@syncfusion.com>
  • Loading branch information
anandhan-rajagopal and HarishKumarSF4517 authored Nov 28, 2024
1 parent 9a2c340 commit d76e3cc
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 66 deletions.
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.
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 @@ -22,8 +22,8 @@ public MainPage()
{
Content = new Button
{
AutomationId = "Back",
Text = "Back",
AutomationId = "GoBack",
Text = "GoBack",
Command = new Command(async () => await Navigation.PopModalAsync()),
},
})),
Expand Down
4 changes: 3 additions & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue3342.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ protected override void Init()

var hiddenLabel = new Label
{
Text = "FAIL"
Text = "FAIL",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
};

var target = new BoxView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ protected override void OnAppearing()
base.OnAppearing();
BarTextColor = Colors.White;
Children.RemoveAt(1);
Children.Insert(1, new ContentPage { Title = "Page5", IconImageSource = "Loyalty.png" });
Children.Insert(1, new ContentPage { Title = "Page5", IconImageSource = "coffee.png" }); // Need to replace the image as Loyalty.png once it got available

Children.RemoveAt(3);
Children.Insert(2, new ContentPage { Title = "Page6", IconImageSource = "Gift.png" });
Children.Insert(2, new ContentPage { Title = "Page6", IconImageSource = "star_flyout.png" }); // Need to replace the image as Gift.png once it got available
BarTextColor = Colors.White;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ View CreateEntryInsetView()
Text = "Random Shell Background Color",
AutomationId = ChangeShellColorButton,
Command = new Command(() =>
Shell.SetBackgroundColor(this, Color.FromRgb(random.Next(0,255), random.Next(0,255), random.Next(0,255))))
Shell.SetBackgroundColor(this, Colors.Red))
},
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,13 @@ public Bugzilla30166(TestDevice testDevice) : base(testDevice)
[Test]
[Category(UITestCategories.Navigation)]
[Category(UITestCategories.Compatibility)]
[FailsOnMacWhenRunningOnXamarinUITest]
public void Issue10222Test()
public void Bugzilla30166Test()
{
try
{
App.WaitForElement("PushModal");
App.Tap("PushModal");
App.WaitForElement("Back");
App.Tap("Back");
App.Screenshot("Navigation bar should be red");
}
finally
{
App.Back();
}
App.WaitForElement("PushModal");
App.Tap("PushModal");
App.WaitForElement("GoBack");
App.Tap("GoBack");
VerifyScreenshot();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if ANDROID

using NUnit.Framework;
using UITest.Core;

Expand All @@ -12,14 +12,11 @@ public Issue3342(TestDevice testDevice) : base(testDevice)

public override string Issue => "[Android] BoxView BackgroundColor not working on 3.2.0-pre1";

// [Test]
// [Category(UITestCategories.BoxView)]
// [Category(UITestCategories.Compatibility)]
// public void Issue3342Test()
// {
// App.Screenshot("I am at Issue 3342");
// App.Screenshot("I see the green box");
// }
[Test]
[Category(UITestCategories.BoxView)]
public void Issue3342Test()
{
VerifyScreenshot();
}
}
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@ namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue1323 : _IssuesUITest
{
const string Success = "Success";

#if ANDROID
const string Tab1 = "PAGE 1";
const string Tab2 = "PAGE5";
#else
const string Tab1 = "Page 1";
const string Tab2 = "Page5";
#endif

public Issue1323(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "tabbed page BarTextColor is not pervasive and can't be applied after instantiation";

// [Test]
// [Category(UITestCategories.TabbedPage)]
// [FailsOnIOS]
// public void Issue1323Test()
// {
// App.WaitForElement(X => X.Marked("Page 1"));
// App.WaitForElement(X => X.Marked("Page5"));
// App.Screenshot("All tab bar items text should be white");
// }
[Test]
[Category(UITestCategories.TabbedPage)]
public void Issue1323Test()
{
App.WaitForElement(Tab1);
App.WaitForElement(Tab2);
VerifyScreenshot();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if TEST_FAILS_ON_WINDOWS // SepraratorColor is not supported on Windows by default. https://github.com/dotnet/maui/issues/8112
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -11,14 +12,14 @@ public Issue3798(TestDevice testDevice) : base(testDevice)

public override string Issue => "[Android] SeparatorColor of ListView is NOT updated dynamically";

//[Test]
//[Category(UITestCategories.ListView)]
//[FailsOnMauiIOS]
//public void Issue3798Test()
//{
// App.WaitForElement("listViewSeparatorColor");
// App.Screenshot("Green ListView Separator");
// App.Tap(q => q.Marked("item1"));
// App.Screenshot("Red ListView Separator");
//}
}
[Test]
[Category(UITestCategories.ListView)]

public void Issue3798Test()
{
App.WaitForElement("listViewSeparatorColor");
App.Tap("item1");
VerifyScreenshot();
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ public Issue7396(TestDevice testDevice) : base(testDevice)
{
}

const string CreateTopTabButton = "CreateTopTabButton";
const string CreateBottomTabButton = "CreateBottomTabButton";
const string ChangeShellColorButton = "ChangeShellBackgroundColorButton";

public override string Issue => "Setting Shell.BackgroundColor overrides all colors of TabBar";

// TODO: Marked as ManualReview in original test, can we somehow automate this?
//[Test]
//[Category(UITestCategories.Shell)]
//public void BottomTabColorTest()
//{
// //7396 Issue | Shell: Setting Shell.BackgroundColor overrides all colors of TabBar
// App.WaitForElement(CreateBottomTabButton);
// App.Tap(CreateBottomTabButton);
// App.Tap(CreateBottomTabButton);
// App.Tap(ChangeShellColorButton);
// App.Screenshot("I should see a bottom tabbar icon");
// Assert.Inconclusive("Check that bottom tabbar icon is visible");
//}
[Test]
[Category(UITestCategories.Shell)]
public void BottomTabColorTest()
{
//7396 Issue | Shell: Setting Shell.BackgroundColor overrides all colors of TabBar
App.WaitForElement(CreateBottomTabButton);
App.Tap(CreateBottomTabButton);
App.Tap(CreateBottomTabButton);
App.Tap(ChangeShellColorButton);
VerifyScreenshot();
}
}
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.
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.
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.

0 comments on commit d76e3cc

Please sign in to comment.