Ejemplo n.º 1
0
 public string this[string attributeName]
 {
     get {
         ElementFound elementFound = Now();
         return(elementFound[attributeName]);
     }
 }
Ejemplo n.º 2
0
 internal FillInWith(ElementFound element, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options)
 {
     this.element       = element;
     this.driver        = driver;
     this.robustWrapper = robustWrapper;
     this.scope         = scope;
     this.options       = options;
 }
Ejemplo n.º 3
0
 protected internal virtual ElementFound FindElement()
 {
     if (element == null || element.Stale(ElementFinder.Options))
     {
         element = disambiguationStrategy.ResolveQuery(ElementFinder);
     }
     return(element);
 }
Ejemplo n.º 4
0
 protected internal ElementFound FindElement()
 {
     if (element == null || element.Stale)
     {
         element = elementFinder.Find();
     }
     return(element);
 }
Ejemplo n.º 5
0
 internal FillInWith(ElementFound element, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options)
 {
     this.element = element;
     this.driver = driver;
     this.robustWrapper = robustWrapper;
     this.scope = scope;
     this.options = options;
 }
Ejemplo n.º 6
0
 public void StubCss(string cssSelector, Regex textPattern, ElementFound result, Scope scope)
 {
     if (result != null)
     {
         stubbedCssResults.Add(new ScopedStubResult {
             Locator = cssSelector, TextPattern = textPattern, Scope = scope, Result = result
         });
     }
 }
Ejemplo n.º 7
0
 internal FillIn(Driver driver, DriverScope scope, string locator, ElementFound element, string value, bool forceAllEvents, Options options)
     : base(driver,options)
 {
     this.locator = locator;
     this.element = element;
     this.scope = scope;
     this.value = value;
     this.forceAllEvents = forceAllEvents;
 }
Ejemplo n.º 8
0
 internal FillIn(Driver driver, DriverScope scope, string locator, ElementFound element, string value, bool forceAllEvents, Options options)
     : base(driver, options)
 {
     this.locator        = locator;
     this.element        = element;
     this.scope          = scope;
     this.value          = value;
     this.forceAllEvents = forceAllEvents;
 }
Ejemplo n.º 9
0
        public T GetElementByID(int ID)
        {
            T Element = ElementList.SingleOrDefault(ElementFound => (ID == ElementFound.GetID()));

            if (null != Element)
            {
                return((T)Element.Clone());
            }
            else
            {
                return(default(T));
            }
        }
Ejemplo n.º 10
0
        public void FoundTime(int numberOfGames, ref List <Game> gameArr)
        {
            int time;
            EventHandler <Game> pr = Game.ShortInfo;

            Console.WriteLine("Enter how much time you are willing to spend on the game : ");
            time = ValidationInt();
            Console.WriteLine("Games suitable for you: ");
            for (int i = 0; i < numberOfGames; i++)
            {
                if (gameArr[i].TimeSearch(time) == 1)
                {
                    ElementFound?.Invoke(this, gameArr[i]);
                    Console.WriteLine("");
                }
            }
        }
Ejemplo n.º 11
0
        public void FoundDoubleReating(int numberOfGames, ref List <Game> gameArr)
        {
            float reatingFirst, reatingSecond;
            EventHandler <Game> pr = Game.ShortInfo;

            Console.WriteLine("Enter the minimum player rating: ");
            reatingFirst = Validationfloat();
            Console.WriteLine("Enter the minimum press rating: ");
            reatingSecond = Validationfloat();
            Console.WriteLine("Games suitable for you: ");
            for (int i = 0; i < numberOfGames; i++)
            {
                if (gameArr[i].DoubleReatingSearch(reatingFirst, reatingSecond) == 1)
                {
                    ElementFound?.Invoke(this, gameArr[i]);
                    Console.WriteLine("");
                }
            }
        }
Ejemplo n.º 12
0
        public void FoundAgeReating(int numberOfGames, ref List <Game> gameArr)
        {
            float reatingFirst;
            int   age;

            EventHandler <Game> pr = Game.ShortInfo;

            Console.WriteLine("Enter what age rating do you belong to: ");
            age = ValidationAgeRating();
            Console.WriteLine("Enter minimum rating(player or press): ");
            reatingFirst = Validationfloat();
            Console.WriteLine("Games suitable for you: ");
            for (int i = 0; i < numberOfGames; i++)
            {
                for (int j = 0; j <= age; j++)
                {
                    if (gameArr[i].ReatingSearch(reatingFirst) == 1 && (gameArr[i])[j] == 1)
                    {
                        ElementFound?.Invoke(this, gameArr[i]);
                        Console.WriteLine("");
                    }
                }
            }
        }
Ejemplo n.º 13
0
 public void StubFrame(string locator, ElementFound frame, Scope scope)
 {
     stubbedFrames.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = frame
     });
 }
Ejemplo n.º 14
0
 public void StubSection(string locator, ElementFound section, Scope scope)
 {
     stubbedSections.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = section
     });
 }
