コード例 #1
0
 public string this[string attributeName]
 {
     get {
         ElementFound elementFound = Now();
         return(elementFound[attributeName]);
     }
 }
コード例 #2
0
ファイル: FillInWith.cs プロジェクト: AidenMontgomery/coypu
 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;
 }
コード例 #3
0
ファイル: DriverScope.cs プロジェクト: hnhan/coypu
 protected internal virtual ElementFound FindElement()
 {
     if (element == null || element.Stale(ElementFinder.Options))
     {
         element = disambiguationStrategy.ResolveQuery(ElementFinder);
     }
     return(element);
 }
コード例 #4
0
ファイル: DriverScope.cs プロジェクト: bszypelow/coypu
 protected internal ElementFound FindElement()
 {
     if (element == null || element.Stale)
     {
         element = elementFinder.Find();
     }
     return(element);
 }
コード例 #5
0
ファイル: FillInWith.cs プロジェクト: MatteS75/coypu
 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;
 }
コード例 #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
         });
     }
 }
コード例 #7
0
ファイル: FillIn.cs プロジェクト: AidenMontgomery/coypu
 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;
 }
コード例 #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;
 }
コード例 #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));
            }
        }
コード例 #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("");
                }
            }
        }
コード例 #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("");
                }
            }
        }
コード例 #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("");
                    }
                }
            }
        }
コード例 #13
0
 public void StubFrame(string locator, ElementFound frame, Scope scope)
 {
     stubbedFrames.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = frame
     });
 }
コード例 #14
0
 public void StubSection(string locator, ElementFound section, Scope scope)
 {
     stubbedSections.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = section
     });
 }
コード例 #15
0
 public void StubFieldset(string locator, ElementFound fieldset, Scope scope)
 {
     stubbedFieldsets.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = fieldset
     });
 }
コード例 #16
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope)
     : base(null, scope)
 {
     _elementFound = elementFound;
 }
コード例 #17
0
 public AlwaysFindsElementFinder(ElementFound element) : base(null, null, null)
 {
     this.element = element;
 }
コード例 #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");
 }
コード例 #19
0
ファイル: SnapshotElementScope.cs プロジェクト: hnhan/coypu
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope, Options options)
     : base(null, scope)
 {
     this.elementFound = elementFound;
     this.options      = options;
 }
コード例 #20
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope, Options options)
     : base(null, scope)
 {
     this.elementFound = elementFound;
     this.options = options;
 }
コード例 #21
0
        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);
        }
コード例 #22
0
        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);
            }
        }
コード例 #23
0
 public void StubId(string id, ElementFound element, Scope scope)
 {
     stubbedIDs.Add(new ScopedStubResult {
         Locator = id, Scope = scope, Result = element
     });
 }
コード例 #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)));
 }
コード例 #25
0
 public void StubWindow(string locator, ElementFound window, Scope scope)
 {
     stubbedWindows.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = window
     });
 }
コード例 #26
0
 public void StubCurrentWindow(ElementFound window)
 {
     stubbedCurrentWindow = window;
 }
コード例 #27
0
ファイル: StubDriver.cs プロジェクト: afinzel/coypu
 public void SetScope(ElementFound findScope)
 {
 }
コード例 #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);
 }
コード例 #29
0
 public AlwaysFindsElementFinder(ElementFound element)
     : base(null,null,null)
 {
     this.element = element;
 }
コード例 #30
0
 public void StubXPath(string cssSelector, ElementFound result, Scope scope)
 {
     stubbedXPathResults.Add(new ScopedStubResult {
         Locator = cssSelector, Scope = scope, Result = result
     });
 }
コード例 #31
0
 internal SnapshotElementScope(ElementFound elementFound, DriverScope scope) : base(null, scope)
 {
     _elementFound = elementFound;
 }
コード例 #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));
 }
コード例 #33
0
ファイル: StubDriver.cs プロジェクト: kberridge/coypu
 public void SetScope(ElementFound findScope)
 {
 }
コード例 #34
0
 public void StubLink(string locator, ElementFound element, Scope scope)
 {
     stubbedLinks.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = element
     });
 }
コード例 #35
0
 public void OnElementFound(EventArgs e)
 {
     Automation.RemoveAllEventHandlers();
     ElementFound?.Invoke(this, e);
 }
コード例 #36
0
 public void StubField(string locator, ElementFound element, Scope scope)
 {
     stubbedTextFields.Add(new ScopedStubResult {
         Locator = locator, Scope = scope, Result = element
     });
 }