/// <summary> /// Проверить ожидаемую таблицу с фактической на UI с учетом порядка /// </summary> /// <typeparam name="T">Тип элемента таблицы</typeparam> /// <param name="grid">Элемент содержащий фактическую таблицу на UI</param> /// <param name="locator">Локатор фактической таблицы</param> /// <param name="expectedTable">Ожидаемая таблица</param> /// <param name="tableIndex">Индекс фактической таблицы</param> public static void CheckTablesWithOrder <T>(DataGridComponent grid, string locator, List <T> expectedTable, int tableIndex = 0) { GetUITable <T>(grid, locator, tableIndex) .ShouldBeEquivalentTo(expectedTable, options => options.WithStrictOrdering(), $"Table {typeof(T).FullName} не соответствуют ожидаемым"); }
private DataGridComponent FindEpaCard(string card) { var cardEPA = new DataGridComponent(SearchElementByCss(EpaymentsCardBlock)) .FindElementsContainsText(card, "/ancestor::*[@card='card']") .SingleOrDefault(); return(new DataGridComponent(cardEPA)); }
public EPACardsSection GetEPACardsTable() { var epaCardsValues = new DataGridComponent(menu.FindElement(EPACardsBlock)) .FindElements(eWalletBalance).ToList() .Select(it => it.Text.Replace("$", "").Replace("€", "").Replace("₽", "").Replace(" ", "")); return(new EPACardsSection { USD = Decimal.Parse(epaCardsValues.ToList()[0]), //Check if EUR section exists EUR = Decimal.Parse(epaCardsValues.Count() > 1 ? epaCardsValues.ToList()[1] : "0"), }); }
public EWalletSection GetEwalletTable() { var ewalletValues = new DataGridComponent(menu.FindElement(eWalletBlock)) .FindElements(eWalletBalance).ToList() .Select(it => it.Text.Replace("$", "").Replace("€", "").Replace("₽", "").Replace(" ", "")); return(new EWalletSection { USD = Decimal.Parse(ewalletValues.ToList()[0]), EUR = Decimal.Parse(ewalletValues.ToList()[1]), RUB = Decimal.Parse(ewalletValues.ToList()[2]) }); }
/// <summary> /// Convert any Table from UI /// </summary> /// <returns>Found table</returns> public static IEnumerable <T> GetUITable <T>(DataGridComponent component, string locator, int tableIndex) { var table = component.FindElements(locator + " table tbody")[tableIndex]; int counter = 0; while (!table.Displayed && counter < 10) { Thread.Sleep(200); counter++; } return(ConvertTableRowsToList <T>(table.FindElements(By.CssSelector("tr")))); }
public void Open(string docName) { var path = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\Resources\" + docName)); DriverManager.GetWebDriver().Navigate().GoToUrl("file:///" + path); SelectFragment.SetOption("Sandbox"); DataGridComponent partnerRegistrationPage = new DataGridComponent(SearchElementByCss("tbody")); _context.UserExternalCode = partnerRegistrationPage.FindElement("#clientID").GetAttribute("value"); partnerRegistrationPage .ClearText("#partnerSecretKey") .SendText("#partnerSecretKey", "WQ7kQvMGp5+9KT6BaGBL") .ClearText("#partnerId") .SendText("#partnerId", "58") .ClickOnElement("input[type=submit]"); InitPage(); }
public App() { InitializeComponent(); DataGridComponent.Init(); MainPage = new MainPage(); }
public MenuPanel() { menu = new DataGridComponent(SearchElementByCss(Sidebar)); }