Skip to content
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

[Testing] Enabling ported UITests from Xamarin.UITests to Appium - 19 #26100

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows snapshots are pending and available in the latest build.
image

Could you commit the images?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commited the images for windows UI tests.

}
}
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.
Loading