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")); }
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)); }