예제 #1
0
        private StubElement StubField(string locator, Options options = null)
        {
            var stubField = new StubElement{Id = Guid.NewGuid().ToString()};
            var fieldXpath = new Html(sessionConfiguration.Browser.UppercaseTagNames).Field(locator, options ?? sessionConfiguration);
            driver.StubAllXPath(fieldXpath, new []{stubField}, browserSession, options ?? sessionConfiguration);

            return stubField;
        }
예제 #2
0
        private StubElement StubOption(string fieldLocator, string optionLocator, Options options = null)
        {
            var stubSelect = new StubElement { Id = Guid.NewGuid().ToString() };
            var stubOption = new StubElement { Id = Guid.NewGuid().ToString() };
            var selectXpath = new Html(sessionConfiguration.Browser.UppercaseTagNames).Select(fieldLocator, options ?? sessionConfiguration);
            var optionXpath = new Html(sessionConfiguration.Browser.UppercaseTagNames).Option(optionLocator, options ?? sessionConfiguration);
            driver.StubAllXPath(selectXpath, new[] { stubSelect }, browserSession, options ?? sessionConfiguration);
            driver.StubAllXPath(optionXpath, new[] { stubOption }, new SnapshotElementScope(stubSelect, browserSession, options), options ?? sessionConfiguration);

            return stubOption;
        }
예제 #3
0
 protected override Func<string, Options, string> GetQuery(Html html)
 {
     return ((locator, options) =>
         {
             if (string.IsNullOrEmpty(text))
             {
                 return Locator;
             }
             else
             {
                 return Locator + XPath.Where(html.IsText(text, options));
             }
         }); 
 }
예제 #4
0
 protected override Func<string, Options, string> GetQuery(Html html)
 {
     return html.Fieldset;
 }
예제 #5
0
 protected override Func<string, Options, string> GetQuery(Html html)
 {
     return html.Button;
 }
예제 #6
0
        private StubElement StubButtonToBeClicked(string locator, Options options = null)
        {
            var buttonToBeClicked = new StubElement {Id = Guid.NewGuid().ToString()};
            var buttonXpath = new Html(browserSession.Browser.UppercaseTagNames).Button(locator, options ?? sessionConfiguration);

            driver.StubAllXPath(buttonXpath, new []{buttonToBeClicked}, browserSession, options ?? sessionConfiguration);

            return buttonToBeClicked;
        }
예제 #7
0
 protected abstract Func<string, Options, string> GetQuery(Html html);
예제 #8
0
 internal override IEnumerable<Element> Find(Options options)
 {
     var html = new Html(Scope.Browser.UppercaseTagNames);
        return Driver.FindAllXPath(GetQuery(html)(Locator, options), Scope, options);
 }
예제 #9
0
 private StubElement StubLinkToBeClicked(string locator, Options options = null)
 {
     var linkToBeClicked = new StubElement { Id = Guid.NewGuid().ToString() };
     var linkXPath = new Html(sessionConfiguration.Browser.UppercaseTagNames).Link(locator, options ?? sessionConfiguration);
     driver.StubAllXPath(linkXPath, new[]{linkToBeClicked}, browserSession, options ?? sessionConfiguration);
     return linkToBeClicked;
 }