public void Bugzilla34632Test() { var app = RunningApp as iOSApp; if (app != null && app.Device.IsTablet) { RunningApp.SetOrientationPortrait(); RunningApp.Tap(q => q.Marked("btnModal")); RunningApp.SetOrientationLandscape(); RunningApp.Tap(q => q.Marked("btnDismissModal")); RunningApp.Tap(q => q.Marked("btnModal")); RunningApp.SetOrientationPortrait(); RunningApp.Tap(q => q.Marked("btnDismissModal")); RunningApp.Tap(q => q.Marked("btnMaster")); } }
public void Bugzilla31602Test() { var appAs = RunningApp as iOSApp; if (appAs != null && appAs.Device.IsTablet) { RunningApp.Tap(q => q.Marked("Sidemenu Opener")); RunningApp.WaitForElement(q => q.Marked("SideMenu")); RunningApp.SetOrientationLandscape(); RunningApp.WaitForElement(q => q.Marked("SideMenu")); RunningApp.SetOrientationPortrait(); RunningApp.WaitForNoElement(q => q.Marked("SideMenu")); RunningApp.Tap(q => q.Marked("Sidemenu Opener")); RunningApp.WaitForElement(q => q.Marked("SideMenu")); } }
public void Issue774TestsDismissActionSheetAfterRotation() { RunningApp.Tap(q => q.Button("Show ActionSheet")); RunningApp.Screenshot("Show ActionSheet"); RunningApp.SetOrientationLandscape(); RunningApp.Screenshot("Rotate Device"); var app = (RunningApp as iOSApp); if (app != null) { if (!app.Device.IsTablet) { RunningApp.Tap(q => q.Marked("Dismiss")); } else // iPad does not have dismiss option { RunningApp.Tap(q => q.Marked("Destroy")); } if (app.Device.IsTablet) { RunningApp.WaitForNoElement(q => q.Marked("Destroy")); } else { RunningApp.WaitForNoElement(q => q.Marked("Dismiss")); } RunningApp.Screenshot("Dismiss ActionSheet"); // App.SetOrientationPortrait (); // App.Tap (q => q.Button ("Show ActionSheet")); // App.Screenshot ("Rotate and show ActionSheet"); // // if (!app.Device.IsTablet) // App.Tap (q => q.Button ("Dismiss")); // else // iPad does not have dismiss option // App.Tap (q => q.Marked ("Destroy")); // // if (app.Device.IsTablet) // App.WaitForNoElement (q => q.Marked ("Destroy")); // else // iPad does not have dismiss option // App.WaitForNoElement (q => q.Marked ("Dismiss")); } }
public void ChangeOrientationCheckScroll () { #if __ANDROID__ var isAndroid = true; #else var isAndroid = false; #endif var grid1 = RunningApp.Query("MainGrid").Single(); RunningApp.SetOrientationLandscape (); RunningApp.ScrollDown (); RunningApp.SetOrientationPortrait (); var grid2 = RunningApp.Query("MainGrid").Single(); RunningApp.Screenshot ("Did it resize ok? Do you see some white on the bottom?"); if (!isAndroid) { Assert.AreEqual (grid1.Rect.CenterY, grid2.Rect.CenterY); } }
public void Bugzilla28498Test() { 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"); if (RunningApp.Query(c => c.Marked("btnCarousel")).Length > 0) { Assert.DoesNotThrow(() => RunningApp.Tap(q => q.Marked("btnCarousel"))); } else { Assert.Inconclusive("Should be button here, but rotation could take some time on XTC"); } }
public void Issue2948Test() { RunningApp.Screenshot("I am at Issue 2948"); RunningApp.SetOrientationLandscape(); Thread.Sleep(5000); if (ShouldRunTest()) { OpenMDP(); var btns = RunningApp.Query(c => c.Marked("btnOnDetail")); if (btns.Length > 0) { // on iOS the button could be out of screen RunningApp.Tap(c => c.Marked("btnOnDetail")); RunningApp.Screenshot("I in landscape and master is open"); } RunningApp.WaitForNoElement(c => c.Marked("Clicked"), "Time out", new TimeSpan(0, 0, 1)); } }
public void Test2() { if (Issue1461Helpers.ShouldRunTest(RunningApp)) { RunningApp.SetOrientationLandscape(); var query = RunningApp.Query(q => q.Marked("Master_Label")); Assert.IsTrue(query.Any(), "Master should be present"); RunningApp.Screenshot("Master should not present"); RunningApp.SetOrientationPortrait(); query = RunningApp.Query(q => q.Marked("Master_Label")); Assert.IsTrue(!query.Any(), "Master should not present"); RunningApp.Screenshot("Master should not present"); RunningApp.Tap(q => q.Marked("Go Back")); } else { Assert.Inconclusive("Only run on iOS Tablet"); } }
public void Issue773TestsRotationRelayoutIssue() { RunningApp.SetOrientationLandscape(); var buttonLabels = new [] { "Button 1", "Button 2", "Button 3", }; foreach (string buttonLabel in buttonLabels) { RunningApp.WaitForElement(q => q.Button(buttonLabel)); } RunningApp.Screenshot("StackLayout in Modal respects rotation"); RunningApp.SetOrientationPortrait(); }
public void Issue774TestsDismissActionSheetAfterRotation() { RunningApp.Tap(q => q.Button("Show ActionSheet")); RunningApp.Screenshot("Show ActionSheet"); RunningApp.SetOrientationLandscape(); RunningApp.Screenshot("Rotate Device"); // Wait for the action sheet element to show up RunningApp.WaitForElement(q => q.Marked("What's up")); var dismiss = RunningApp.Query("Dismiss"); var target = dismiss.Length > 0 ? "Dismiss" : "Destroy"; RunningApp.Tap(q => q.Marked(target)); RunningApp.WaitForNoElement(q => q.Marked(target)); RunningApp.Screenshot("Dismiss ActionSheet"); }
public void MasterViewSizeDoesntChangeAfterBackground() { var idiom = RunningApp.WaitForElement("Idiom"); // This behavior is currently broken on a phone device Issue 7270 if (idiom[0].ReadText() != "Tablet") { return; } RunningApp.SetOrientationLandscape(); RunningApp.Tap("CloseMasterView"); RunningApp.Tap("ShowLeftToRight"); var windowSize = RunningApp.WaitForElement("MasterLayout")[0]; RunningApp.SendAppToBackground(TimeSpan.FromSeconds(5)); var newWindowSize = RunningApp.WaitForElement("MasterLayout")[0]; Assert.AreEqual(newWindowSize.Rect.Width, windowSize.Rect.Width); Assert.AreEqual(newWindowSize.Rect.Height, windowSize.Rect.Height); }
public async Task RotatingCarouselViewHTMLShouldNotDisappear() { int delay = 3000; RunningApp.SetOrientationPortrait(); await Task.Delay(delay); RunningApp.SetOrientationLandscape(); await Task.Delay(delay); RunningApp.SetOrientationPortrait(); await Task.Delay(delay); RunningApp.SetOrientationLandscape(); await Task.Delay(delay); RunningApp.SetOrientationPortrait(); await Task.Delay(delay); RunningApp.WaitForElement(HTML); }
public void ChangeOrientationCheckScroll() { var isAndroid = RunningApp is AndroidApp; var className = "Xamarin_Forms_Platform_iOS_BoxRenderer"; if (isAndroid) { className = "BoxRenderer"; } var box1 = RunningApp.Query(c => c.Class(className)) [0]; RunningApp.SetOrientationLandscape(); RunningApp.ScrollDown(); RunningApp.SetOrientationPortrait(); var box2 = RunningApp.Query(c => c.Class(className)) [0]; RunningApp.Screenshot("Did it resize ok? Do you see some white on the bottom?"); if (!isAndroid) { Assert.AreEqual(box1.Rect.CenterY, box2.Rect.CenterY); } }
public void Bugzilla34632Test() { if (RunningApp.IsTablet()) { RunningApp.SetOrientationPortrait(); RunningApp.Tap(q => q.Marked("btnModal")); RunningApp.SetOrientationLandscape(); RunningApp.Tap(q => q.Marked("btnDismissModal")); RunningApp.Tap(q => q.Marked("btnModal")); RunningApp.SetOrientationPortrait(); RunningApp.Tap(q => q.Marked("btnDismissModal")); RunningApp.Tap("Main Page"); RunningApp.Tap(q => q.Marked("btnMaster")); RunningApp.WaitForNoElement("btnMaster"); } else { // Wait for the test to finish loading before exiting otherwise // the next UI test might start running while this is still loading RunningApp.WaitForElement(q => q.Marked("btnModal")); } }
public void Bugzilla34632Test() { var app = RunningApp as iOSApp; if (app != null && app.Device.IsTablet) { RunningApp.SetOrientationPortrait(); RunningApp.Tap(q => q.Marked("btnModal")); RunningApp.SetOrientationLandscape(); RunningApp.Tap(q => q.Marked("btnDismissModal")); RunningApp.Tap(q => q.Marked("btnModal")); RunningApp.SetOrientationPortrait(); RunningApp.Tap(q => q.Marked("btnDismissModal")); RunningApp.Tap(q => q.Marked("btnMaster")); } else { // Wait for the test to finish loading before exiting otherwise // the next UI test might start running while this is still loading RunningApp.WaitForElement(q => q.Marked("btnModal")); } }
public void MasterViewMovesAndContentIsVisible() { var idiom = RunningApp.WaitForElement("Idiom"); // This behavior is currently broken on a phone device Issue 7270 if (idiom[0].ReadText() != "Tablet") { return; } RunningApp.Tap("OpenMasterView"); RunningApp.Tap("CloseMasterView"); RunningApp.SetOrientationLandscape(); RunningApp.Tap("OpenMasterView"); var positionStart = RunningApp.WaitForElement("CloseMasterView"); RunningApp.Tap("ShowLeftToRight"); var results = RunningApp.QueryUntilPresent(() => { var secondPosition = RunningApp.Query("CloseMasterView"); if (secondPosition.Length == 0) { return(null); } if (secondPosition[0].Rect.X < positionStart[0].Rect.X) { return(secondPosition); } return(null); }); Assert.IsNotNull(results, "Master View Did not change flow direction correctly"); Assert.AreEqual(1, results.Length, "Master View Did not change flow direction correctly"); }
public void SplitOnLandscapeFailsToDetectClose() { if (!RunningApp.IsTablet()) { return; } while (RunningApp.WaitForElement("CurrentMasterBehavior")[0].ReadText() != FlyoutLayoutBehavior.SplitOnLandscape.ToString()) { RunningApp.Tap("ChangeMasterBehavior"); if (RunningApp.Query("Flyout Visible").Length > 0) { RunningApp.Tap("Close Flyout"); } } RunningApp.Tap("Flyout"); RunningApp.WaitForElement("Flyout Visible"); RunningApp.Tap("Close Flyout"); RunningApp.SetOrientationLandscape(); RunningApp.SetOrientationPortrait(); RunningApp.SetOrientationLandscape(); RunningApp.SetOrientationPortrait(); if (RunningApp.Query("Flyout Visible").Length > 0) { RunningApp.Tap("Close Flyout"); } RunningApp.Tap("Flyout"); RunningApp.WaitForElement("Flyout Visible"); RunningApp.Tap("Close Flyout"); RunningApp.Tap("Flyout"); RunningApp.WaitForElement("Flyout Visible"); }
public void CarouselAsycTestsAllPagesExistAfterAsyncAddingLandscape() { RunningApp.SetOrientationLandscape(); CarouselAsycTestsAllPagesExistAfterAsyncAdding(); RunningApp.SetOrientationPortrait(); }
public void CarouselAsycTestsAllElementsPresentLandscape() { RunningApp.SetOrientationLandscape(); CarouselAsycTestsAllElementsPresent(); RunningApp.SetOrientationPortrait(); }