コード例 #1
0
        public void ClickOnNewProjectCrashTest()
        {
            Application app = Application.Launch(designer_executable);

            Assert.IsNotNull(app);
            Core.UIItems.WindowItems.Window window = app.GetWindow("Designer");

            //Create new schema
            IUIItem new_project_button = window.Get(SearchCriteria.ByText("New Project"));

            Assert.IsNotNull(new_project_button);
            System.Drawing.Point pt = new System.Drawing.Point(System.Convert.ToInt32(new_project_button.Location.X) + 5, System.Convert.ToInt32(new_project_button.Location.Y) + 5);

            //Do click several times
            window.Mouse.Click(pt);
            System.Threading.Thread.Sleep(1000);

            window.Mouse.Click(pt);
            System.Threading.Thread.Sleep(1000);

            window.Mouse.Click(pt);

            window.Close();

            Assert.IsTrue(window.IsClosed);
            Assert.IsTrue(app.HasExited);
        }
コード例 #2
0
 public GridWrapper(Core.UIItems.WindowItems.Window window, IUIItem grid)
 {
     this.grid   = grid;
     this.window = window;
     Assert.IsNotNull(grid);
     Assert.IsNotNull(window);
 }
コード例 #3
0
        public ToolBoxWrapper(Core.UIItems.WindowItems.Window mainWindow)
        {
            Assert.IsNotNull(mainWindow);
            uiItem = mainWindow.Get <Panel>(SearchCriteria.ByAutomationId("_toolBox"));
            Assert.IsNotNull(uiItem);

            this.mainWindow = mainWindow;
        }
コード例 #4
0
        public void SetUp()
        {
            app = Application.Launch(designer_executable);
            Assert.IsNotNull(app);

            mainWindow = app.GetWindow("Designer");
            Assert.IsNotNull(mainWindow);
        }
コード例 #5
0
        static public void CreateNewSchema(Core.UIItems.WindowItems.Window mainWindow)
        {
            IUIItem new_schema_button = mainWindow.Get(SearchCriteria.ByText("New Schema"));

            Assert.IsNotNull(new_schema_button);
            Point pt = new Point(Convert.ToInt32(new_schema_button.Location.X) + 5, Convert.ToInt32(new_schema_button.Location.Y) + 5);

            mainWindow.Mouse.Click(pt);
        }
コード例 #6
0
        public void CloseMainFormWithEmptyProject()
        {
            //Should not show any additional dialogs
            Application app = Application.Launch(designer_executable);

            Assert.IsNotNull(app);
            Core.UIItems.WindowItems.Window window = app.GetWindow("Designer");
            window.Close();

            Assert.IsTrue(app.HasExited);
        }
コード例 #7
0
        public void TearDown()
        {
            mainWindow.Close();

            //Check that there is Save dialog
            Core.UIItems.WindowItems.Window saveDlg = Helpers.FindTopWindow(app, "SaveDocumentsDialog");
            if (saveDlg != null)
            {
                Button saveDlgNoBtn = saveDlg.Get <Button>(SearchCriteria.ByAutomationId("noButton"));
                Assert.IsNotNull(saveDlgNoBtn);
                saveDlgNoBtn.Click();
            }

            Assert.IsTrue(mainWindow.IsClosed);
            Assert.IsTrue(app.HasExited);
        }
コード例 #8
0
        static public object GetPropertyGridValue(Core.UIItems.WindowItems.Window mainWindow, string Name)
        {
            Panel propertyView = mainWindow.Get <Panel>(SearchCriteria.ByAutomationId("propertyGrid"));

            Assert.IsNotNull(propertyView);
            System.Windows.Automation.AutomationElement elem = propertyView.GetElement(SearchCriteria.ByControlType(System.Windows.Automation.ControlType.Table));
            Assert.IsNotNull(elem);

            Core.UIItems.TableItems.Table table = new Core.UIItems.TableItems.Table(elem, new Core.UIItems.Actions.ProcessActionListener(elem));
            Assert.IsNotNull(table);

            System.Windows.Automation.AutomationElement row = table.GetElement(SearchCriteria.ByText(Name));
            Assert.IsNotNull(row);

            object obj = row.GetCurrentPropertyValue(ValuePattern.ValueProperty);

            Assert.IsNotNull(obj);
            return(obj);
        }
コード例 #9
0
        public void SaveProjectOnClosing()
        {
            Application app = Application.Launch(designer_executable);

            Assert.IsNotNull(app);
            Core.UIItems.WindowItems.Window window = app.GetWindow("Designer");

            //Create new schema
            IUIItem new_schema_button = window.Get(SearchCriteria.ByText("New Schema"));

            Assert.IsNotNull(new_schema_button);
            System.Drawing.Point pt = new System.Drawing.Point(System.Convert.ToInt32(new_schema_button.Location.X) + 5, System.Convert.ToInt32(new_schema_button.Location.Y) + 5);
            window.Mouse.Click(pt);

            window.Close();
            Assert.IsFalse(window.IsClosed);

            //Check that there is Save dialog
            Core.UIItems.WindowItems.Window saveDlg = null;
            foreach (Core.UIItems.WindowItems.Window wnd in app.GetWindows())
            {
                if (wnd.PrimaryIdentification == "SaveDocumentsDialog")
                {
                    saveDlg = wnd;
                    break;
                }
            }
            Assert.IsNotNull(saveDlg);
            Button saveDlgNoBtn = saveDlg.Get <Button>(SearchCriteria.ByAutomationId("noButton"));

            Assert.IsNotNull(saveDlgNoBtn);
            saveDlgNoBtn.Click();

            Assert.IsTrue(window.IsClosed);
            Assert.IsTrue(app.HasExited);
        }