Adding constraints to prevent users from invalid states for Appium