Validations
Using Assert on UI validations
❌ Don't: Use the standard Assert API for control validations
Assert.AreEqual("Hello", label.Text);✔️ Do: Use the Validate extension methods
using Mobilize.QualityMate.Automation.Extensions;
label.Validate(self => self.Text.Equals("Hello"));Validating static text
❌ Don't: Validate text on labels and non-editable controls
✔️ Do: Omit unnecessary text validations
Validating collections of controls
❌ Don't: Validate a list or collection of controls one by one
✔️ Do: Loop through items for validations
✔️ Do: Use LINQ expressions
Validating before interacting
❌ Don't: Add validations before interacting with controls that are guaranteed to be available
❌ Don't: Validate that an item exists in a control's list of items before selecting it
✔️ Do: Omit validations prior to interactions
✔️ Do: Add validations when a control is suspected to change state before interacting with it
✔️ Do: Validate the item is selected after performing the selection
Last updated
Was this helpful?