public void AfterEachTest() { // Start the application app = ConfigureApp.Android.StartApp(); // Delete recently created city if still existing // Depending on your test configuration and environment, ConfigureApp.Android.StartApp(); sometimes // deployes a complete new package of the app. In this case, no cleanup work is needed. app.WaitForElement(x => x.Id("textView1")); var city = app.Query(x => x.Text(testCityName)).FirstOrDefault(); if (city != null) { // Delete the recently created city app.Tap(x => x.Text(testCityName)); app.WaitForElement(x => x.Class("OverflowMenuButton")); app.Tap(x => x.Class("OverflowMenuButton")); app.Tap(x => x.Class("TextView").Index(0)); // Edit button app.WaitForElement(x => x.Id("action_delete_city"), "Delete city button never appeared..."); app.Tap(x => x.Id("action_delete_city")); app.Tap(x => x.Id("button1")); // Check if city has been deleted successfully var results = app.Query(x => x.Text(testCityName)); Assert.IsFalse(results.Any()); } }
public SalesHomePage(AndroidApp app) : base(app, "WEEKLY AVERAGE") { FirstLead = x => x.Marked("50% - Value Proposition"); ListView = x => x.Id("content"); AddLeadButton = x => x.Class("FormsImageView"); LeadCell = x => x.Class("ViewCellRenderer_ViewCellContainer"); ChartIdentifier = x => x.Id("stripLinesLayout"); //Verifying page has loaded app.WaitForElement(LeadCell); app.WaitForElement(ChartIdentifier); app.WaitForNoElement(SalesDataLoading, timeout: TimeSpan.FromSeconds(20)); app.WaitForNoElement(LeadsLoading, timeout: TimeSpan.FromSeconds(20)); }
public void SignInPageDisplayed() { AppResult[] results = app.WaitForElement(c => c.Marked(" Sign in to Sample App")); app.Screenshot("Sign In screen."); Assert.IsTrue(results.Any()); }
public void WelcomeTextIsDisplayed() { AppResult[] results = app.WaitForElement(c => c.Marked("Welcome to Xamarin Forms!")); app.Screenshot("Welcome screen."); Assert.IsTrue(results.Any()); }
protected BasePage(AndroidApp app, Func<AppQuery, AppQuery> androidTrait) : this(app) { Assert.DoesNotThrow(() => app.WaitForElement(androidTrait), "Unable to verify on page: " + this.GetType().Name); app.Screenshot("On " + this.GetType().Name); }
public void VerticalPhrases() { app.Tap(x => x.Class("TextView").Index(1)); app.Tap(x => x.Class("TextView").Index(6)); app.Tap(x => x.Class("TextView").Index(11)); app.Tap(x => x.Class("TextView").Index(16)); app.Screenshot("4 in a column are selected"); app.Tap(x => x.Class("TextView").Index(21)); app.WaitForElement(x => x.Id("alertTitle")); var results = app.Query(x => x.Id("alertTitle")); Assert.AreEqual("You won, congratulations!", results [0].Text); app.Screenshot("A Congratulating dialog should appear"); }
public void BlurImage() { app.Screenshot("Launch"); app.WaitForElement(q => q.Id("seekBar1")); app.Query(q => q.Id("seekBar1").Invoke("setProgress", 15)); app.Screenshot("Blurred Image"); }
public CustomerSalesPage(AndroidApp app) : base(app) { app.WaitForElement("WEEKLY AVERAGE", timeout: TimeSpan.FromMinutes(2)); app.Screenshot("On " + this.GetType().Name); }
public void AppLaunches() { app.Flash(x => x.Id("txt")); app.Tap(x => x.Id("txt")); app.Tap(x => x.Text("Technology")); Thread.Sleep(TimeSpan.FromSeconds(4)); app.Screenshot("Flashed and Tapped 'All' button, then Tapped 'Technology' button"); app.Flash(x => x.Id("ab_refresh")); app.Tap(x => x.Id("ab_refresh")); app.Screenshot("Flashed and Tapped refresh button"); app.Flash(x => x.Id("ab_search")); app.Tap(x => x.Id("ab_search")); app.EnterText("Microsoft"); app.Screenshot("Entered Microsoft"); Thread.Sleep(TimeSpan.FromSeconds(2)); app.PressEnter(); app.Screenshot("Searched for 'Microsoft' in the Search Bar"); app.ScrollDown(); Thread.Sleep(TimeSpan.FromSeconds(1)); app.ScrollDown(); Thread.Sleep(TimeSpan.FromSeconds(1)); app.Screenshot("Swiped down a few times"); app.WaitForElement(x => x.Marked("Facebook, Microsoft to Run Mega-Cable From Va. to Spain")); app.Flash(x => x.Marked("Facebook, Microsoft to Run Mega-Cable From Va. to Spain")); app.Screenshot("Flashed Microsoft News Article"); Thread.Sleep(TimeSpan.FromSeconds(2)); app.Tap(x => x.Marked("Facebook, Microsoft to Run Mega-Cable From Va. to Spain")); app.Screenshot("Tapped on Microsoft and Facebook Article'"); }
public void AppLaunches() { //app.Screenshot("First screen."); app.Repl(); app.WaitForElement("NoResourceEntry-6"); app.Tap(e => e.Id("NoResourceEntry-6")); app.Tap(e => e.Id("NoResourceEntry-7")); }
public void CreditCardNumber_TooShort_DisplayErrorMessage() { //First, wait for the default screen and set context on the input box. //Take a screenshot app.WaitForElement(c => c.Marked("action_bar_title").Text("Enter Credit Card Number")); app.Screenshot("Default View"); //Then, enter a string of digits and take a screenshot app.EnterText(c => c.Marked("creditCardNumberText"), new string('9', 15)); app.Screenshot("Text Entered"); app.WaitForElement(c => c.Marked("action_bar_title").Text("Enter Credit Card Number")); //Finally, progress with validation and verify the message. app.Tap(c => c.Marked("validateButton")); app.WaitForElement(c => c.Marked("errorMessagesText").Text("Credit card number is too short.")); app.Screenshot("Complete"); }
public void AppLaunches() { app.Screenshot("First screen."); app.EnterText(c => c.Marked("WeightText"), "70"); app.EnterText(c => c.Marked("HeightText"), "1.8"); app.Tap(c => c.Marked("Calculate")); app.WaitForElement(c => c.Marked("ResultText").Text("21.6")); }
public void UpdateFirstName() { app.WaitForElement(x => x.Id("nameTextView")); // wait for the list to appear app.Screenshot("App start, display list"); app.ScrollDownTo("Green, Monica", withinMarked: "acquaintanceRecyclerView"); app.Screenshot("Scrolled to Monica Green"); app.Tap(x => x.Marked("Green, Monica")); Thread.Sleep(2000); // wait 2 seconds to give map time to fully render app.Screenshot("Detail screen"); app.Tap(x => x.Id("acquaintanceEditButton")); app.Screenshot("Edit screen"); app.ScrollDownTo("First"); app.Tap(x => x.Id("firstNameField")); app.ClearText(); app.Screenshot("Cleared first name field"); app.EnterText("Erica"); app.DismissKeyboard(); app.Screenshot("Altered value of company name field"); app.Tap(x => x.Id("acquaintanceSaveButton")); Thread.Sleep(2000); // wait 2 seconds to give map time to fully render app.Screenshot("Saved changes, navigated to detail screen, first name updated"); app.Tap(x => x.Marked("Navigate up")); app.ScrollDownTo("Green, Erica"); app.Screenshot("First name updated on list screen, first name updated"); }
public void UpdateFirstName() { app.Screenshot("App Started"); app.Tap(x => x.Id("setupDataPartitionPhraseField")); app.EnterText("UseLocalDataSource"); app.Screenshot("Entered data parition phrase"); app.Tap(x => x.Id("setupContinueButton")); app.WaitForElement(x => x.Marked("Armstead, Evan")); Thread.Sleep(3000); // wait a few seconds for list images to fully load app.Screenshot("Display list"); app.Tap(x => x.Marked("Armstead, Evan")); Thread.Sleep(3000); // wait 3 seconds to give map time to fully render app.Screenshot("Detail screen"); app.Tap(x => x.Id("acquaintanceEditButton")); app.Screenshot("Edit screen"); app.ScrollDownTo("First"); app.Tap(x => x.Id("firstNameField")); app.ClearText(); app.Screenshot("Cleared first name field"); app.EnterText("Jonathan"); app.DismissKeyboard(); app.Screenshot("Altered value of first name field"); app.Tap(x => x.Id("acquaintanceSaveButton")); Thread.Sleep(3000); // wait 3 seconds to give map time to fully render app.Screenshot("Saved changes, navigated to detail screen, first name updated"); app.Tap(x => x.Marked("Navigate up")); app.Screenshot("First name updated on list screen"); }
public void Video() { app.Screenshot("Launch"); app.Tap(q => q.Text("Dark Theme")); app.Screenshot("Dark Theme"); app.Tap(q => q.Text("Cats with hats")); app.Screenshot("Cats with hats"); if (app.Query(q => q.Class("MediaRouteButton")).Any()) { app.WaitForElement(q => q.Class("MediaRouteButton")); app.Tap(q => q.Class("MediaRouteButton")); app.WaitForElement(q => q.Id("media_route_list")); app.Screenshot("Connect to device"); app.Back(); app.WaitForNoElement(q => q.Id("media_route_list")); } }
public async Task Login_Error() { app.EnterText(c => c.TextField().Index(1), "DummyID"); app.EnterText(c => c.TextField().Index(2), "DummyPassword"); app.Tap(c => c.Button().Index(0)); await Task.Delay(1000); app.WaitForElement(c => c.Class("FormsTextView")); }
public void PhaseListViewEnabled() { //arrange & act app.Screenshot("First screen."); var phaseListView = app.WaitForElement("PhasesListView"); //assert Assert.That(phaseListView.First().Enabled); }
public void GivenDeAppIsGestart() { app = ConfigureApp .Android .EnableLocalScreenshots() .ApkFile("C:/data/visualstudio_diverseprojecten/travellingsalesman/TSMApp/bin/Debug/TSMApp.TSMApp.apk") .StartApp(); app.WaitForElement(c => c.Id("action_bar")); }
public string CountResults() { app.WaitForElement(_resultCount); var countOfResults = app.Query(_resultCount).Select(x => x.Text).First(); var result = Regex.Match(countOfResults, @"\D+ (\d+) \D+"); var count = result.Groups.Cast <Group>().Select(x => x.Value).Skip(1).First(); return(count); }
public void LoopTest() { Setup(true); app.Tap("SKIP SIGN IN (demo)"); app.WaitForElement("6-Week Sales"); CustomScrollDownTo("Rockridge Hotel", 4); }
public void CheckRoutes() { app.Screenshot("Launch"); app.Tap(q => q.Id("mediaRouteButton")); app.WaitForElement(q => q.Id("media_route_list")); app.Screenshot("Routes"); }
public void CheckCompatibilityTest() { app.Screenshot("Launch"); app.Tap(q => q.Id("buttonCheck")); app.WaitForElement(q => q.Id("message")); app.Screenshot("Result"); }
public void TappingItemShouldDisplayDetails() { app.Screenshot("Launch"); app.Tap(q => q.Text("Henry V")); app.Screenshot("Tapped Item"); app.WaitForElement(q => q.Id("home")); }
private FileInfo TakeScreenshotOfExample(string exampleName) { // need to ensure that we take screenshot with same orientation _app.SetOrientationPortrait(); _app.WaitForElement(c => c.Marked("examplesList")); _app.ScrollDownTo(c => c.Text(exampleName)); _app.Screenshot(exampleName); _app.Tap(c => c.Text(exampleName)); _app.WaitForElement(c => c.Marked("fragment_container")); _app.Invoke("InitExampleForUiTest"); return(_app.Screenshot(exampleName)); }
public void TestNextButtonAvailable() { // Wait for Next button app.WaitForElement(c => c.Marked("Button").Text("Next")); // Get the text button var currentText = app.Query(x => x.Id("Button").Invoke("getText").Value <string>()); // Checks if the button has 'Next' as text Assert.NotNull(currentText); Assert.AreEqual(currentText[0], "Next"); }
public void ChooseItem() { app.Screenshot("Launch"); app.WaitForElement(q => q.Text("Hamburgers")); app.Screenshot("Choices"); app.Tap(q => q.Text("Hamburgers")); app.Screenshot("Chose"); }
public void ViewSessions() { app.Screenshot("First Screen"); app.Tap(x => x.Text("Not Now")); app.Screenshot("Skip Sign In"); app.Tap(x => x.Class("ImageButton")); app.Screenshot("Open Menu Bar"); app.Tap("Sessions"); app.Screenshot("Tap Sessions"); app.WaitForElement("No Sessions Found"); app.Screenshot("Load Sessions Page"); }
public async Task AppLaunches() { // waiting for mapview to load app.WaitForElement(x => x.Id("MyMapView"), timeout: TimeSpan.FromSeconds(200)); // waiting for respective buttons to load app.WaitForElement(x => x.Id("la"), timeout: TimeSpan.FromSeconds(200)); app.WaitForElement(x => x.Id("lv"), timeout: TimeSpan.FromSeconds(200)); // click/tap on button app.Tap(x => x.Id("la")); // waiting for 10 secods for map to render. Task.Delay(10000); app.Screenshot("Los Angeles"); // click/tap on button app.Tap(x => x.Id("lv")); // waiting for 10 secods for map to render. Task.Delay(10000); app.Screenshot("Los Vegas"); }
public void FirstTest() { app.WaitForElement(x => x.Id("textView1")); app.Screenshot("Waited for view with class: TextView with id: textView1 with text: Login on demo app"); app.Tap(x => x.Id("TbxUsername")); app.EnterText(x => x.Id("TbxUsername"), "admin"); app.Tap(x => x.Id("TbxPassword")); app.EnterText(x => x.Id("TbxPassword"), "admin"); app.Tap(x => x.Id("BtnLogin")); app.WaitForElement(x => x.Text("add")); app.Screenshot("Waited for view with class: Button with text: add"); app.Tap(x => x.Text("Karol")); app.WaitForElement(x => x.Text("Go Back")); app.Screenshot("Waited for view with class: Button with text: Go Back"); app.Tap(x => x.Text("Go Back")); app.WaitForElement(x => x.Text("edit")); app.Screenshot("Waited for view with class: Button with text: edit"); }
public void BeforeEachTest() { app = ConfigureApp.Android.StartApp (); app.Screenshot ("Given the app is loaded"); app.Tap (x => x.Button ("btn_play")); app.WaitForElement (x => x.Id ("tv_bingoItem")); var results = app.Query (x => x.Id ("tv_bingoItem")); Assert.AreEqual (25, results.Length); app.Screenshot ("25 items should be shown"); }
public void InitialLaunch() { app.WaitForElement(q => q.Id("FlashBarText")); app.WaitForNoElement(q => q.Id("FlashBarText"), postTimeout: TimeSpan.FromSeconds(1)); app.Screenshot("Loaded map"); }
public void BeforeEachTest() { app = ConfigureApp.Android.StartApp(); app.Screenshot("Given the app is loaded"); app.Tap(x => x.Button("btn_play")); app.WaitForElement(x => x.Id("tv_bingoItem")); var results = app.Query(x => x.Id("tv_bingoItem")); Assert.AreEqual(25, results.Length); app.Screenshot("25 items should be shown"); }
public void App_error_login() { app.Screenshot("First screen."); app.EnterText("et_login", "Altamir"); app.EnterText("et_pass", "123456"); app.DismissKeyboard(); app.Tap("bt_logar"); app.WaitForElement(c => c.Text("Login ou senha incorreto!"), "Wait msg error ", TimeSpan.FromSeconds(10)); app.Screenshot("Error login"); }
public void ForgotPWD_Errornotifications() { app.Tap(x => x.Id("cc_forgot_password")); app.Screenshot("Tapped on view with class: AppCompatTextView with id: cc_forgot_password with text: Passwort vergessen?"); app.Tap(x => x.Id("rp_email")); app.Screenshot("Tapped on view with class: EditTextValidating with id: rp_email"); app.EnterText(x => x.Id("rp_email"), "gio@."); app.WaitForElement(x => x.Text("Ungültige E-Mail-Adresse")); app.Screenshot("Waited for view with class: AppCompatTextView with text: Ungültige E-Mail-Adresse"); var errorNoteExists = app.Query("Ungültige E-Mail-Adresse").Any(); Assert.IsTrue(errorNoteExists); app.DismissKeyboard(); app.Tap(x => x.Id("rp_new_password")); app.EnterText(x => x.Id("rp_new_password"), "qwertyi"); app.EnterText(x => x.Id("rp_new_password"), "u"); app.WaitForElement(x => x.Text("Bitte Passwortrichtlinie beachten")); app.Screenshot("Waited for view with class: AppCompatTextView with text: Bitte Passwortrichtlinie beachten"); var pwd = app.Query("Bitte Passwortrichtlinie beachten").Any(); Assert.IsTrue(pwd); }
// [Test] public void TestFeed() { try { var randomArtist = (new Random()).Next(); Console.Out.WriteLine("Key : " + randomArtist); var model = new Model(); // LoginAsUser("*****@*****.**", "b"); app.Tap(c => c.Marked("el_btn_email_login")); app.Tap(c => c.Marked("el_input_email")); app.EnterText("*****@*****.**"); app.Tap(c => c.Marked("el_input_password")); app.EnterText("b"); app.PressEnter(); app.Tap(c => c.Marked("el_btn_email_login")); app.WaitForElement(c => c.Marked("follow_artist_list")); var name = "Miss Destiny Rogahn"; QQ qq = model.FollowArtistButton(name); app.Tap(qq); this.all(); } catch { this.all(); throw; } }
public void BeforeEachTest() { // Start the application app = ConfigureApp.Android.StartApp(); // Create a new city app.WaitForElement(x => x.Id("action_add_city")); app.Tap(x => x.Id("action_add_city")); app.EnterText(x => x.Id("addEditCityName"), testCityName); app.EnterText(x => x.Id("addEditCityZip"), testCityZip); app.Tap(x => x.Id("action_add_city_confirm")); // Check if city has been created successfully var results = app.Query(x => x.Text(testCityName)); Assert.IsTrue(results.Any()); }
public SignInPage(AndroidApp app) : base(app) { app.WaitForElement(InputLogin); }
public PinCodePage(AndroidApp app) : base(app) { app.WaitForElement(skipPage); }
public HomePatientPage(AndroidApp app) : base(app) { app.WaitForElement(skipPage); }
public StartPage(AndroidApp app) : base(app) { app.Tap(GetServices); //Only for emulator app.WaitForElement(JoinButton); }
public TutorialPagePage(AndroidApp app) : base(app) { app.WaitForElement(dismissPage); }