Пример #1
0
        public static void NavigateToPage(DriverContext driver, PageShortname pageName, string baseUrl, string subUrl = "")
        {
            var url     = pageName.GetUrl(baseUrl) + subUrl;
            var currUrl = driver.Driver.Url;

            if (currUrl != url)
            {
                driver.Driver.Navigate().GoToUrl(url);
            }
        }
Пример #2
0
        private static T GetAttribute <T>(PageShortname enumValue) where T : Attribute
        {
            var memberInfo = typeof(PageShortname).GetMember(enumValue.ToString())
                             .FirstOrDefault();

            if (memberInfo != null)
            {
                var attribute = (T)
                                memberInfo.GetCustomAttributes(typeof(T), false)
                                .FirstOrDefault();
                return(attribute);
            }
            return(null);
        }
Пример #3
0
 public static PortalNavigationLinkAttribute GetPortalNavigationLinkAttribute(
     this PageShortname enumValue)
 {
     return(GetAttribute <PortalNavigationLinkAttribute>(enumValue));
 }
Пример #4
0
        public static string GetUrl(this PageShortname enumValue, string baseUrl)
        {
            var suburl = enumValue.GetSubUrl();

            return(baseUrl + suburl ?? "");
        }
Пример #5
0
 public static string GetSubUrl(this PageShortname enumValue)
 {
     return(enumValue.GetPortalNavigationLinkAttribute()?.Description);
 }