using Droid = Android;
using System.Globalization;
-
+using Java.Interop;
+using Xamarin.Forms.Controls.Issues;
[assembly: Dependency (typeof (CacheService))]
[assembly: Dependency (typeof (TestCloudService))]
{
base.OnDestroy();
}
+
+ [Export("NavigateToTest")]
+ public bool NavigateToTest(string test)
+ {
+ return _app.NavigateToTestPage(test);
+ }
}
#else
]
public class Activity1 : FormsAppCompatActivity
{
+ App _app;
+
protected override void OnCreate (Bundle bundle)
{
ToolbarResource = Resource.Layout.Toolbar;
//Forms.SetTitleBarVisibility (AndroidTitleBarVisibility.Never);
var app = new App();
+ _app = app;
// When the native control gallery loads up, it'll let us know so we can add the nested native controls
MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);
return null;
}
}
+
+ [Export("NavigateToTest")]
+ public bool NavigateToTest(string test)
+ {
+ return _app.NavigateToTestPage(test);
+ }
+
+ [Export("Reset")]
+ public void Reset()
+ {
+ _app.Reset();
+ }
}
#endif
}
using AView = Android.Views.View;
using Android.OS;
using System.Reflection;
+using Xamarin.Forms.Controls.Issues;
[assembly: ExportRenderer(typeof(Bugzilla31395.CustomContentView), typeof(CustomContentRenderer))]
[assembly: ExportRenderer(typeof(NativeListView), typeof(NativeListViewRenderer))]
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
+ <Reference Include="Mono.Android.Export" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.iOS;
using Xamarin.Forms.Controls;
+using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.Platform.iOS;
[assembly: Dependency(typeof(TestCloudService))]
[Register("AppDelegate")]
public partial class AppDelegate : FormsApplicationDelegate
{
+ App _app;
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
{
};
var app = new App();
+ _app = app;
// When the native control gallery loads up, it'll let us know so we can add the nested native controls
MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);
}
#endregion
+
+ [Export("navigateToTest:")]
+ public string NavigateToTest(string test)
+ {
+ // According to https://developer.xamarin.com/guides/testcloud/uitest/working-with/backdoors/
+ // this method has to return a string
+ return _app.NavigateToTestPage(test).ToString();
+ }
+
+ [Export("reset:")]
+ public string Reset(string str)
+ {
+ _app.Reset();
+ return String.Empty;
+ }
}
[Register("KVOUISlider")]
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.iOS;
using Xamarin.Forms.Controls;
+using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.Platform.iOS;
using RectangleF = CoreGraphics.CGRect;
namespace Xamarin.Forms.Controls
{
-
public class PropertyChangedBase : INotifyPropertyChanged
{
Dictionary<string, object> _properties = new Dictionary<string, object>();
}
}
- [Preserve (AllMembers = true)]
- [Issue (IssueTracker.None, 0, "Adding Multiple Items to a ListView", PlatformAffected.All)]
+
+}
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.None, 0, "Adding Multiple Items to a ListView", PlatformAffected.All)]
public class AddingMultipleItemsListView : TestContentPage
{
- protected override void Init ()
+ protected override void Init()
{
Title = "Hours";
var exampleViewModel = new ExampleViewModel();
Children = {
listView,
addOneJobButton,
- addTwoJobsButton
+ addTwoJobsButton
}
};
Content = layout;
}
- [Preserve (AllMembers = true)]
+ [Preserve(AllMembers = true)]
public class CustomViewCell : ViewCell
{
- public CustomViewCell ()
+ public CustomViewCell()
{
- var jobId = new Label {
+ var jobId = new Label
+ {
#pragma warning disable 618
Font = Font.SystemFontOfSize(20),
#pragma warning restore 618
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.StartAndExpand
- };
+ };
jobId.SetBinding(Label.TextProperty, "JobId");
- var jobName = new Label {
+ var jobName = new Label
+ {
VerticalOptions = LayoutOptions.Center,
WidthRequest = 175,
HorizontalOptions = LayoutOptions.CenterAndExpand,
};
jobName.SetBinding(Label.TextProperty, "JobName");
- var hours = new Label {
+ var hours = new Label
+ {
WidthRequest = 45,
VerticalOptions = LayoutOptions.Center,
#pragma warning disable 618
};
hours.SetBinding(Label.TextProperty, new Binding("Hours", BindingMode.OneWay, new DoubleStringConverter()));
- var hlayout = new StackLayout {
- Children = {
+ var hlayout = new StackLayout
+ {
+ Children = {
jobId,
jobName,
hours
View = hlayout;
}
}
-
+
#if UITEST
[Test]
- public void AddingMultipleListViewTests1AllElementsPresent ()
+ public void AddingMultipleListViewTests1AllElementsPresent()
{
- RunningApp.WaitForElement (q => q.Marked ("Big Job"));
- RunningApp.WaitForElement (q => q.Marked ("Smaller Job"));
- RunningApp.WaitForElement (q => q.Marked ("Add On Job"));
- RunningApp.WaitForElement (q => q.Marked ("Add One"));
- RunningApp.WaitForElement (q => q.Marked ("Add Two"));
- RunningApp.WaitForElement (q => q.Marked ("3672"));
- RunningApp.WaitForElement (q => q.Marked ("6289"));
- RunningApp.WaitForElement (q => q.Marked ("3672-41"));
- RunningApp.WaitForElement (q => q.Marked ("2"));
- RunningApp.WaitForElement (q => q.Marked ("2"));
- RunningApp.WaitForElement (q => q.Marked ("23"));
-
- RunningApp.Screenshot ("All elements are present");
+ RunningApp.WaitForElement(q => q.Marked("Big Job"));
+ RunningApp.WaitForElement(q => q.Marked("Smaller Job"));
+ RunningApp.WaitForElement(q => q.Marked("Add On Job"));
+ RunningApp.WaitForElement(q => q.Marked("Add One"));
+ RunningApp.WaitForElement(q => q.Marked("Add Two"));
+ RunningApp.WaitForElement(q => q.Marked("3672"));
+ RunningApp.WaitForElement(q => q.Marked("6289"));
+ RunningApp.WaitForElement(q => q.Marked("3672-41"));
+ RunningApp.WaitForElement(q => q.Marked("2"));
+ RunningApp.WaitForElement(q => q.Marked("2"));
+ RunningApp.WaitForElement(q => q.Marked("23"));
+
+ RunningApp.Screenshot("All elements are present");
}
[Test]
- public void AddingMultipleListViewTests2AddOneElementToList ()
+ public void AddingMultipleListViewTests2AddOneElementToList()
{
- RunningApp.Tap (q => q.Marked ("Add One"));
+ RunningApp.Tap(q => q.Marked("Add One"));
- RunningApp.WaitForElement (q => q.Marked ("1234"), timeout: TimeSpan.FromSeconds (2));
- RunningApp.Screenshot ("One more element exists");
+ RunningApp.WaitForElement(q => q.Marked("1234"), timeout: TimeSpan.FromSeconds(2));
+ RunningApp.Screenshot("One more element exists");
}
[Test]
- public void AddingMultipleListViewTests3AddTwoElementToList ()
+ public void AddingMultipleListViewTests3AddTwoElementToList()
{
- RunningApp.Screenshot ("Click 'Add Two'");
- RunningApp.Tap (q => q.Marked ("Add Two"));
+ RunningApp.Screenshot("Click 'Add Two'");
+ RunningApp.Tap(q => q.Marked("Add Two"));
- RunningApp.WaitForElement (q => q.Marked ("9999"), timeout: TimeSpan.FromSeconds (2));
- RunningApp.WaitForElement (q => q.Marked ("8888"), timeout: TimeSpan.FromSeconds (2));
- RunningApp.Screenshot ("Two more element exist");
+ RunningApp.WaitForElement(q => q.Marked("9999"), timeout: TimeSpan.FromSeconds(2));
+ RunningApp.WaitForElement(q => q.Marked("8888"), timeout: TimeSpan.FromSeconds(2));
+ RunningApp.Screenshot("Two more element exist");
}
#endif
}
-}
+}
\ No newline at end of file
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 21177, "Using a UICollectionView in a ViewRenderer results in issues with selection")]
using System.Collections.Generic;
using System.Linq;
-
+using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 24574, "Tap Double Tap")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 25979, "https://bugzilla.xamarin.com/show_bug.cgi?id=25979")]
<local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xamarin.Forms.Controls"
- x:Class="Xamarin.Forms.Controls.Bugzilla26032">
+ x:Class="Xamarin.Forms.Controls.Issues.Bugzilla26032">
<RelativeLayout>
<ListView x:Name="List1"
RelativeLayout.XConstraint="{ConstraintExpression Type=Constant, Constant=0}"
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 26171, "Xamarin.Forms.Maps is not updating VisibleRegion property when layout is changed")]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
public class FamilyViewModel
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 26993, "https://bugzilla.xamarin.com/show_bug.cgi?id=26993")]
[Preserve (AllMembers = true)]
public class Bz26993ViewCell : ViewCell
{
- static int s_id = 0;
+ public static int s_id = 0;
public Bz26993ViewCell ()
{
protected override void Init ()
{
+ Bz26993ViewCell.s_id = 0;
+
var itemSource = new List<string> {
"",
"",
Content = tableview;
}
-
-#if UITEST
-
-#endif
}
}
using Xamarin.Forms.CustomAttributes;
using System.Collections.Generic;
+using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 28001, "[Android] TabbedPage: invisible tabs are not Disposed", PlatformAffected.Android)]
Master = new NavigationPage( new ContentPage { Title = "MasterPage", BackgroundColor = Color.Blue }) { Title =" Master" };
}
- protected override async void OnAppearing ()
+ protected override async void OnAppearing()
{
- var btn = new Button () { Text = "GO Back" };
- btn.Clicked+= async (object sender, EventArgs e) => await (Master as NavigationPage).PopAsync ();
+ var btn = new Button() { Text = "GO Back" };
+ btn.Clicked += async (object sender, EventArgs e) => await (Master as NavigationPage).PopAsync();
- await (Master as NavigationPage).PushAsync (new ContentPage { Title = "New MasterPage", Content = btn , BackgroundColor = Color.Pink });
- base.OnAppearing ();
+ await (Master as NavigationPage).PushAsync(new ContentPage { Title = "New MasterPage", Content = btn, BackgroundColor = Color.Pink });
+ base.OnAppearing();
}
-#if UITEST
- [Test]
- public void Bugzilla28240Test ()
- {
-
- }
-#endif
}
}
using System;
-
+using System.Threading.Tasks;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 28498, "App crashes when switching between NavigationPages on a MasterDetailPage when In-Call Status Bar is visible")]
#if UITEST
[Test]
+ [Ignore("This test doesn't make a lot of sense and crashes 50% of the time; need to re-investigate it.")]
public void Bugzilla28498Test ()
{
- RunningApp.SetOrientationPortrait ();
+ RunningApp.SetOrientationPortrait();
RunningApp.Tap (q => q.Marked ("btnOpen"));
RunningApp.Tap (q => q.Marked ("btnOther"));
+
RunningApp.SetOrientationLandscape ();
RunningApp.Tap (q => q.Marked ("btnOpen"));
RunningApp.Screenshot ("Detail open");
else
Assert.Inconclusive ("Should be button here, but rotation could take some time on XTC");
}
+
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait ();
+ }
#endif
}
}
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 28570, "https://bugzilla.xamarin.com/show_bug.cgi?id=28570")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 28575, "listview header set to null")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 28709, "Application.Properties saving crash ")]
{
_lbl.Text = "Click " + DateTime.Now.ToLocalTime ();
}
-
-#if UITEST
- [Test]
- public void Issue1Test ()
- {
-
- }
-#endif
}
}
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 29128, "Slider background lays out wrong Android")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 29247, "iOS Device.OpenUri breaks with encoded params", PlatformAffected.iOS )]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 29257, "CarouselPage.CurrentPage Does Not Work Properly When Used Inside a NavigationPage ")]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.LifeCycle)]
public void PushButton ()
{
RunningApp.Tap (q => q.Marked ("Modal Push Pop Test"));
- System.Threading.Thread.Sleep (5);
+ System.Threading.Thread.Sleep (2000);
// if it didn't crash, yay
+ RunningApp.WaitForElement(q => q.Marked("Modal Push Pop Test"));
}
#endif
}
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.LifeCycle)]
using System.Collections.Generic;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 30317, "https://bugzilla.xamarin.com/show_bug.cgi?id=30137")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 30324, "Detail view of MasterDetailPage does not get appearance events on Android when whole MasterDetailPage disappears/reappears")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 30353, "MasterDetailPage.IsPresentedChanged is not raised")]
RunningApp.SetOrientationLandscape ();
}
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait ();
+ }
+
void Back()
{
#if __IOS__
using System.Linq;
using Xamarin.Forms.Internals;
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 30651, "ListView jumps around while scrolling after items are added to its source")]
using System;
using Xamarin.Forms.CustomAttributes;
-
+using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
+ [Preserve(AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 30935, "NullReferenceException in ViewRenderer<TView, TNativeView> (Xamarin.Forms.Platform.Android)")]
public class Bugzilla30935 : TestContentPage
{
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 31255, "Master's page Icon cause memory leak after MasterDetailPage is popped out by holding on page")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 31330, "Disabled context actions appear enabled")]
[Test]
public void Bugzilla31330Test ()
{
+ RunningApp.WaitForElement (c => c.Marked ("Something 2"));
var screenBounds = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
var cell = RunningApp.Query (c => c.Marked ("Something 1")) [0];
#endif
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Bugzilla, 31333,
RunningApp.EnterText ("Entry in ListView Success");
Assert.True(RunningApp.Query(query => query.Text("Entry in ListView Success")).Length > 0);
RunningApp.Screenshot ("Entry in ListView Success");
+ RunningApp.Tap(q => q.Marked("Focus Entry in ListView"));
}
[Test]
RunningApp.EnterText ("Editor in ListView Success");
Assert.True(RunningApp.Query(query => query.Text("Editor in ListView Success")).Length > 0);
RunningApp.Screenshot ("Editor in ListView Success");
+ RunningApp.Tap(q => q.Marked("Focus Editor in ListView"));
}
RunningApp.EnterText ("Entry in TableView Success");
Assert.True(RunningApp.Query(query => query.Text("Entry in TableView Success")).Length > 0);
RunningApp.Screenshot ("Entry in TableView Success");
+ RunningApp.Tap(q => q.Marked("Focus Entry in Table"));
}
[Test]
RunningApp.EnterText ("Editor in TableView Success");
Assert.True(RunningApp.Query(query => query.Text("Editor in TableView Success")).Length > 0);
RunningApp.Screenshot ("Editor in TableView Success");
+ RunningApp.Tap(q => q.Marked("Focus Editor in Table"));
}
#endif
}
#endif
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 31366, "Pushing and then popping a page modally causes ArgumentOutOfRangeException",
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
- // don't forget to update C:\Users\chrisk\Documents\git\DuploBuddy\Xamarin.Forms.ControlGallery.Android\LinkerRoots.cs
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 31395, "Crash when switching MainPage and using a Custom Render")]
public class Bugzilla31395 : TestContentPage // or TestMasterDetailPage, etc ...
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(UITestCategories.MasterDetailPage)]
RunningApp.WaitForElement (q => q.Marked ("SideMenu"));
}
}
+
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait ();
+ }
#endif
}
}
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Cells)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 32230, "isPresentedChanged raises multiple times")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 32615, "OnAppearing is not called on previous page when modal page is popped")]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 32801, "Memory Leak in TabbedPage + NavigationPage")]
RunningApp.Tap (c => c.Marked ("btnStack"));
RunningApp.WaitForElement (c => c.Marked ("Stack 1"));
}
+
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait ();
+ }
#endif
}
}
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 32898, "Memory leak when TabbedPage is popped out ")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 32902, "[iOS | iPad] App Crashes (without debug log) when Master Detail isPresented and navigation being popped")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 33578, "TableView EntryCell shows DefaultKeyboard, but after scrolling down and back a NumericKeyboard (")]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 33612,
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 34007, "Z order drawing of children views are different on Android, iOS, Win", PlatformAffected.Android | PlatformAffected.iOS)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 34061, "RelativeLayout - First child added after page display does not appear")]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 34561, "[A] Navigation.PushAsync crashes when used in Context Actions (legacy)", PlatformAffected.Android)]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 34632, "Can't change IsPresented when setting SplitOnLandscape ")]
RunningApp.Tap (q => q.Marked ("btnMaster"));
}
}
+
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait ();
+ }
#endif
}
}
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 35157, "CarouselPage inside NavPage inside TabbedPage gets laid out incorrectly", NavigationBehavior.PushModalAsync)]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 35472, "PopAsync during ScrollToAsync throws NullReferenceException")]
using Xamarin.UITest.Queries;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 35477, "Tapped event does not fire when added to Frame in Android AppCompat",
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 35733, "iOS WebView crashes when loading an URL with encoded parameters", PlatformAffected.iOS)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
public class CustomButton : Button
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 36009, "Children of Layouts with data bound IsVisible are not displayed")]
using Xamarin.UITest.Queries;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 36171, "WinRT Entry UI not updating on TextChanged",
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 36393, "[A] Default Entry/Editor/SearchBar Font Size is 14 instead of 18")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 36559, "[WP] Navigating to a ContentPage with a Grid inside a TableView affects Entry heights")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 36681, "[A] NRE when Picker Replaces Page Content (pre-AppCompat only)", PlatformAffected.Android)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 36788, "Truncation Issues with Relative Layouts")]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 37462, "Using App Compat/App Compat theme breaks Navigation.RemovePage on Android ",PlatformAffected.Android )]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 37625, "App crashes when quickly adding/removing Image views (Windows UWP)")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 37841, "TableView EntryCells and TextCells cease to update after focus change", PlatformAffected.Android)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 38112, "Switch becomes reenabled when previous ViewCell is removed from TableView", PlatformAffected.Android)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 38658, "Rotation causes app containing CarouselPage to freeze", PlatformAffected.iOS)]
RunningApp.Back ();
RunningApp.WaitForElement (q => q.Marked ("btn"));
}
+
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait ();
+ }
#endif
}
}
\ No newline at end of file
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 38978, "Cell.ForceUpdateSize issues with row selection/deselection (ViewCell)", PlatformAffected.Android)]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.BoxView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 39458, "[UWP/WinRT] Cannot Set CarouselPage.CurrentPage Inside Constructor", PlatformAffected.WinRT)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 39489, "Memory leak when using NavigationPage with Maps", PlatformAffected.Android)]
#if UITEST
#if !__IOS__ // Temporarily disabling this test on iOS
+
+ protected override bool Isolate => true;
+
[Test]
public async Task Bugzilla39489Test()
{
[Test]
public void Bugzilla39530PanTest()
{
+ // Got to wait for the element to be visible to the UI test framework, otherwise we get occasional
+ // index out of bounds exceptions if the query for the frame and its Rect run quickly enough
+ RunningApp.WaitForElement(q => q.Marked("frame"));
AppRect frameBounds = RunningApp.Query (q => q.Marked ("frame"))[0].Rect;
RunningApp.Pan (new Drag (frameBounds, frameBounds.X + 10, frameBounds.Y + 10, frameBounds.X + 100, frameBounds.Y + 100, Drag.Direction.LeftToRight));
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 39829, "RowHeight of ListView is not working for UWP", PlatformAffected.WinRT)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 39963, "iOS WebView has wrong scrolling size when loading local html content with images")]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.BoxView)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 40333, "[Android] IllegalStateException: Recursive entry to executePendingTransactions", PlatformAffected.Android)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.ListView)]
using Xamarin.UITest;
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 40911, "NRE with Facebook Login", PlatformAffected.iOS)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 41038, "MasterDetailPage loses menu icon on iOS after reusing NavigationPage as Detail")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 41153, "jobject must not be IntPtr.Zero with TabbedPage and ToolbarItems")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 41424, "[Android] Clicking cancel on a DatePicker does not cause it to unfocus", PlatformAffected.Android)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 41842, "Set MasterDetailPage.Detail = New Page() twice will crash the application when set MasterBehavior = MasterBehavior.Split", PlatformAffected.WinRT)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 42277, "DataTemplate System.InvalidCastException crash in 2.3.1-pre1")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 44129, "Crash when adding tabbed page after removing all pages using DataTemplates")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 44166, "MasterDetailPage instances do not get disposed upon GC")]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.None, 0, "Carousel Async Add Page Issue", PlatformAffected.All, NavigationBehavior.PushModalAsync)]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.None, 0, "Device.IsInvokeRequired race condition causes crash")]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue(IssueTracker.Github, 1146, "Disabled Switch in Button Gallery not rendering on all devices", PlatformAffected.Android)]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
using System.Diagnostics;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 1691, "CarouselPage iOS CurrentPage bug")]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 181, "Color not initialized for Label", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls {
+namespace Xamarin.Forms.Controls.Issues
+{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 1891, "Modal dialog scrolls to far when focusing input boxes", PlatformAffected.iOS)]
public class Issue1891 : TestContentPage
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 198, "TabbedPage shouldn't proxy content of NavigationPage", PlatformAffected.iOS)]
RunningApp.Screenshot ("Clicked Leave");
RunningApp.WaitForElement (q => q.Marked ("Bug Repro's"));
+
+ RunningApp.ClearText(q => q.Raw("* marked:'SearchBarGo'"));
+ RunningApp.EnterText(q => q.Raw("* marked:'SearchBarGo'"), "G198");
+
RunningApp.Tap (q => q.Marked ("SearchButton"));
RunningApp.Screenshot ("Navigate into gallery again");
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 206, "ViewCell with Label's text does not resize when value is changed", PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2222, "NavigationBar.ToolbarItems.Add() crashes / breaks app in iOS7. works fine in iOS8", PlatformAffected.iOS)]
using Xamarin.UITest.Android;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2241, "ScrollView content can become stuck on orientation change (iOS)", PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 2259, "ListView.ScrollTo crashes app", PlatformAffected.iOS)]
using Xamarin.UITest.Android;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 2272, "Entry text updating set focus on the beginning of text not the end of it", PlatformAffected.Android)]
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xamarin.Forms.Controls"
- x:Class="Xamarin.Forms.Controls.Issue2289">
+ x:Class="Xamarin.Forms.Controls.Issues.Issue2289">
<local:TestContentPage.Content>
<TableView HasUnevenRows="true">
<TableView.Root>
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2289, "TextCell IsEnabled property not disabling element in TableView", PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue(IssueTracker.Github, 2354, "ListView, ImageCell and disabled source cache and same image url",PlatformAffected.iOS | PlatformAffected.Android)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 2411, "ListView.ScrollTo not working in TabbedPage", PlatformAffected.Android)]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2414, "NullReferenceException when swiping over Context Actions", PlatformAffected.WinPhone)]
[Test]
public void TestDoesntCrashShowingContextMenu ()
{
+ RunningApp.WaitForElement(c => c.Marked("Swipe ME"));
+
var screenBounds = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
- var cell = RunningApp.Query (c => c.Marked ("Swipe ME")) [0];
+ var cell = RunningApp.Query(c => c.Marked("Swipe ME")) [0];
#if __IOS__
RunningApp.DragCoordinates (screenBounds.Width - 10, cell.Rect.CenterY, 0, cell.Rect.CenterY);
//TODO: fix this when context menu bug is fixed
#endif
RunningApp.Screenshot ("Didn't crash");
RunningApp.TapCoordinates (screenBounds.CenterX, screenBounds.CenterY);
+
+#if __ANDROID__
+ RunningApp.Tap(c => c.Marked("Text0"));
+#endif
+
}
[Test]
public void TestShowContextMenuItemsInTheRightOrder ()
{
+ RunningApp.WaitForElement(c => c.Marked("Swipe ME"));
+
var screenBounds = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
var cell = RunningApp.Query (c => c.Marked ("Swipe ME")) [0];
RunningApp.WaitForElement (c => c.Marked ("Text0"));
RunningApp.Screenshot ("Are the menuitems in the right order?");
- }
+#if __ANDROID__
+ RunningApp.Tap(c => c.Marked("Text0"));
#endif
}
+#endif
+
+ }
}
<local:TestTabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xamarin.Forms.Controls"
- x:Class="Xamarin.Forms.Controls.Issue2470">
+ x:Class="Xamarin.Forms.Controls.Issues.Issue2470">
<local:TestTabbedPage.Children>
<ContentPage Title="Generate">
<StackLayout>
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
public class Issue2470ViewModelBase : INotifyPropertyChanged
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 264, "PopModal NRE", PlatformAffected.Android | PlatformAffected.iOS)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2775, "ViewCell background conflicts with ListView Semi-Transparent and Transparent backgrounds")]
<local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xamarin.Forms.Controls"
- x:Class="Xamarin.Forms.Controls.Issue2777">
+ x:Class="Xamarin.Forms.Controls.Issues.Issue2777">
<local:TestContentPage.Content>
<ListView x:Name="itemListView" IsGroupingEnabled="true" ItemTapped="OnItemTapped">
<ListView.GroupHeaderTemplate>
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2777, "When add GroupHeaderTemplate in XAML the group header does not show up")]
using Xamarin.UITest.Android;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 2809, "Secondary ToolbarItems cause app to hang during PushAsync", PlatformAffected.iOS)]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2883, "ViewCell IsEnabled set to false does not disable a cell in a TableView")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2923, "First tab does not load until navigating", PlatformAffected.WinRT)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2927, "ListView item tapped not firing multiple times")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2948, "MasterDetailPage Detail is interactive even when Master is open when in Landscape")]
}
}
+ [TearDown]
+ public void TestTearDown()
+ {
+ RunningApp.SetOrientationPortrait();
+ }
+
public bool ShouldRunTest() {
var isMasterVisible = RunningApp.Query (q => q.Marked ("Leads")).Length > 0;
return !isMasterVisible;
<?xml version="1.0" encoding="UTF-8"?>
-<controls:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:Xamarin.Forms.Controls;assembly=Xamarin.Forms.Controls" x:Name="ThePageIssue2951" x:Class="Xamarin.Forms.Controls.Issue2951">
+<controls:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:Xamarin.Forms.Controls;assembly=Xamarin.Forms.Controls" x:Name="ThePageIssue2951" x:Class="Xamarin.Forms.Controls.Issues.Issue2951">
<controls:TestContentPage.Resources>
<ResourceDictionary>
<Style x:Key="ButtonStyle" TargetType="Button">
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2951, "On Android, button background is not updated when color changes ")]
#endif
}
+}
-
-
-
- [Preserve (AllMembers = true)]
+namespace Xamarin.Forms.Controls
+{
+ [Preserve(AllMembers = true)]
public class ButtonExtensions
{
#pragma warning disable 618
- public static readonly BindableProperty IsPrimaryProperty = BindableProperty.CreateAttached<ButtonExtensions, bool> (
+ public static readonly BindableProperty IsPrimaryProperty = BindableProperty.CreateAttached<ButtonExtensions, bool>(
#pragma warning restore 618
- bindable => GetIsPrimary (bindable),
- false,
- BindingMode.TwoWay,
- null,
- null,
- null,
- null);
-
- public static bool GetIsPrimary (BindableObject bo)
+ bindable => GetIsPrimary(bindable),
+ false,
+ BindingMode.TwoWay,
+ null,
+ null,
+ null,
+ null);
+
+ public static bool GetIsPrimary(BindableObject bo)
{
- return (bool)bo.GetValue (IsPrimaryProperty);
+ return (bool)bo.GetValue(IsPrimaryProperty);
}
- public static void SetIsPrimary (BindableObject bo, bool value)
+ public static void SetIsPrimary(BindableObject bo, bool value)
{
- bo.SetValue (IsPrimaryProperty, value);
+ bo.SetValue(IsPrimaryProperty, value);
}
}
-}
+}
\ No newline at end of file
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2953, "GroupHeaderCells disappear when item is removed from a group in ListView (iOS only) ")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2954, "Cell becomes empty after adding a new one with context actions (TableView) ")]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Ignore("This test is looking for an invalid behavior; the second tap *should* keep the drawer open.")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2963, "Disabling Editor in iOS does not disable entry of text")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2964, "TabbedPage toolbar item crash")]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2965, "CarouselPage Disappearing event does not fire on Android")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2976, "Sample 'WorkingWithListviewNative' throw Exception on Xam.Android project.", PlatformAffected.Android)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2981, "Long Press on ListView causes crash")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue(IssueTracker.Github, 2983, "ListView.Footer can cause NullReferenceException", PlatformAffected.iOS)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 3276, "Crashing Unknown cell parent type on ContextAction Bindings")]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 3292, "TableSection.Title property binding fails in XAML")]
<local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xamarin.Forms.Controls"
- x:Class="Xamarin.Forms.Controls.Issue3319">
+ x:Class="Xamarin.Forms.Controls.Issues.Issue3319">
<StackLayout Orientation="Vertical">
<ListView x:Name="listView"
ItemsSource="{Binding FavoriteArticles}"
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 3319, "[iOS] Clear and adding rows exception")]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 342, "NRE when Image is not assigned source", PlatformAffected.WinPhone)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 416, "NavigationPage in PushModal does not show NavigationBar", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 417, "Navigation.PopToRootAsync does nothing", PlatformAffected.Android)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 465, "Change in Navigation.PushModal", PlatformAffected.All)]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 488, "Resizing the Label results in wrapped text being cropped on iOS", PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 530, "ListView does not render if source is async", PlatformAffected.iOS)]
using NUnit.Framework;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.None, 55555, "Header problem")]
using Xamarin.Forms.Core.UITests;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 764, "Keyboard does not dismiss on SearchBar", PlatformAffected.Android)]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 773, "Horizontal ScrollView locks after rotation", PlatformAffected.iOS)]
using Xamarin.UITest.iOS;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 774, "ActionSheet won't dismiss after rotation to landscape", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
RunningApp.WaitForNoElement (q => q.Marked ("Destroy"));
else
RunningApp.WaitForNoElement (q => q.Marked ("Dismiss"));
+
RunningApp.Screenshot ("Dismiss ActionSheet");
// App.SetOrientationPortrait ();
// App.WaitForNoElement (q => q.Marked ("Dismiss"));
}
+ else
+ {
+ RunningApp.Tap(q => q.Marked("Dismiss"));
+ }
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ RunningApp.SetOrientationPortrait();
}
#endif
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 852, "Async loading of Content causes UI element to be unclickable", PlatformAffected.Android | PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 889, "Assigning to MasterDetailPage.Detail after construction doesn't work", PlatformAffected.Android | PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
public class NavPageNameObject
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
public class Person
{
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 968, "StackLayout does not relayout on device rotation", PlatformAffected.iOS, NavigationBehavior.PushModalAsync)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
internal class PageNameObject
{
namespace Xamarin.Forms.Controls
{
-
public class GenericValueConverter : IValueConverter
{
Func<object, object> _convert;
Func<object, object> _back;
- public GenericValueConverter (Func<object, object> convert, Func<object, object> back = null)
+ public GenericValueConverter(Func<object, object> convert, Func<object, object> back = null)
{
_convert = convert;
_back = back;
}
- public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
- return _convert (value);
+ return _convert(value);
}
- public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
- return _back (value);
+ return _back(value);
}
}
+}
+namespace Xamarin.Forms.Controls.Issues
+{
[Preserve (AllMembers = true)]
public class Expense
{
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.None, 0, "StackLayout issue", PlatformAffected.All, NavigationBehavior.PushModalAsync)]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.None, 0, "Swipe back nav crash", PlatformAffected.iOS)]
using Xamarin.UITest;
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.None, 0,"TabbedPage nav tests", PlatformAffected.All)]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve (AllMembers = true)]
public class TabbedPageWithListName {
{
IApp app = null;
#if __ANDROID__
- app = ConfigureApp.Android.ApkFile (AppPaths.ApkPath).Debug ().StartApp ();
-#elif __IOS__
- app = ConfigureApp.iOS.InstalledApp (AppPaths.BundleId).Debug ()
- //Uncomment to run from a specific iOS SIM, get the ID from XCode -> Devices
- //.DeviceIdentifier("55555555-5555-5555-5555-555555555555")
- .StartApp ();
+
+ app = InitializeAndroidApp();
+
+#elif __IOS__
+
+ app = InitializeiOSApp();
#endif
if (app == null)
throw new NullReferenceException ("App was not initialized.");
return new ScreenshotConditionalApp(app);
}
- static void NavigateToIssue (Type type, IApp app)
+#if __ANDROID__
+ static IApp InitializeAndroidApp()
+ {
+ return ConfigureApp.Android.ApkFile(AppPaths.ApkPath).Debug().StartApp();
+ }
+#endif
+
+#if __IOS__
+ static IApp InitializeiOSApp()
+ {
+ // Running on a device
+ var app = ConfigureApp.iOS.InstalledApp(AppPaths.BundleId).Debug()
+ //Uncomment to run from a specific iOS SIM, get the ID from XCode -> Devices
+ .StartApp();
+
+ // Running on the simulator
+ //var app = ConfigureApp.iOS
+ // .PreferIdeSettings()
+ // .AppBundle("../../../Xamarin.Forms.ControlGallery.iOS/bin/iPhoneSimulator/Debug/XamarinFormsControlGalleryiOS.app")
+ // .Debug()
+ // .StartApp();
+
+ return app;
+ }
+#endif
+
+ public static void NavigateToIssue (Type type, IApp app)
{
var typeIssueAttribute = type.GetTypeInfo ().GetCustomAttribute <IssueAttribute> ();
cellName = typeIssueAttribute.Description;
}
+ try
+ {
+ // Attempt the direct way of navigating to the test page
+#if __ANDROID__
+
+ if (bool.Parse((string)app.Invoke("NavigateToTest", cellName)))
+ {
+ return;
+ }
+#endif
+#if __IOS__
+ if (bool.Parse(app.Invoke("navigateToTest:", cellName).ToString()))
+ {
+ return;
+ }
+#endif
+ }
+ catch (Exception ex)
+ {
+ System.Diagnostics.Debug.WriteLine($"Could not directly invoke test, using UI navigation. {ex}");
+ }
+
+ // Fall back to the "manual" navigation method
app.Tap (q => q.Button ("Go to Test Cases"));
app.WaitForElement (q => q.Raw ("* marked:'TestCasesIssueList'"));
return runningApp;
}
+
+ // Make sure the server on the device is still up and running;
+ // if not, restart the app
+ public static void EnsureConnection()
+ {
+ if (RunningApp != null)
+ {
+ try
+ {
+ RunningApp.TestServer.Get("version");
+ return;
+ }
+ catch (Exception ex)
+ {
+ }
+
+ RunningApp = InitializeApp();
+ }
+ }
+
+ static int s_testsrun;
+ const int ConsecutiveTestLimit = 40;
+
+ // Until we get more of our memory leak issues worked out, restart the app
+ // after a specified number of tests so we don't get bogged down in GC
+ public static void EnsureMemory()
+ {
+ if (RunningApp != null)
+ {
+ s_testsrun += 1;
+
+ if (s_testsrun >= ConsecutiveTestLimit)
+ {
+ s_testsrun = 0;
+ RunningApp = InitializeApp();
+ }
+ }
+ }
+
+ // For tests which just don't play well with others, we can ensure
+ // that they run in their own instance of the application
+ public static void BeginIsolate()
+ {
+ if (RunningApp != null && s_testsrun > 0)
+ {
+ s_testsrun = 0;
+ RunningApp = InitializeApp();
+ }
+ }
+
+ public static void EndIsolate()
+ {
+ s_testsrun = ConsecutiveTestLimit;
+ }
+
+ public static IApp RunningApp { get; set; }
}
#endif
public abstract class TestPage : Page
{
#if UITEST
- public IApp RunningApp { get; private set; }
+ public IApp RunningApp => AppSetup.RunningApp;
+
+ protected virtual bool Isolate => false;
#endif
protected TestPage ()
#if UITEST
[SetUp]
- public void Setup ()
+ public void Setup()
{
- RunningApp = AppSetup.Setup (GetType ());
+ if (Isolate)
+ {
+ AppSetup.BeginIsolate();
+ }
+ else
+ {
+ AppSetup.EnsureMemory();
+ AppSetup.EnsureConnection();
+ }
+
+ AppSetup.NavigateToIssue(GetType(), RunningApp);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Isolate)
+ {
+ AppSetup.EndIsolate();
+ }
}
#endif
public abstract class TestContentPage : ContentPage
{
#if UITEST
- public IApp RunningApp { get; private set; }
+ public IApp RunningApp => AppSetup.RunningApp;
+
+ protected virtual bool Isolate => false;
#endif
protected TestContentPage ()
[SetUp]
public void Setup ()
{
- RunningApp = AppSetup.Setup (GetType ());
+ if (Isolate)
+ {
+ AppSetup.BeginIsolate();
+ }
+ else
+ {
+ AppSetup.EnsureMemory();
+ AppSetup.EnsureConnection();
+ }
+
+ AppSetup.NavigateToIssue(GetType(), RunningApp);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Isolate)
+ {
+ AppSetup.EndIsolate();
+ }
}
#endif
public abstract class TestCarouselPage : CarouselPage
{
#if UITEST
- public IApp RunningApp { get; private set; }
+ public IApp RunningApp => AppSetup.RunningApp;
+
+ protected virtual bool Isolate => false;
#endif
protected TestCarouselPage ()
#if UITEST
[SetUp]
- public void Setup ()
+ public void Setup()
{
- RunningApp = AppSetup.Setup (GetType ());
+ if (Isolate)
+ {
+ AppSetup.BeginIsolate();
+ }
+ else
+ {
+ AppSetup.EnsureMemory();
+ AppSetup.EnsureConnection();
+ }
+
+ AppSetup.NavigateToIssue(GetType(), RunningApp);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Isolate)
+ {
+ AppSetup.EndIsolate();
+ }
}
#endif
public abstract class TestMasterDetailPage : MasterDetailPage
{
#if UITEST
- public IApp RunningApp { get; private set; }
+ public IApp RunningApp => AppSetup.RunningApp;
+
+ protected virtual bool Isolate => false;
#endif
protected TestMasterDetailPage ()
#if UITEST
[SetUp]
- public void Setup ()
+ public void Setup()
{
- RunningApp = AppSetup.Setup (GetType ());
+ if (Isolate)
+ {
+ AppSetup.BeginIsolate();
+ }
+ else
+ {
+ AppSetup.EnsureMemory();
+ AppSetup.EnsureConnection();
+ }
+
+ AppSetup.NavigateToIssue(GetType(), RunningApp);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Isolate)
+ {
+ AppSetup.EndIsolate();
+ }
}
#endif
public abstract class TestNavigationPage : NavigationPage
{
#if UITEST
- public IApp RunningApp { get; private set; }
+ public IApp RunningApp => AppSetup.RunningApp;
+
+ protected virtual bool Isolate => false;
#endif
protected TestNavigationPage ()
#if UITEST
[SetUp]
- public void Setup ()
+ public void Setup()
{
- RunningApp = AppSetup.Setup (GetType ());
+ if (Isolate)
+ {
+ AppSetup.BeginIsolate();
+ }
+ else
+ {
+ AppSetup.EnsureMemory();
+ AppSetup.EnsureConnection();
+ }
+
+ AppSetup.NavigateToIssue(GetType(), RunningApp);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Isolate)
+ {
+ AppSetup.EndIsolate();
+ }
}
#endif
public abstract class TestTabbedPage : TabbedPage
{
#if UITEST
- public IApp RunningApp { get; private set; }
+ public IApp RunningApp => AppSetup.RunningApp;
+
+ protected virtual bool Isolate => false;
#endif
protected TestTabbedPage ()
#if UITEST
[SetUp]
- public void Setup ()
+ public void Setup()
{
- RunningApp = AppSetup.Setup (GetType ());
+ if (Isolate)
+ {
+ AppSetup.BeginIsolate();
+ }
+ else
+ {
+ AppSetup.EnsureMemory();
+ AppSetup.EnsureConnection();
+ }
+
+ AppSetup.NavigateToIssue(GetType(), RunningApp);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Isolate)
+ {
+ AppSetup.EndIsolate();
+ }
}
#endif
protected abstract void Init ();
}
}
+
+#if UITEST
+namespace Xamarin.Forms.Controls.Issues
+{
+ using System;
+ using NUnit.Framework;
+
+ // Run setup once for all tests in the Xamarin.Forms.Controls.Issues namespace
+ // (instead of once for each test)
+ [SetUpFixture]
+ public class IssuesSetup
+ {
+ [SetUp]
+ public void RunBeforeAnyTests()
+ {
+ AppSetup.RunningApp = AppSetup.Setup(null);
+ }
+ }
+}
+#endif
[assembly: NUnit.Framework.Category("Issues")]
#endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 1, "Issue Description", PlatformAffected.Default)]
static Dictionary<string, string> s_config;
readonly ITestCloudService _testCloudService;
+ public const string DefaultMainPageId = "ControlGalleryMainPage";
+
public App()
{
_testCloudService = DependencyService.Get<ITestCloudService>();
InitInsights();
- MainPage = new MasterDetailPage
- {
- Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
- Detail = CoreGallery.GetMainPage()
- };
+ SetMainPage(CreateDefaultMainPage());
//// Uncomment to verify that there is no gray screen displayed between the blue splash and red MasterDetailPage.
//MainPage = new Bugzilla44596SplashPage(() =>
//});
}
+ public Page CreateDefaultMainPage()
+ {
+ return new MasterDetailPage
+ {
+ AutomationId = DefaultMainPageId,
+ Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
+ Detail = CoreGallery.GetMainPage()
+ };
+ }
+
protected override void OnAppLinkRequestReceived(Uri uri)
{
var appDomain = "http://" + AppName.ToLowerInvariant() + "/";
text = await reader.ReadToEndAsync();
return text;
}
+
+ public bool NavigateToTestPage(string test)
+ {
+ try
+ {
+ // Create an instance of the main page
+ var root = CreateDefaultMainPage();
+
+ // Set up a delegate to handle the navigation to the test page
+ EventHandler toTestPage = null;
+
+ toTestPage = delegate(object sender, EventArgs e)
+ {
+ Current.MainPage.Navigation.PushModalAsync(TestCases.GetTestCases());
+ TestCases.TestCaseScreen.PageToAction[test]();
+ Current.MainPage.Appearing -= toTestPage;
+ };
+
+ // And set that delegate to run once the main page appears
+ root.Appearing += toTestPage;
+
+ SetMainPage(root);
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Log.Warning("UITests", $"Error attempting to navigate directly to {test}: {ex}");
+
+ }
+
+ return false;
+ }
+
+ public void Reset()
+ {
+ SetMainPage(CreateDefaultMainPage());
+ }
}
}
\ No newline at end of file
{
page.Appearing += (object sender, EventArgs e) => {
_isAppearingFired++;
- App.AppearingMessages.Add ($"Appearing {page.Title}");
+ App.AppearingMessages.Insert (0, $"Appearing {page.Title}");
Debug.WriteLine ($"Appearing {page.Title}");
};
page.Disappearing += (object sender, EventArgs e) => {
_isDisappearingFired++;
- App.AppearingMessages.Add ($"Disappearing {page.Title}");
+ App.AppearingMessages.Insert (0, $"Disappearing {page.Title}");
Debug.WriteLine( $"Disappearing {page.Title}");
};
}
using System;
+using Xamarin.Forms.Controls.Issues;
namespace Xamarin.Forms.Controls
{
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
- <Reference Include="Xamarin.UITest">
- <HintPath>..\packages\Xamarin.UITest.2.0.0-beta05\lib\Xamarin.UITest.dll</HintPath>
+ <Reference Include="Xamarin.UITest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll</HintPath>
+ <Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
- <package id="Xamarin.UITest" version="2.0.0-beta05" targetFramework="net45" />
+ <package id="Xamarin.UITest" version="2.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
- <Reference Include="Xamarin.UITest">
- <HintPath>..\packages\Xamarin.UITest.2.0.0-beta05\lib\Xamarin.UITest.dll</HintPath>
+ <Reference Include="Xamarin.UITest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll</HintPath>
+ <Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
- <package id="Xamarin.UITest" version="2.0.0-beta05" targetFramework="net45" />
+ <package id="Xamarin.UITest" version="2.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
{
// TODO: Landscape tests
- public static IApp App { get; private set; }
+ public static IApp App { get; set; }
public string PlatformViewType { get; protected set; }
- public bool ShouldResetPerFixture { get; protected set; }
- public AppRect ScreenBounds { get; private set; }
+ public static AppRect ScreenBounds { get; set; }
- protected BaseTestFixture()
+ [TestFixtureTearDown]
+ protected virtual void FixtureTeardown()
{
- ShouldResetPerFixture = true;
}
- protected abstract void NavigateToGallery();
+ static int s_testsrun;
+ const int ConsecutiveTestLimit = 40;
-#pragma warning disable 618
- [TestFixtureSetUp]
-#pragma warning restore 618
- protected virtual void FixtureSetup()
+ // Until we get more of our memory leak issues worked out, restart the app
+ // after a specified number of tests so we don't get bogged down in GC
+ public void EnsureMemory()
{
- try
- {
- if (ShouldResetPerFixture)
- {
- RelaunchApp();
- }
- }
- catch (Exception ex)
+ s_testsrun += 1;
+
+ if (s_testsrun >= ConsecutiveTestLimit)
{
- Debug.WriteLine(ex);
- throw;
- }
- }
+ s_testsrun = 0;
-#pragma warning disable 618
- [TestFixtureTearDown]
-#pragma warning restore 618
- protected virtual void FixtureTeardown()
- {
+ CoreUITestsSetup.LaunchApp();
+
+ FixtureSetup();
+ }
}
[SetUp]
protected virtual void TestSetup()
{
- if (!ShouldResetPerFixture)
- {
-
- RelaunchApp();
- }
+ EnsureMemory();
}
[TearDown]
protected virtual void TestTearDown()
{
-
}
- void RelaunchApp()
+ protected abstract void NavigateToGallery();
+
+#pragma warning disable 618
+ [TestFixtureSetUp]
+#pragma warning restore 618
+ protected virtual void FixtureSetup()
{
- App = null;
- App = AppSetup.Setup();
- App.SetOrientationPortrait();
- ScreenBounds = App.RootViewRect();
+ ResetApp();
NavigateToGallery();
}
+
+ protected void ResetApp()
+ {
+#if __IOS__
+ App.Invoke("reset:", string.Empty);
+#endif
+#if __ANDROID__
+ App.Invoke("Reset");
+#endif
+ }
+ }
+}
+
+#if UITEST
+namespace Xamarin.Forms.Core.UITests
+{
+ using NUnit.Framework;
+
+ [SetUpFixture]
+ public class CoreUITestsSetup
+ {
+ [SetUp]
+ public void RunBeforeAnyTests()
+ {
+ LaunchApp();
+ }
+
+ public static void LaunchApp()
+ {
+ BaseTestFixture.App = null;
+ BaseTestFixture.App = AppSetup.Setup();
+
+ BaseTestFixture.App.SetOrientationPortrait();
+ BaseTestFixture.ScreenBounds = BaseTestFixture.App.RootViewRect();
+ }
}
}
+#endif
[Category(UITestCategories.LifeCycle)]
internal class AppearingUITests : BaseTestFixture
{
- public AppearingUITests ()
+ public AppearingUITests()
{
- ShouldResetPerFixture = false;
}
protected override void NavigateToGallery ()
App.NavigateToGallery (GalleryQueries.AppearingGallery);
}
+ protected override void TestTearDown()
+ {
+ base.TestTearDown();
+ ResetApp();
+ NavigateToGallery();
+ }
+
[Test]
public void AppearingNavigationPage ()
{
public ContextActionsListUITests ()
{
- ShouldResetPerFixture = false;
}
protected override void NavigateToGallery ()
public void ContextActionsDelete ()
{
// mark is an icon on android
- App.TouchAndHold (q => q.Marked (cell0));
+ App.TouchAndHold (q => q.Marked (cell1));
App.WaitForElement (q => q.Marked (delete));
App.Screenshot ("I have actions!");
App.Tap (q => q.Marked (delete));
- App.WaitForNoElement (q => q.Marked (cell0));
+ App.WaitForNoElement (q => q.Marked (cell1));
App.Screenshot ("Deleted cell 0");
}
#endif
{
public ContextActionsTableUITests ()
{
- ShouldResetPerFixture = false;
}
protected override void NavigateToGallery ()
{
public UnevenListTests ()
{
- ShouldResetPerFixture = false;
}
protected override void NavigateToGallery ()
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
- <Reference Include="Xamarin.UITest">
- <HintPath>..\packages\Xamarin.UITest.2.0.0-beta05\lib\Xamarin.UITest.dll</HintPath>
+ <Reference Include="Xamarin.UITest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll</HintPath>
+ <Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
- <package id="Xamarin.UITest" version="2.0.0-beta05" targetFramework="net45" />
+ <package id="Xamarin.UITest" version="2.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+
using System.Threading.Tasks;
using Xamarin.Forms.Platform;
public override void ViewDidDisappear(bool animated)
{
base.ViewDidDisappear(animated);
- PageController.SendDisappearing();
+ PageController?.SendDisappearing();
}
public override void ViewDidLayoutSubviews()
public override void ViewDidDisappear(bool animated)
{
base.ViewDidDisappear(animated);
- PageController.SendDisappearing();
+ PageController?.SendDisappearing();
}
public override void ViewDidLayoutSubviews()