Beispiel #1
0
 public static void WaitFor(this AppiumDriver driver, ContainsType _ContainsType, double time = 10)
 {
     Stopwatch watch = new Stopwatch ();
     watch.Start ();
     while (watch.Elapsed.TotalSeconds < time) {
         driver.Sleep (0.5);
         if (_ContainsType ())
             break;
     }
     watch.Stop ();
     if (watch.Elapsed.TotalSeconds >= time)
         throw new Exception(string.Format("Item does not exist after {0} seconds of waiting", time));
 }
Beispiel #2
0
 public bool RuntimeValidation(ref string error)
 {
     var total = 0;
     if ( this.ContainsBoth )
     {
         this.CurrentContainsType = RegionUtilityComponent.ContainsType.Both;
         total++;
     }
     if ( this.ContainsNone )
     {
         this.CurrentContainsType = RegionUtilityComponent.ContainsType.None;
         total++;
     }
     if ( this.ContainsOne )
     {
         this.CurrentContainsType = RegionUtilityComponent.ContainsType.One;
         total++;
     }
     if ( this.ExclusiveOr )
     {
         this.CurrentContainsType = RegionUtilityComponent.ContainsType.ExclusiveOr;
         total++;
     }
     if ( total != 1 )
     {
         error = "In '" + this.Name + "', exactly one of the Contains parameters must be set to true!";
         return false;
     }
     return this.SubRuntimeValidation( ref error );
 }