summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests/Tests
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2016-10-03 23:45:57 (GMT)
committerGitHub <noreply@github.com>2016-10-03 23:45:57 (GMT)
commitb645064d939201a7df7cc67917b4c31c450a7a89 (patch)
tree6699bcfe7c88a35a094b06d65bd584a8f7b79723 /Xamarin.Forms.Core.iOS.UITests/Tests
parent5372d216df44bf09a160cfd9649ce97776ed343d (diff)
downloadxamarin-forms-b645064d939201a7df7cc67917b4c31c450a7a89.zip
xamarin-forms-b645064d939201a7df7cc67917b4c31c450a7a89.tar.gz
xamarin-forms-b645064d939201a7df7cc67917b4c31c450a7a89.tar.bz2
Fix tests on IOS10 [Do not merge] (#373)
* [UITests] Update packages * [UITests] Fix formatting * [UITests] Fix tests * Add badges * Update Android csproj * fix
Diffstat (limited to 'Xamarin.Forms.Core.iOS.UITests/Tests')
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs274
1 files changed, 139 insertions, 135 deletions
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs
index d143b41..4710c33 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
-
+using System.Threading.Tasks;
using NUnit.Framework;
using Xamarin.Forms.CustomAttributes;
@@ -13,250 +13,254 @@ using Xamarin.UITest.Queries;
namespace Xamarin.Forms.Core.UITests
{
[TestFixture]
- [Category ("Cells")]
+ [Category("Cells")]
internal class CellsGalleryTests : BaseTestFixture
{
// TODO find a way to test individula elements of cells
// TODO port to new framework
- protected override void NavigateToGallery ()
+ protected override void NavigateToGallery()
{
- App.NavigateToGallery (GalleryQueries.CellsGalleryLegacy);
+ App.NavigateToGallery(GalleryQueries.CellsGalleryLegacy);
}
[Test]
- [Description ("ListView with TextCells, all are present")]
- [UiTest (typeof(ListView))]
- [UiTest (typeof(TextCell))]
- public void CellsGalleryTextCellList ()
+ [Description("ListView with TextCells, all are present")]
+ [UiTest(typeof(ListView))]
+ [UiTest(typeof(TextCell))]
+ public void CellsGalleryTextCellList()
{
- App.ScrollForElement ("* marked:'TextCell List'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("TextCell List"));
- App.WaitForElement (q => q.Marked ("Text 0"), "Timeout : Text 0");
+ App.ScrollForElement("* marked:'TextCell List'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.Tap(q => q.Marked("TextCell List"));
+ App.WaitForElement(q => q.Marked("Text 0"), "Timeout : Text 0");
- App.Screenshot ("At TextCell List Gallery");
+ App.Screenshot("At TextCell List Gallery");
- App.ScrollForElement ("* marked:'Detail 99'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'Detail 99'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.WaitForElement (q => q.Marked ("Detail 99"), "Timeout : Detail 99");
+ App.WaitForElement(q => q.Marked("Detail 99"), "Timeout : Detail 99");
- App.Screenshot ("All TextCells are present");
+ App.Screenshot("All TextCells are present");
}
[Test]
- [Description ("TableView with TextCells, all are present")]
- [UiTest (typeof(TableView))]
- [UiTest (typeof(TextCell))]
- public void CellsGalleryTextCellTable ()
+ [Description("TableView with TextCells, all are present")]
+ [UiTest(typeof(TableView))]
+ [UiTest(typeof(TextCell))]
+ public void CellsGalleryTextCellTable()
{
- App.ScrollForElement ("* marked:'TextCell Table'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'TextCell Table'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("TextCell Table"));
- App.WaitForElement (q => q.Marked ("Text 1"), "Timeout : Text 1");
+ App.Tap(q => q.Marked("TextCell Table"));
+ App.WaitForElement(q => q.Marked("Text 1"), "Timeout : Text 1");
- App.Screenshot ("At TextCell Table Gallery");
+ App.Screenshot("At TextCell Table Gallery");
- App.ScrollForElement ("* marked:'Detail 12'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'Detail 12'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.WaitForElement (q => q.Marked ("Detail 12"), "Timeout : Detail 12");
+ App.WaitForElement(q => q.Marked("Detail 12"), "Timeout : Detail 12");
- App.Screenshot ("All TextCells are present");
+ App.Screenshot("All TextCells are present");
}
[Test]
- [Description ("ListView with ImageCells, all are present")]
- [UiTest (typeof(ListView))]
- [UiTest (typeof(ImageCell))]
- public void CellsGalleryImageCellList ()
+ [Description("ListView with ImageCells, all are present")]
+ [UiTest(typeof(ListView))]
+ [UiTest(typeof(ImageCell))]
+ public void CellsGalleryImageCellList()
{
- Thread.Sleep (2000);
+ Thread.Sleep(2000);
- App.ScrollForElement ("* marked:'ImageCell List'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'ImageCell List'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- Thread.Sleep (2000);
+ Thread.Sleep(2000);
- App.Tap (q => q.Marked ("ImageCell List"));
- App.WaitForElement (q => q.Marked ("Text 0"), "Timeout : Text 0");
+ App.Tap(q => q.Marked("ImageCell List"));
+ App.WaitForElement(q => q.Marked("Text 0"), "Timeout : Text 0");
- App.Screenshot ("At ImageCell List Gallery");
+ App.Screenshot("At ImageCell List Gallery");
- var scollBounds = App.Query (q => q.Marked ("ImageCellListView")).First ().Rect;
- App.ScrollForElement ("* marked:'Detail 99'", new Drag (scollBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ var scollBounds = App.Query(q => q.Marked("ImageCellListView")).First().Rect;
+ App.ScrollForElement("* marked:'Detail 99'", new Drag(scollBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.WaitForElement (q => q.Marked ("Detail 99"), "Timeout : Detail 99");
+ App.WaitForElement(q => q.Marked("Detail 99"), "Timeout : Detail 99");
- App.Screenshot ("All ImageCells are present");
+ App.Screenshot("All ImageCells are present");
- var numberOfImages = App.Query (q => q.Raw (PlatformViews.Image)).Length;
+ var numberOfImages = App.Query(q => q.Raw(PlatformViews.Image)).Length;
// Check that there are images present. In Android,
// have to make sure that there are more than 2 for navigation.
- Assert.IsTrue (numberOfImages > 2);
+ Assert.IsTrue(numberOfImages > 2);
- App.Screenshot ("Images are present");
+ App.Screenshot("Images are present");
}
[Test]
- [Description ("ListView with ImageCells, file access problems")]
- [UiTest (typeof(ListView))]
- [UiTest (typeof(ImageCell))]
- public void CellsGalleryImageUrlCellList ()
+ [Description("ListView with ImageCells, file access problems")]
+ [UiTest(typeof(ListView))]
+ [UiTest(typeof(ImageCell))]
+ public async Task CellsGalleryImageUrlCellList()
{
-
- App.ScrollForElement ("* marked:'ImageCell Url List'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("ImageCell Url List"));
-
- var scollBounds = App.Query (q => q.Marked ("ImageUrlCellListView")).First ().Rect;
- App.ScrollForElement ("* marked:'Detail 200'", new Drag (scollBounds, Drag.Direction.BottomToTop, Drag.DragLength.Long), 40);
+ App.ScrollForElement("* marked:'ImageCell Url List'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+
+ App.Tap(q => q.Marked("ImageCell Url List"));
- App.WaitForElement (q => q.Marked ("Detail 200"), "Timeout : Detail 200");
+ //var scollBounds = App.Query(q => q.Marked("ImageUrlCellListView")).First().Rect;
+ //App.ScrollForElement("* marked:'Detail 200'", new Drag(scollBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ //App.ScrollUp();
+ //App.WaitForElement(q => q.Marked("Detail 200"), "Timeout : Detail 200");
- App.Screenshot ("All ImageCells are present");
+ App.Screenshot("All ImageCells are present");
- var numberOfImages = App.Query (q => q.Raw (PlatformViews.Image)).Length;
+ await Task.Delay(1000);
+ var numberOfImages = App.Query(q => q.Raw(PlatformViews.Image)).Length;
// Check that there are images present. In Android,
// have to make sure that there are more than 2 for navigation.
- Assert.IsTrue (numberOfImages > 2);
+ Assert.IsTrue(numberOfImages > 2);
- App.Screenshot ("Images are present");
+ App.Screenshot("Images are present");
}
-
+
[Test]
- [Description ("TableView with ImageCells, all are present")]
- [UiTest (typeof(TableView))]
- [UiTest (typeof(ImageCell))]
- public void CellsGalleryImageCellTable ()
+ [Description("TableView with ImageCells, all are present")]
+ [UiTest(typeof(TableView))]
+ [UiTest(typeof(ImageCell))]
+ public void CellsGalleryImageCellTable()
{
- App.ScrollForElement ("* marked:'ImageCell Table'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'ImageCell Table'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("ImageCell Table"));
- App.WaitForElement (q => q.Marked ("Text 1"), "Timeout : Text 1");
+ App.Tap(q => q.Marked("ImageCell Table"));
+ App.WaitForElement(q => q.Marked("Text 1"), "Timeout : Text 1");
- App.Screenshot ("At ImageCell Table Gallery");
+ App.Screenshot("At ImageCell Table Gallery");
- App.ScrollForElement ("* marked:'Detail 12'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'Detail 12'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.WaitForElement (q => q.Marked ("Detail 12"), "Timeout : Detail 12");
+ App.WaitForElement(q => q.Marked("Detail 12"), "Timeout : Detail 12");
- App.Screenshot ("All ImageCells are present");
+ App.Screenshot("All ImageCells are present");
- var numberOfImages = App.Query (q => q.Raw (PlatformViews.Image)).Length;
+ var numberOfImages = App.Query(q => q.Raw(PlatformViews.Image)).Length;
// Check that there are images present. In Android,
// have to make sure that there are more than 2 for navigation.
- Assert.IsTrue (numberOfImages > 2);
+ Assert.IsTrue(numberOfImages > 2);
- App.Screenshot ("Images are present");
+ App.Screenshot("Images are present");
}
[Test]
- [Description ("ListView with SwitchCells, all are present")]
- [UiTest (typeof(ListView))]
- [UiTest (typeof(SwitchCell))]
- public void CellsGallerySwitchCellList ()
+ [Description("ListView with SwitchCells, all are present")]
+ [UiTest(typeof(ListView))]
+ [UiTest(typeof(SwitchCell))]
+ public void CellsGallerySwitchCellList()
{
- App.ScrollForElement ("* marked:'SwitchCell List'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'SwitchCell List'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("SwitchCell List"));
- App.WaitForElement (q => q.Marked ("Label 0"), "Timeout : Label 0");
+ App.Tap(q => q.Marked("SwitchCell List"));
+ App.WaitForElement(q => q.Marked("Label 0"), "Timeout : Label 0");
- App.Screenshot ("At SwitchCell List Gallery");
+ App.Screenshot("At SwitchCell List Gallery");
- App.ScrollForElement ("* marked:'Label 99'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'Label 99'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- var numberOfSwitches = App.Query (q => q.Raw (PlatformViews.Switch)).Length;
- Assert.IsTrue (numberOfSwitches > 2);
+ var numberOfSwitches = App.Query(q => q.Raw(PlatformViews.Switch)).Length;
+ Assert.IsTrue(numberOfSwitches > 2);
- App.Screenshot ("Switches are present");
+ App.Screenshot("Switches are present");
}
[Test]
- [Description ("TableView with SwitchCells, all are present")]
- [UiTest (typeof(TableView))]
- [UiTest (typeof(SwitchCell))]
- public void CellsGallerySwitchCellTable ()
+ [Description("TableView with SwitchCells, all are present")]
+ [UiTest(typeof(TableView))]
+ [UiTest(typeof(SwitchCell))]
+ public void CellsGallerySwitchCellTable()
{
- App.ScrollForElement ("* marked:'SwitchCell Table'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'SwitchCell Table'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("SwitchCell Table"));
- App.WaitForElement (q => q.Marked ("text 1"), "Timeout : text 1");
+ App.Tap(q => q.Marked("SwitchCell Table"));
+ App.WaitForElement(q => q.Marked("text 1"), "Timeout : text 1");
- App.Screenshot ("At SwitchCell Table Gallery");
+ App.Screenshot("At SwitchCell Table Gallery");
- App.ScrollForElement ("* marked:'text 32'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'text 32'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- var numberOfSwitches = App.Query (q => q.Raw (PlatformViews.Switch)).Length;
- Assert.IsTrue (numberOfSwitches > 2);
+ var numberOfSwitches = App.Query(q => q.Raw(PlatformViews.Switch)).Length;
+ Assert.IsTrue(numberOfSwitches > 2);
- App.Screenshot ("Switches are present");
+ App.Screenshot("Switches are present");
}
[Test]
- [Description ("ListView with EntryCells, all are present")]
- [UiTest (typeof(ListView))]
- [UiTest (typeof(EntryCell))]
- public void CellsGalleryEntryCellList ()
+ [Description("ListView with EntryCells, all are present")]
+ [UiTest(typeof(ListView))]
+ [UiTest(typeof(EntryCell))]
+ public void CellsGalleryEntryCellList()
{
- App.ScrollForElement ("* marked:'EntryCell List'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'EntryCell List'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("EntryCell List"));
- App.WaitForElement (q => q.Marked ("Label 0"), "Timeout : Label 0");
+ App.Tap(q => q.Marked("EntryCell List"));
+ App.WaitForElement(q => q.Marked("Label 0"), "Timeout : Label 0");
- App.Screenshot ("At EntryCell List Gallery");
+ App.Screenshot("At EntryCell List Gallery");
- App.ScrollForElement ("* marked:'Label 99'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'Label 99'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Screenshot ("All EntryCells are present");
+ App.Screenshot("All EntryCells are present");
}
-
+
[Test]
- [Description ("TableView with EntryCells, all are present")]
- [UiTest (typeof(TableView))]
- [UiTest (typeof(EntryCell))]
- public void CellsGalleryEntryCellTable ()
+ [Description("TableView with EntryCells, all are present")]
+ [UiTest(typeof(TableView))]
+ [UiTest(typeof(EntryCell))]
+ public void CellsGalleryEntryCellTable()
{
- App.ScrollForElement ("* marked:'EntryCell Table'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'EntryCell Table'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Tap (q => q.Marked ("EntryCell Table"));
- App.WaitForElement (q => q.Marked ("Text 2"), "Timeout : Text 2");
+ App.Tap(q => q.Marked("EntryCell Table"));
+ App.WaitForElement(q => q.Marked("Text 2"), "Timeout : Text 2");
- App.Screenshot ("At EntryCell Table Gallery");
+ App.Screenshot("At EntryCell Table Gallery");
- App.ScrollForElement ("* marked:'Text 32'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'Text 32'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Screenshot ("All EntryCells are present");
+ App.Screenshot("All EntryCells are present");
}
[Test]
- [Category ("EntryCell")]
- [Description ("EntryCell fires .Completed event")]
- [UiTest (typeof(EntryCell), "Completed")]
- public void CellsGalleryEntryCellCompleted ()
+ [Category("EntryCell")]
+ [Description("EntryCell fires .Completed event")]
+ [UiTest(typeof(EntryCell), "Completed")]
+ public void CellsGalleryEntryCellCompleted()
{
- App.ScrollForElement ("* marked:'EntryCell Table'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.ScrollForElement("* marked:'EntryCell Table'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+
+ App.Tap(q => q.Marked("EntryCell Table"));
+ App.WaitForElement(q => q.Marked("Text 2"), "Timeout : Text 2");
- App.Tap (q => q.Marked ("EntryCell Table"));
- App.WaitForElement (q => q.Marked ("Text 2"), "Timeout : Text 2");
+ App.Screenshot("At EntryCell Table Gallery");
+ App.ScrollForElement("* marked:'Enter text'", new Drag(ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
- App.Screenshot ("At EntryCell Table Gallery");
- App.ScrollForElement ("* marked:'Enter text'", new Drag (ScreenBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium));
+ App.Screenshot("Before clicking Entry");
- App.Screenshot ("Before clicking Entry");
+#if !__IOS__
+ App.Tap(PlatformQueries.EntryCellWithPlaceholder("I am a placeholder"));
+ App.EnterText(PlatformQueries.EntryCellWithPlaceholder("I am a placeholder"), "Hi");
+ App.Screenshot("Entered Text");
+ App.PressEnter();
- App.Tap (PlatformQueries.EntryCellWithPlaceholder ("I am a placeholder"));
- App.EnterText (PlatformQueries.EntryCellWithPlaceholder ("I am a placeholder"), "Hi");
- App.Screenshot ("Entered Text");
- App.PressEnter ();
+ App.WaitForElement(q => q.Marked("Entered: 1"));
+ App.Screenshot("Completed should have changed label's text");
- App.WaitForElement (q => q.Marked ("Entered: 1"));
- App.Screenshot ("Completed should have changed label's text");
+#endif
}
protected override void TestTearDown()
{
- App.NavigateBack ();
+ App.NavigateBack();
base.TestTearDown();
}
}