Ejemplo n.º 1
0
        protected override ValidationMessage <TOwner> CreateAssociatedControl(Control <TOwner> control)
        {
            var validationMessageDefinition = UIComponentResolver.GetControlDefinition(typeof(ValidationMessage <TOwner>));

            PlainScopeLocator scopeLocator = new PlainScopeLocator(By.XPath("ancestor::" + validationMessageDefinition.ScopeXPath))
            {
                SearchContext = control.Scope
            };

            return(Component.Controls.Create <ValidationMessage <TOwner> >(control.ComponentName, scopeLocator));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Fors the specified control selector.
        /// </summary>
        /// <param name="controlSelector">
        ///   The control selector.
        /// </param>
        /// <returns></returns>
        public ValidationMessage <TOwner> For(Func <TOwner, IControl <TOwner> > controlSelector)
        {
            var validationMessageDefinition = UIComponentResolver.GetControlDefinition(typeof(ValidationMessage <TOwner>));

            IControl <TOwner> boundControl = controlSelector(Component.Owner);

            PlainScopeLocator scopeLocator = new PlainScopeLocator(By.XPath("ancestor::" + validationMessageDefinition.ScopeXPath))
            {
                SearchContext = boundControl.Scope
            };

            return(Component.Controls.Create <ValidationMessage <TOwner> >(boundControl.ComponentName, scopeLocator));
        }
Ejemplo n.º 3
0
 public static Clickable <TNavigateTo, TOwner> GetControl <TNavigateTo, TOwner>(this ClickableDelegate <TNavigateTo, TOwner> clickable)
     where TNavigateTo : PageObject <TNavigateTo>
     where TOwner : PageObject <TOwner>
 {
     return((Clickable <TNavigateTo, TOwner>)UIComponentResolver.GetControlByDelegate <TOwner>(clickable));
 }
Ejemplo n.º 4
0
 public static Button <TOwner> GetControl <TOwner>(this ButtonDelegate <TOwner> clickable)
     where TOwner : PageObject <TOwner>
 {
     return((Button <TOwner>)UIComponentResolver.GetControlByDelegate <TOwner>(clickable));
 }
Ejemplo n.º 5
0
 public string UIComponentResolver_ResolveControlName(Expression <Func <TestPage.TestControl, bool> > expression)
 {
     return(UIComponentResolver.ResolveControlName <TestPage.TestControl, TestPage>(expression));
 }