This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,118 additions
and
288 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11653.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue11653" | ||
Title="Issue 11653"> | ||
<ContentPage.Content> | ||
<StackLayout> | ||
<Label | ||
Padding="12" | ||
BackgroundColor="Black" | ||
TextColor="White"> | ||
<Label.FormattedText> | ||
<FormattedString> | ||
<Span | ||
Text="Without exceptions, the test has passed."/> | ||
<Span | ||
Text="NOTE: Nothing will render."/> | ||
</FormattedString> | ||
</Label.FormattedText> | ||
</Label> | ||
<Path Aspect="Uniform"> | ||
<Path.Data> | ||
<PathGeometry> | ||
<PathGeometry.Figures> | ||
<PathFigureCollection> | ||
<PathFigure | ||
IsClosed="True" | ||
StartPoint="10,100"> | ||
<PathFigure.Segments> | ||
<PathSegmentCollection> | ||
<PolyBezierSegment | ||
Points="100, 100" /> | ||
</PathSegmentCollection> | ||
</PathFigure.Segments> | ||
</PathFigure> | ||
</PathFigureCollection> | ||
</PathGeometry.Figures> | ||
</PathGeometry> | ||
</Path.Data> | ||
</Path> | ||
</StackLayout> | ||
</ContentPage.Content> | ||
</controls:TestContentPage> |
36 changes: 36 additions & 0 deletions
36
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11653.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Shapes; | ||
using System.Collections.Generic; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.Shape)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11653, | ||
"[Bug] Polygon.Points doesn't respond to CollectionChanged events", | ||
PlatformAffected.All)] | ||
public partial class Issue11653 : TestContentPage | ||
{ | ||
public Issue11653() | ||
{ | ||
#if APP | ||
Device.SetFlags(new List<string> { ExperimentalFlags.BrushExperimental, ExperimentalFlags.ShapesExperimental }); | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
|
||
} | ||
} | ||
} |
108 changes: 108 additions & 0 deletions
108
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11723.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using System.Threading.Tasks; | ||
using System.Runtime.CompilerServices; | ||
using System.Linq; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11723, "[Bug] ContentPage in NavigationStack misplaced initially", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
#endif | ||
public class Issue11723 : TestShell | ||
{ | ||
int labelIndex = 0; | ||
ContentPage CreateContentPage() | ||
{ | ||
var page = new ContentPage() | ||
{ | ||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "As you navigate this text should show up in the correct spot. If it's hidden and then shows up this test has failed.", | ||
AutomationId = $"InitialText{labelIndex}" | ||
}, | ||
new Button() | ||
{ | ||
Text = "Push Page", | ||
AutomationId = "PushPage", | ||
Command = new Command(async () => | ||
{ | ||
labelIndex++; | ||
await Navigation.PushAsync(CreateContentPage()); | ||
}) | ||
}, | ||
new Button() | ||
{ | ||
Text = "Pop Page", | ||
AutomationId = "PopPage", | ||
Command = new Command(async () => | ||
{ | ||
labelIndex--; | ||
await Navigation.PopAsync(); | ||
}) | ||
} | ||
} | ||
} | ||
}; | ||
|
||
SetNavBarIsVisible(page, false); | ||
PlatformConfiguration.iOSSpecific.Page.SetUseSafeArea(page, true); | ||
|
||
return page; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
AddContentPage(CreateContentPage()); | ||
} | ||
|
||
|
||
#if UITEST | ||
[Test] | ||
public void PaddingIsSetOnPageBeforeItsVisible() | ||
{ | ||
var initialTextPosition = RunningApp.WaitForFirstElement($"InitialText0").Rect; | ||
RunningApp.Tap("PushPage"); | ||
CompareTextLocation(initialTextPosition, 1); | ||
RunningApp.Tap("PushPage"); | ||
CompareTextLocation(initialTextPosition, 2); | ||
RunningApp.Tap("PushPage"); | ||
CompareTextLocation(initialTextPosition, 3); | ||
RunningApp.Tap("PopPage"); | ||
CompareTextLocation(initialTextPosition, 2); | ||
RunningApp.Tap("PopPage"); | ||
CompareTextLocation(initialTextPosition, 1); | ||
|
||
} | ||
|
||
void CompareTextLocation(UITest.Queries.AppRect initialRect, int i) | ||
{ | ||
var newRect = RunningApp.WaitForFirstElement($"InitialText{i}").Rect; | ||
|
||
Assert.AreEqual(newRect.X, initialRect.X, $"Error With Test :{i}"); | ||
Assert.AreEqual(newRect.Y, initialRect.Y, $"Error With Test :{i}"); | ||
Assert.AreEqual(newRect.CenterX, initialRect.CenterX, $"Error With Test :{i}"); | ||
Assert.AreEqual(newRect.CenterY, initialRect.CenterY, $"Error With Test :{i}"); | ||
} | ||
#endif | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11865.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.CustomAttributes; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.SearchBar)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11865, | ||
"iOS SearchBarRenderer throws a NullReferenceException when the SearchButton redirects to a new page", | ||
PlatformAffected.iOS)] | ||
public class Issue11865 : TestContentPage | ||
{ | ||
public Issue11865() | ||
{ | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Title = "Issue 11865"; | ||
|
||
var layout = new StackLayout | ||
{ | ||
BackgroundColor = Color.LightGreen | ||
}; | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "Type something in the SearchBar and tap the search button." | ||
}; | ||
|
||
var searchBar = new SearchBar(); | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(searchBar); | ||
|
||
Content = layout; | ||
|
||
searchBar.SearchButtonPressed += (sender, args) => | ||
{ | ||
Application.Current.MainPage = new Issue11865SecondPage(); | ||
}; | ||
} | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class Issue11865SecondPage : ContentPage | ||
{ | ||
public Issue11865SecondPage() | ||
{ | ||
var layout = new StackLayout | ||
{ | ||
BackgroundColor = Color.LightCoral | ||
}; | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "If you can read this message (after changing the MainPage), the test has passed.", | ||
Margin = new Thickness(0, 36, 0, 0) | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
|
||
Content = layout; | ||
} | ||
} | ||
} |
121 changes: 121 additions & 0 deletions
121
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11869.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11869, "[Bug] ShellContent.IsVisible issue on Android", | ||
PlatformAffected.Android)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
#endif | ||
public class Issue11869 : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
ContentPage contentPage = new ContentPage(); | ||
var tabbar = AddContentPage<TabBar, Tab>(contentPage, title: "Tab 1"); | ||
AddBottomTab("Tab 2"); | ||
AddBottomTab("Tab 3"); | ||
AddTopTab("TopTab2"); | ||
AddTopTab("TopTab3"); | ||
|
||
contentPage.Content = | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Button | ||
{ | ||
Text = "Hide Bottom Tab 2", | ||
Command = new Command(() => | ||
{ | ||
Items[0].Items[1].Items[0].IsVisible = false; | ||
}), | ||
AutomationId = "HideBottom2" | ||
}, | ||
new Button | ||
{ | ||
Text = "Hide Bottom Tab 3", | ||
Command = new Command(() => | ||
{ | ||
Items[0].Items[2].Items[0].IsVisible = false; | ||
}), | ||
AutomationId = "HideBottom3" | ||
}, | ||
new Button | ||
{ | ||
Text = "Hide Top Tab 2", | ||
Command = new Command(() => | ||
{ | ||
Items[0].Items[0].Items[1].IsVisible = false; | ||
}), | ||
AutomationId = "HideTop2" | ||
}, | ||
new Button | ||
{ | ||
Text = "Hide Top Tab 3", | ||
Command = new Command(() => | ||
{ | ||
Items[0].Items[0].Items[2].IsVisible = false; | ||
}), | ||
AutomationId = "HideTop3" | ||
}, | ||
new Button | ||
{ | ||
Text = "Show All Tabs", | ||
Command = new Command(() => | ||
{ | ||
Items[0].Items[1].Items[0].IsVisible = true; | ||
Items[0].Items[2].Items[0].IsVisible = true; | ||
Items[0].Items[0].Items[1].IsVisible = true; | ||
Items[0].Items[0].Items[2].IsVisible = true; | ||
}), | ||
AutomationId = "ShowAllTabs" | ||
} | ||
} | ||
}; | ||
} | ||
|
||
|
||
#if UITEST && __SHELL__ | ||
[Test] | ||
public void IsVisibleWorksForShowingHidingTabs() | ||
{ | ||
RunningApp.WaitForElement("TopTab2"); | ||
RunningApp.Tap("HideTop2"); | ||
RunningApp.WaitForNoElement("TopTab2"); | ||
|
||
RunningApp.WaitForElement("TopTab3"); | ||
RunningApp.Tap("HideTop3"); | ||
RunningApp.WaitForNoElement("TopTab3"); | ||
|
||
RunningApp.WaitForElement("Tab 2"); | ||
RunningApp.Tap("HideBottom2"); | ||
RunningApp.WaitForNoElement("Tab 2"); | ||
|
||
RunningApp.WaitForElement("Tab 3"); | ||
RunningApp.Tap("HideBottom3"); | ||
RunningApp.WaitForNoElement("Tab 3"); | ||
|
||
RunningApp.Tap("ShowAllTabs"); | ||
RunningApp.WaitForElement("TopTab2"); | ||
RunningApp.WaitForElement("TopTab3"); | ||
RunningApp.WaitForElement("Tab 2"); | ||
RunningApp.WaitForElement("Tab 3"); | ||
} | ||
#endif | ||
} | ||
} |
Oops, something went wrong.