Helpers
C# 6's using static
feature brings base queries like Button
and Entry
into scope for even shorter query expressions:
using static Xamarin.UITest.Helpers;
...
var signInButton = Button["#signInButton"];
var fifthCell = Cell["DataRow"][4];
var helloField = Entry.WithText("Hello");
app.Tap(signInButton);
app.WaitFor(fifthCell);
app.Tap(helloField);
Other helpers include methods that operate on the global IApp
:
app.Tap(signInButton);
app.WaitFor(fifthCell);
app.Tap(helloField);
Tap(signInButton);
WaitFor(fifthCell);
Tap(helloField);
Query Helpers
Helper |
Description |
Any |
All elements |
Visible |
Visible elements |
Button |
Visible buttons |
Entry |
Visible text fields |
Label |
Visible labels |
Switch |
Visible switches |
App Helpers
Helper |
Description |
Tap |
Taps all elements matching the query |
Interact |
Opens an interactive debugging console |
Wait |
Wait some time |
WaitUntilExists |
Wait for queries to appear |
Screenshot |
Take a screenshot |
SuspendScreenshots |
Temporarily disable screenshots |
ResumeScreenshots |
Re-enable screenshots |
WithScreenshotsSuspended |
Perform an action without screenshots |
Other Helpers
Helper |
Description |
Platform |
The current platform |