Example #1
0
        public void ExportHlrCancelFileDlg()
        {
            // Cancel FileDlg
            MainWindow.Ribbon.SelectGroup("Toolbox");
            MainWindow.Ribbon.ClickButton("ExportViewHlr");
            var dlg = new WindowAdaptor(MainWindow, "ExportViewportHlr");

            dlg.ClickButton("Ok");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.ClickButton(FileDialogAdaptor.Button.Cancel);
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExportViewportHlr"));
        }
        public void ExportCancelFileDlg()
        {
            TestDataGenerator.GenerateSketch(MainWindow);
            MainWindow.Ribbon.ClickButton("CloseSketchEditor");

            MainWindow.Ribbon.SelectTab("Model");
            Assume.That(MainWindow.Ribbon.IsButtonEnabled("CreatePipe"));
            MainWindow.Ribbon.ClickButton("CreatePipe");

            MainWindow.Ribbon.SelectTab("Toolbox");
            Assert.IsTrue(MainWindow.Ribbon.IsButtonEnabled("ExportPipeDrawing"));
            MainWindow.Ribbon.ClickButton("ExportPipeDrawing");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.ClickButton(FileDialogAdaptor.Button.Cancel);
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
        }
Example #3
0
        public void CreateNewModelSaveCancel()
        {
            TestDataGenerator.GenerateBox(MainWindow);
            MainWindow.Ribbon.ClickFileMenuItem("NewModel");

            // Save model?
            var taskDlg = new TaskDialogAdaptor(MainWindow);

            Assert.That(taskDlg.Title, Is.EqualTo("Unsaved Changes"));
            taskDlg.ClickButton(TaskDialogAdaptor.Button.Yes);

            var fileDlg = new FileDialogAdaptor(MainWindow);

            Assert.That(fileDlg.Title, Is.EqualTo("Saving Model..."));
            fileDlg.ClickButton(FileDialogAdaptor.Button.Cancel);

            // Check that button box is still there
            Assert.AreEqual(1, MainWindow.Document.GetBodyItems().Count());
        }
Example #4
0
        public void CloseApplicationSaveChangesCancel2()
        {
            TestDataGenerator.GenerateBox(MainWindow);
            MainWindow.ClickCloseButton();

            // Save model?
            var dlg = new TaskDialogAdaptor(MainWindow);

            Assert.That(dlg.Title, Is.EqualTo("Unsaved Changes"));
            dlg.ClickButton(TaskDialogAdaptor.Button.Yes);

            var fileDlg = new FileDialogAdaptor(MainWindow);

            Assert.That(fileDlg.Title, Is.EqualTo("Saving Model..."));
            fileDlg.ClickButton(FileDialogAdaptor.Button.Cancel);

            // Check that button box is still there
            Assert.AreEqual(1, MainWindow.Document.GetBodyItems().Count());
        }
Example #5
0
        public void OpenExistingModel()
        {
            WelcomeDialog.ClickButton("OpenExistingButton");
            var fileDlg = new FileDialogAdaptor(WelcomeDialog);

            Assert.AreEqual("Open Model...", fileDlg.Title);
            fileDlg.ClickButton(FileDialogAdaptor.Button.Cancel);
            Assert.IsTrue(WelcomeDialog.IsEnabled);

            WelcomeDialog.ClickButton("OpenExistingButton");
            string path = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\Data\UITests\SourceData\Cylinder.model"));

            FileDialogAdaptor.DoLoadModel(WelcomeDialog, path);

            Wait.UntilResponsive(WelcomeDialog.Window);
            Wait.UntilResponsive(MainWindow.Window);

            Assert.IsFalse(WelcomeDialog.IsEnabled);
            Assert.Greater(MainWindow.Document.GetBodyItems().Count(), 0);
        }