Ejemplo n.º 15
0
 public void StubFieldset(string locator, ElementFound fieldset, Scope scope)
 {
     stubbedFieldsets.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = fieldset
     });
 }
Ejemplo n.º 16
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope)
     : base(null, scope)
 {
     _elementFound = elementFound;
 }
Ejemplo n.º 17
0
 public AlwaysFindsElementFinder(ElementFound element) : base(null, null, null)
 {
     this.element = element;
 }
Ejemplo n.º 18
0
 private async void StockElementGuessed(string element_found)
 {
     ElementFound elementFound = new ElementFound(parameter.connectedUser.username, parameter.trackGuessed.id, element_found, DateTime.Now.ToString());
     await apiConnect.PostAsJsonAsync(elementFound, "http://localhost/api/stockelementguessed.php");
 }
Ejemplo n.º 19
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope, Options options)
     : base(null, scope)
 {
     this.elementFound = elementFound;
     this.options      = options;
 }
Ejemplo n.º 20
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope, Options options)
     : base(null, scope)
 {
     this.elementFound = elementFound;
     this.options = options;
 }
        protected void VerifyFoundRobustly <T>(Func <string, T, Options, Scope> scope, int driverCallIndex, string locator, T text, ElementFound expectedDeferredResult, ElementFound expectedImmediateResult, Options options)
        {
            var scopedResult = scope(locator, text, options).Now();

            VerifyFoundRobustly(driverCallIndex, expectedDeferredResult, expectedImmediateResult, options, scopedResult);
        }
        protected void Should_find_robustly <T>(Func <string, T, Options, bool> subject, Func <string, T, Options, bool> scope, Action <string, Regex, ElementFound, Scope> stub, T suppliedText, Regex matchingPattern, bool expectedImmediateResult, bool expectedDeferredResult, ElementFound stubCssResult)
        {
            var locator = "Find me " + DateTime.Now.Ticks;

            var individualTimeout = TimeSpan.FromMilliseconds(DateTime.UtcNow.Millisecond);

            spyRobustWrapper.AlwaysReturnFromRobustly(expectedImmediateResult);

            stub(locator, matchingPattern, stubCssResult, browserSession);
            stub(locator, matchingPattern, stubCssResult, elementScope);

            var options = new Options {
                Timeout = individualTimeout
            };

            VerifyFoundRobustly(subject, 0, locator, suppliedText, expectedDeferredResult, expectedImmediateResult, options);

            if (scope != null)
            {
                VerifyFoundRobustly(scope, 1, locator, suppliedText, expectedDeferredResult, expectedImmediateResult, options);
            }
        }
Ejemplo n.º 23
0
 public void StubId(string id, ElementFound element, Scope scope)
 {
     stubbedIDs.Add(new ScopedStubResult {
         Locator = id, Scope = scope, Result = element
     });
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Fill in a previously found text field
 /// </summary>
 /// <param name="element">The text field</param>
 /// <returns>With</returns>
 public FillInWith FillIn(ElementFound element, Options options = null)
 {
     return(new FillInWith(element, driver, robustWrapper, this, SetOptions(options)));
 }
Ejemplo n.º 25
0
 public void StubWindow(string locator, ElementFound window, Scope scope)
 {
     stubbedWindows.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = window
     });
 }
Ejemplo n.º 26
0
 public void StubCurrentWindow(ElementFound window)
 {
     stubbedCurrentWindow = window;
 }
Ejemplo n.º 27
0
 public void SetScope(ElementFound findScope)
 {
 }
Ejemplo n.º 28
0
 public void StubId(string id, ElementFound element, Scope scope, SessionConfiguration options)
 {
     StubAllXPath(new Html(options.Browser.UppercaseTagNames).Id(id, options), new[] { element }, scope, options);
 }
 public AlwaysFindsElementFinder(ElementFound element)
     : base(null,null,null)
 {
     this.element = element;
 }
Ejemplo n.º 30
0
 public void StubXPath(string cssSelector, ElementFound result, Scope scope)
 {
     stubbedXPathResults.Add(new ScopedStubResult {
         Locator = cssSelector, Scope = scope, Result = result
     });
 }
Ejemplo n.º 31
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope) : base(null, scope)
 {
     _elementFound = elementFound;
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Fill in a previously found text field
 /// </summary>
 /// <param name="element">The text field</param>
 /// <returns>With</returns>
 public FillInWith FillIn(ElementFound element, Options options = null)
 {
     return new FillInWith(element, driver, robustWrapper, this, SetOptions(options));
 }
Ejemplo n.º 33
0
 public void SetScope(ElementFound findScope)
 {
 }
Ejemplo n.º 34
0
 public void StubLink(string locator, ElementFound element, Scope scope)
 {
     stubbedLinks.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = element
     });
 }
 public void OnElementFound(EventArgs e)
 {
     Automation.RemoveAllEventHandlers();
     ElementFound?.Invoke(this, e);
 }
Ejemplo n.º 36
0
 public void StubField(string locator, ElementFound element, Scope scope)
 {
     stubbedTextFields.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = element
     });
 }