Example #1
0
        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");
            }
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 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");
 }
Example #5
0
 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");
 }