diff options
Diffstat (limited to 'Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs')
-rw-r--r-- | Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs new file mode 100644 index 00000000..7746bafa --- /dev/null +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs @@ -0,0 +1,73 @@ +using NUnit.Framework; +using Xamarin.UITest; +using System; +using System.Threading; +using Xamarin.UITest.Queries; + +namespace Xamarin.Forms.Core.UITests +{ + [TestFixture] + [Category ("AutomationID")] + internal class AutomationIDUITests : BaseTestFixture + { + protected override void NavigateToGallery () + { + App.NavigateToGallery (GalleryQueries.AutomationIDGallery); + } + + [Test] + public void Test1 () + { + App.Tap (c => c.Marked ("btnTest1")); + App.WaitForElement (c => c.Marked ("scrollMain")); + App.WaitForElement (c => c.Marked ("stckMain")); + App.WaitForElement (c => c.Marked ("actHello")); + App.WaitForElement (c => c.Marked ("bxvHello")); + App.Tap (c => c.Marked ("btnHello")); + App.WaitForElement (c => c.Marked ("dtPicker")); + App.WaitForElement (c => c.Marked ("tPicker")); + + var label = App.Query ("lblHello") [0]; + Assert.AreEqual (label.Text, "Hello Label"); + + var editor = App.Query ("editorHello") [0]; + Assert.AreEqual (editor.Text, "Hello Editor"); + + var entry = App.Query ("entryHello") [0]; + Assert.AreEqual (entry.Text, "Hello Entry"); + + App.Tap (c => c.Marked ("popModal")); + } + + + [Test] + public void Test2 () + { + App.Tap (c => c.Marked ("btnTest2")); + App.WaitForElement (c => c.Marked ("imgHello")); + App.WaitForElement (c => c.Marked ("lstView")); + App.WaitForElement (c => c.Marked ("pickerHello")); + App.WaitForElement (c => c.Marked ("progressHello")); + App.ScrollDownTo (c => c.Marked ("progressHello")); + App.WaitForElement (c => c.Marked ("srbHello")); + App.WaitForElement (c => c.Marked ("sliHello")); + App.WaitForElement (c => c.Marked ("stepperHello")); + App.WaitForElement (c => c.Marked ("switchHello")); + //App.WaitForElement (c => c.Marked ("webviewHello")); + App.Tap (c => c.Marked ("popModal")); + } + + [Test] + [Ignore("only works on ios")] + public void TestToolbarItem () + { + App.Tap (c => c.Marked ("tbItemHello")); + App.WaitForElement (x => x.Marked ("Hello")); + App.Tap (c => c.Marked ("ok")); + App.Tap (c => c.Marked ("tbItemHello2")); + App.WaitForElement (x => x.Marked ("Hello2")); + App.Tap (c => c.Marked ("ok")); + } + } +} + |