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); } }
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); }
public static PortalNavigationLinkAttribute GetPortalNavigationLinkAttribute( this PageShortname enumValue) { return(GetAttribute <PortalNavigationLinkAttribute>(enumValue)); }
public static string GetUrl(this PageShortname enumValue, string baseUrl) { var suburl = enumValue.GetSubUrl(); return(baseUrl + suburl ?? ""); }
public static string GetSubUrl(this PageShortname enumValue) { return(enumValue.GetPortalNavigationLinkAttribute()?.Description); }