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 BasicFahrenheitSetup() { // Let something load before proceeding app.WaitForElement(x => x.Marked("JunctionTemperatureLabel")); app.Screenshot("Initial launch"); app.SetSliderValue(x => x.Class("FormsSeekBar").Index(0), 250); app.SetSliderValue(x => x.Class("FormsSeekBar").Index(1), 208); app.ScrollDown(); // Might be necessary on small screens app.SetSliderValue(x => x.Class("FormsSeekBar").Index(2), 50); app.Screenshot("Sliders set for 5V from 12V at 0.5A"); app.ScrollUp(); app.SetOrientationLandscape(); app.Screenshot("Setup in landscape"); app.SetOrientationPortrait(); app.Tap(x => x.Marked("OK")); app.Screenshot("Opened settings"); app.Tap(x => x.Text("Fahrenheit (°F)")); app.Screenshot("Tapped on view with class: FormsTextView"); app.SwipeRightToLeft(); app.Screenshot("Swiped left"); app.WaitForElement(x => x.Marked("JunctionTemperatureLabel")); var temperatureF = app.Query(x => x.Marked("JunctionTemperatureLabel")); Assert.IsTrue(temperatureF[0].Text.Equals("JUNCTION TEMP: 222.1 ˚F")); }
public void LiteModeListView() { app.Screenshot("Launch"); app.ScrollDownAndTap(q => q.Text("Lite Mode ListView")); app.WaitForElement(q => q.Marked("Google Map")); app.Screenshot("Maps"); app.ScrollDown(); pause(); app.Screenshot("Scroll Down 1"); app.ScrollDown(); pause(); app.Screenshot("Scroll Down 2"); app.ScrollDown(); pause(); app.Screenshot("Scroll Down 3"); }
public void IsCustomBannerEnabledOnServiceWarningPage() { app.ScrollDown(); //Search for my Admob banner, lets have a timeout just in case. app.WaitForElement(s => s.Class("CustomBannerRenderer"), "Time out waiting for customBanner", new TimeSpan(5000)); //Is banner enabled? var customBannerEnabled = app.Query(c => c.Class("CustomBannerRenderer").Property("Enabled").Value <bool>()); Assert.IsTrue(customBannerEnabled[0]); }
public void UI_TEST_DE_UAT() { string str = generator.RandomString(3, false); int rand = generator.RandomNumber(3, 100); string randomnumber = rand.ToString(); string email = String.Concat(str, randomnumber); string remain = "@pampers.com"; EmailFinal = String.Concat("john.", email, remain); Thread.Sleep(20000); app.SwipeRightToLeft(); app.SwipeRightToLeft(); app.SwipeRightToLeft(); Thread.Sleep(7000); app.Flash(x => x.Id("alreadyHaveAccountButton")); app.Tap(x => x.Id("joinNowButton")); Thread.Sleep(7000); app.Tap(x => x.Id("firstNameEditText")); app.EnterText("John"); app.Tap(x => x.Id("textViewContent")); app.Tap("OK"); app.ScrollDownTo("Email", strategy: ScrollStrategy.Gesture); app.Tap(x => x.Id("emailEditText")); app.EnterText(EmailFinal); app.ScrollDownTo("Password", strategy: ScrollStrategy.Gesture); app.Tap("Password"); app.EnterText("magicA123"); app.Tap(x => x.Id("joinNowButton")); Thread.Sleep(5000); app.Tap(x => x.Id("gdprContentScrollView")); app.ScrollDown(strategy: ScrollStrategy.Gesture); app.ScrollDown(strategy: ScrollStrategy.Gesture); app.ScrollDown(strategy: ScrollStrategy.Gesture); app.ScrollDown(strategy: ScrollStrategy.Gesture); Thread.Sleep(2000); app.Tap(x => x.Id("gdprCTABtn")); Thread.Sleep(5000); Logout(); Login(); }
public string[] CountTopics() { var firstElements = app.Query(c => c.Id(nextButton)).Select(x => x.Text).ToList(); app.ScrollDown(); var secondElements = app.Query(c => c.Id(nextButton)).Select(x => x.Text).ToList(); foreach (var s in secondElements) { firstElements.Add(s); } var elements = firstElements.Distinct().ToArray(); return(elements); }
public void a_Register() { string str = generator.RandomString(10, false); int rand = generator.RandomNumber(5, 100); string randomnumber = rand.ToString(); string email = String.Concat(str, randomnumber); string remain = "@pampers.com"; final_email = String.Concat(email, remain); Thread.Sleep(15000); app.SwipeRightToLeft(); app.SwipeRightToLeft(); app.SwipeRightToLeft(); app.Tap(x => x.Id("joinNowButton")); Thread.Sleep(7000); var isDOB = app.Query("Child's Birth / Due Date").Any(); app.Tap(x => x.Id("firstNameEditText")); app.EnterText("John"); //needs to be changed to the calender element app.ScrollDownTo(x => x.Id("firstNameEditText"), strategy: ScrollStrategy.Auto); Thread.Sleep(3000); if (isDOB == true) { app.Tap("Child's Birth / Due Date"); app.Query(c => c.Class("AlertDialogLayout")); app.Tap("OK"); } app.ScrollDownTo("Email", strategy: ScrollStrategy.Gesture, timeout: new TimeSpan(0, 1, 0)); app.Tap("Email"); app.Tap("Email"); app.EnterText(final_email); var isZIP = app.Query("ZIP Code").Any(); if (isZIP == true) { app.Tap("ZIP Code"); app.EnterText("34265"); } app.ScrollDown("Password"); app.Tap("Password"); app.EnterText("magicA123"); app.ScrollDownTo("I'd love to join!", strategy: ScrollStrategy.Gesture, timeout: new TimeSpan(0, 1, 0)); app.Tap("I'd love to join!"); app.Query(c => c.Marked("OK").Parent().Class("AlertDialogLayout")); if (isDOB == false) { app.WaitForElement(x => x.Id("addDependentButton")); app.Tap(x => x.Id("addDependentButton")); app.Tap("OK"); app.Tap(x => x.Id("onboardingDependentContinueButton")); app.WaitForElement("Let's lock this down"); app.Tap("Let's lock this down"); app.WaitForElement(x => x.Id("phoneNumberEditText")); app.Tap(x => x.Id("phoneNumberEditText")); app.EnterText("+14155552671"); app.Tap(x => x.Id("sendSafetyCodeBtn")); } Thread.Sleep(1000); }
// [TestCase] public void NewTest() { app.Tap(x => x.Class("EntryEditText")); app.Screenshot("Tapped on view with class: EntryEditText"); // step 2 app.EnterText(x => x.Class("EntryEditText"), "sandy"); app.PressEnter(); app.Tap(x => x.Class("EntryEditText").Index(1)); app.EnterText(x => x.Class("EntryEditText").Index(1), "engg"); app.PressEnter(); app.Tap(x => x.Class("EntryEditText").Index(2)); app.EnterText(x => x.Class("EntryEditText").Index(2), "public"); app.Tap(x => x.Class("EntryEditText").Index(3)); app.EnterText(x => x.Class("EntryEditText").Index(3), "*****@*****.**"); app.Tap(x => x.Class("EntryEditText").Index(4)); app.EnterText(x => x.Class("EntryEditText").Index(4), "1234567890"); app.PressEnter(); app.Screenshot("Pressed enter key"); // step 3 app.Tap(x => x.Text("GET STARTED")); app.Screenshot("Tapped on view with class: Button with text: GET STARTED"); // step 4 app.Tap(x => x.Text("NEW PROJECT")); app.WaitForElement(x => x.Marked("SiteName")); app.Screenshot("Tapped on view with class: FormsTextView with text: Copy project settings from\nanother project"); // step 5 app.Tap(x => x.Marked("siteName")); app.EnterText(x => x.Marked("siteName"), "first"); app.PressEnter(); app.Tap(x => x.Marked("EntrySiteLoc")); app.EnterText(x => x.Marked("EntrySiteLoc"), "germany"); app.PressEnter(); app.Tap(x => x.Text("Project Type").Index(1)); app.TouchAndHold(x => x.Text("Commercial")); app.Screenshot("Long press on view with class: Platform_DefaultRenderer"); // step 6 app.TouchAndHold(x => x.Text("Advanced Settings")); app.Screenshot("Entered text: D"); // step 7 app.Tap(x => x.Text("02")); app.Screenshot("Entered text: 02"); // step 8 for (int i = 0; i < 2; i++) { app.ScrollDown(); if ((app.Query(x => x.Marked("Panel Languages"))).Length > 0) { break; } } app.Screenshot("Scrolled for the Panel Language"); // step 9 app.Tap(x => x.Class("EditText").Index(2)); app.Screenshot("Tapped on view with class: EditText"); // step 10 app.Tap(x => x.Id("button1")); app.Screenshot("Tapped on OK"); // step 11 for (int i = 0; i < 2; i++) { app.ScrollDown(); if ((app.Query(x => x.Marked("No of repeaters"))).Length > 0) { break; } } // step 12 app.Tap(x => x.Text("+").Index(1)); app.Tap(x => x.Text("+").Index(1)); app.Tap(x => x.Text("+").Index(1)); app.Tap(x => x.Text("+").Index(1)); app.Tap(x => x.Text("+").Index(1)); //app.Tap(x => x.Text("+").Index(2)); //app.Tap(x => x.Text("+").Index(2)); //app.Tap(x => x.Text("+").Index(2)); //app.Tap(x => x.Text("+").Index(2)); //app.Tap(x => x.Text("+").Index(2)); app.Screenshot("Tapped on view with class: Button with text: +"); // step app.Back(); app.Tap(x => x.Text("CREATE")); app.Screenshot("Tapped on view with class: Button with text: CREATE"); //for (int i = 0; i < 6; i++) //{ // app.Back(); // if ((app.Query(x => x.Marked("Do you really want to exit?"))).Length > 0) // { // break; // } // for (i = 0; i < 2000; i++) // { // ; // } //} //app.Screenshot("about to exit"); //app.Tap(x => x.Id("button1")); //app.Screenshot("app closed"); //BeforeEachTest(); //app.Screenshot("reopen"); // step app.TouchAndHold(x => x.Text("first")); app.Screenshot("Long press on view with class: Platform_DefaultRenderer"); // step app.Tap(x => x.Text("NEW PANEL")); app.Screenshot("Tapped on view with class: Button with text: NEW PANEL"); // step app.Tap(x => x.Class("EntryEditText")); app.EnterText(x => x.Class("EntryEditText"), "dxc"); app.PressEnter(); app.Screenshot("dxc"); // step app.Tap(x => x.Class("EntryEditText").Index(1)); app.EnterText(x => x.Class("EntryEditText").Index(1), "first floor"); app.PressEnter(); app.Screenshot("Pressed enter key"); // step app.Tap(x => x.Text("CREATE")); app.Screenshot("Tapped on view with class: Button with text: CREATE"); // step app.TouchAndHold(x => x.Text("dxc")); app.Screenshot("pressed DXC"); // step app.TouchAndHold(x => x.Text("Devices")); app.Screenshot("Long press on view with class: FormsImageView"); // step app.TouchAndHold(x => x.Text("Zones")); app.Screenshot("Long press on view with class: FormsTextView with text: Zones"); // step app.TouchAndHold(x => x.Text("Logics")); app.Screenshot("Long press on view with class: LOGICS"); // step app.TouchAndHold(x => x.Text("Events")); app.Screenshot("Long press on view with class: FormsTextView with text: Events"); // step app.Tap(x => x.Text("All")); app.Screenshot("press All"); // step app.ScrollDown(); app.Screenshot("press Fault"); // step app.Tap(x => x.Id("button1")); app.Screenshot("Long press on view with class: FormsImageView"); // step app.Back(); app.Screenshot("goto prev screen"); // step app.Tap(x => x.Text("QUICK CONFIGURE")); app.Screenshot("Tapped on view with class: Button with text: QUICK CONFIGURE"); // step app.Tap(x => x.Text("CONTINUE")); app.Screenshot("Tapped on view with class: Button with text: CONTINUE"); // step app.Tap(x => x.Class("EntryEditText")); app.EnterText(x => x.Class("EntryEditText"), "two"); app.PressEnter(); app.Tap(x => x.Class("EntryEditText").Index(1)); app.EnterText(x => x.Class("EntryEditText").Index(1), "second floor"); app.PressEnter(); app.Tap(x => x.Text("04")); app.Screenshot("filled the page and tap on CONTINUE"); // step app.Tap(x => x.Text("CONTINUE")); app.Screenshot("Tapped on view with class: Button with text: CONTINUE"); // step app.Tap(x => x.Text("Loop 1")); app.Screenshot("Long press on view with class: LOOP 1"); // step app.Tap(x => x.Class("EntryEditText")); app.EnterText(x => x.Class("EntryEditText"), "20"); app.PressEnter(); app.Tap(x => x.Class("EntryEditText").Index(1)); app.EnterText(x => x.Class("EntryEditText").Index(1), "0"); app.PressEnter(); app.Screenshot("added sensor and modules"); // step app.Tap(x => x.Text("DONE")); app.Screenshot("Tapped on view with class: Button with text: DONE"); // step app.Tap(x => x.Text("CONTINUE")); app.Screenshot("Tapped on view with class: Button with text: CONTINUE"); // step app.Tap(x => x.Text("SKIP")); app.Screenshot("Tapped on view with class: Button with text: SKIP"); // step app.Tap(x => x.Class("RadioButton")); app.Tap(x => x.Class("RadioButton").Index(2)); app.Tap(x => x.Class("RadioButton").Index(1)); app.Screenshot("Tapped on view with class: RadioButton"); // step app.Tap(x => x.Text("ASSIGN")); app.Screenshot("Tapped on view with class: Button with text: ASSIGN"); // step app.Tap(x => x.Class("RadioButton")); app.Tap(x => x.Class("RadioButton").Index(1)); app.Screenshot("Long press on view with class: RadioButton"); // step app.Tap(x => x.Text("DONE")); app.Screenshot("Long press on view with class: Button with text: DONE"); // step app.Tap(x => x.Text("DONE")); app.Screenshot("Tapped on view with class: Button with text: DONE"); app.Back(); app.Screenshot("panels list"); for (int i = 0; i < 6; i++) { app.Back(); if ((app.Query(x => x.Marked("Do you really want to exit?"))).Length > 0) { break; } else { continue; } } app.Screenshot("about to exit"); app.Tap(x => x.Id("button1")); app.Screenshot("app closed"); BeforeEachTest(); app.Screenshot("reopen"); app.Flash("first"); app.Screenshot("first flash"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(1))[0].Text, "first"); app.Screenshot("assertion 1"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(2))[0].Text, "germany"); app.Screenshot("assertion 2"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(6))[0].Text, "Commercial"); app.Screenshot("assertion 3"); app.TouchAndHold(x => x.Text("first")); app.Screenshot("Long press on view with class: Platform_DefaultRenderer"); for (int i = 0; i < 20000; i++) { ; } Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(2))[0].Text, "two"); app.Screenshot("assertion 4"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(3))[0].Text, "second floor"); app.Screenshot("assertion 5"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(5))[0].Text, "4"); app.Screenshot("assertion 6"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(7))[0].Text, "20"); app.Screenshot("assertion 7"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(12))[0].Text, "dxc"); app.Screenshot("assertion 8"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(13))[0].Text, "first floor"); app.Screenshot("assertion 9"); Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(15))[0].Text, "2"); app.Screenshot("assertion 10"); }