public void AssertFolderIsOpenInPanel(Table table) { Scope.DefaultWindow = Scope.Application.Application.GetWindow(ConfigurationManager.AppSettings["MainWindowName"]); foreach (var row in table.Rows) { var folderPath = row["Folder path"]; var panel = row["Panel"]; MainView.ListBoxPanel(PanelBl.GetPanelIndex(panel)).Click(); AssertionUtil.AssertNotNull(MainView.PanelCurrentDirectory(folderPath), "Current panel directory is incorrect"); } }
public static UIItem Find(TreeScope treeScope, AutomationProperty property, object value, Window window = null) { if (window == null) { window = Scope.DefaultWindow; } UIItem element = new UIItem(window.AutomationElement.FindFirst(treeScope, new PropertyCondition(property, value)), new NullActionListener()); AssertionUtil.AssertNotNull(element, "Element is not found"); LoggerUtil.Info($"Element {element.Name} is found"); return(element); }
public static UIItem FindItemByIndex(TreeScope treeScope, Condition condition, int index) { var elements = Scope.DefaultWindow.AutomationElement.FindAll(treeScope, condition); UIItem element = null; for (var i = 0; i < elements.Count; i++) { if (i == index) { element = new UIItem(elements[i], new NullActionListener()); } } AssertionUtil.AssertNotNull(element, "Element is not found"); LoggerUtil.Info($"Element {element.Name} is found"); return(element); }
public void AssertWarningWindowIsOpen() { AssertionUtil.AssertTrue(WindowBl.IsDefaultWindowCurrentlyActive(ConfigurationManager.AppSettings["ModalWindowName"]), "Modal window is not active"); AssertionUtil.AssertNotNull(MainView.LabelNoFilesSelected( Scope.DefaultWindow.ModalWindow(ConfigurationManager.AppSettings["ModalWindowName"])), "No label found"); }
public void AssertThenOnlyItemIsFound(string filename) { AssertionUtil.AssertEquals(FindFilesView.ListBoxSearchResults.Items.Count, 2, "Results list size is incorrect"); AssertionUtil.AssertNotNull(FindFilesView.ListItemSearchResultsCount(1, 0), "Count is incorrect"); AssertionUtil.AssertNotNull(FindFilesView.ListItemSearchResult(filename), "Found item is incorrect"); }