public IWaitMethodChainNode Wait(Action <IExpectMethodChainRoot> predicate)
        {
            return(Wait(async() =>
            {
                while (MethodChainContext.Frameworks.Any(x => x.IsNavigating))
                {
                    await Task.Delay(100);
                }

                var methodChainContext = new MethodChainContext(MethodChainContext.Frameworks, MethodChainContext.AutomationEngine);
                var expectNode = methodChainContext.Enqueue(new ExpectMethodChainEntryPoint());

                predicate(expectNode);

                try
                {
                    await methodChainContext.RunAllAsync();
                    return true;
                }
                catch (Exception ex) when(ex.InnerException is ExpectationNotMetException)
                {
                }
                catch (ExpectationNotMetException)
                {
                }

                return false;
            }));
        }
 private TNextMethodChainNode Delegate()
 {
     lock (MethodChainContext)
     {
         return(MethodChainContext.Enqueue(new TNextMethodChainNode()));
     }
 }
Esempio n. 3
0
 public IDomElementFromTargetsMethodChainNode <IBaseMethodChainNode, ISelectByFromTargetMethodChainNode> ByValues(params string[] values)
 {
     return(MethodChainContext.Enqueue(SelectByMethodChainNode.ByValues(values)));
 }
Esempio n. 4
0
 public IDomElementFromTargetsMethodChainNode <IBaseMethodChainNode, ISelectByFromTargetMethodChainNode> ByIndices(params int[] indices)
 {
     return(MethodChainContext.Enqueue(SelectByMethodChainNode.ByIndices(indices)));
 }
Esempio n. 5
0
 public IDomElementInTargetsMethodChainNode <IBaseMethodChainNode, IExpectValueOfTargetsMethodChainNode> Value(string value)
 {
     return(MethodChainContext.Enqueue(new ExpectValueMethodChainNode(value)));
 }
Esempio n. 6
0
 public IDomElementInTargetsMethodChainNode <IBaseMethodChainNode, IExpectTextInTargetsMethodChainNode> Text(string text)
 {
     return(MethodChainContext.Enqueue(new ExpectTextMethodChainNode(text)));
 }
Esempio n. 7
0
 public IExpectExistsMethodChainNode Exists(IReadOnlyList <IDomElement> elements)
 {
     return(MethodChainContext.Enqueue(new ExpectExistsMethodChainNode(elements)));
 }
Esempio n. 8
0
 public IExpectExistsMethodChainNode Exists(string selector)
 {
     return(MethodChainContext.Enqueue(new ExpectExistsMethodChainNode(selector)));
 }
Esempio n. 9
0
 public IDomElementOfTargetsMethodChainNode <IBaseMethodChainNode, IExpectCountOfTargetsMethodChainNode> Count(int count)
 {
     return(MethodChainContext.Enqueue(new ExpectCountMethodChainNode(count)));
 }
Esempio n. 10
0
 public IDomElementOfTargetsMethodChainNode <IBaseMethodChainNode, IExpectClassesOfTargetsMethodChainNode> Classes(params string[] classNames)
 {
     return(MethodChainContext.Enqueue(new ExpectClassesMethodChainNode(classNames)));
 }
 public IWaitMethodChainNode Wait(Func <Task <bool> > predicate) => MethodChainContext.Enqueue(new WaitMethodChainNode(predicate));
 public IOpenMethodChainNode Open(string uri) =>
 MethodChainContext.Enqueue(new OpenMethodChainNode(uri));
 public IFindMethodChainNode Find(string selector) =>
 MethodChainContext.Enqueue(new FindMethodChainNode(selector));
 public IDomElementInTargetsMethodChainNode <IBaseMethodChainNode, IEnterInTargetMethodChainNode> Enter(string text) =>
 MethodChainContext.Enqueue(new EnterMethodChainNode(text));