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));
        }
Esempio 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));
        }
 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));
 }
Esempio n. 4
0
 public static Button <TOwner> GetControl <TOwner>(this ButtonDelegate <TOwner> clickable)
     where TOwner : PageObject <TOwner>
 {
     return((Button <TOwner>)UIComponentResolver.GetControlByDelegate <TOwner>(clickable));
 }
Esempio n. 5
0
 public string UIComponentResolver_ResolveControlName(Expression <Func <TestPage.TestControl, bool> > expression)
 {
     return(UIComponentResolver.ResolveControlName <TestPage.TestControl, TestPage>(expression));
 }