const bool TestExecutionMode = false;
public static async Task LoadFirstPage()
{
await Nav.Go(new Pages.MyStartPage());
if (TestExecutionMode)
Zebble.Testing.TestEngine.Run();
}
In your UITests project add a test class. Name it after the scenario that you want to test, for example "ManageContacts". It should inherit from TestScenario in Zebble.UITesting namespace and implement the Run() method.
{
using System;
using Zebble.UITesting;
using System.Threading.Tasks;
class ManageContacts : UITest
{
public override Task Run()
{
Tap("Contacts");
ExpectHeader("Contacts");
// Test adding a contact:
Tap("Add");
Set("First name").To("Jack");
Set("Last name").To("Williams");
Tap("Save");
Expect("Jack Williams");
// Test deleting a contact
AtRow("Jack Williams").Swipe(SwipeDirection.Left);
AtRow("Jack Williams").Tap("Delete");
ExpectNo("Jack Williams");
}
}
}
You can invoke any of the following commands as part of your test script:
Often you can have several objects on the screen with the same text. To resolve ambiguity, you can use one or a combination of location specifiers from the following list: