Пример #1
0
        public void ExportSolidCancelExchangerSettings()
        {
            var path = Path.Combine(FileDialogAdaptor.GetTempPath(), "testexport.brep");

            TestDataGenerator.GenerateBox(MainWindow);

            MainWindow.Ribbon.ClickFileMenuItem("Exchange", "ExportSelectedBrep");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.SelectFileType(".brep");
            fileDlg.Save(path, checkFile: false);
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));

            var dlg = new WindowAdaptor(MainWindow, "ExchangerSettings");

            Assert.IsNotNull(dlg);
            dlg.ClickButton("Cancel");
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            Assert.IsFalse(System.IO.File.Exists(path));
        }
Пример #2
0
        public void ExportSketchCancelFileDlg()
        {
            var path = Path.Combine(FileDialogAdaptor.GetTempPath(), "sketch.svg");

            System.IO.File.Delete(path);
            TestDataGenerator.GenerateSketch(MainWindow);

            // Do Export
            MainWindow.Ribbon.SelectTab("Sketch");
            MainWindow.Ribbon.ClickButton("SketchExchange");
            var menu = new ContextMenuAdaptor(MainWindow);

            menu.ClickMenuItem("ExportAllToFile");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.Cancel();
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            Assert.IsFalse(System.IO.File.Exists(path));
        }
Пример #3
0
        public void ImportToSketch()
        {
            string path = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\Data\UITests\SourceData\ImportSketch.dxf"));

            Assume.That(MainWindow.SendFileDrop(path));

            var dlg = new WindowAdaptor(MainWindow, "ExchangerSettings");

            Assert.IsNotNull(dlg);
            dlg.ClickButton("Ok");
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            // Check that data was imported
            Assert.AreEqual(2, MainWindow.Document.GetBodyItems().Count());

            // Undo action
            MainWindow.Ribbon.SelectTab("Edit");
            MainWindow.Ribbon.ClickButton("Undo");

            // Check that box is still here
            Assert.AreEqual(1, MainWindow.Document.GetBodyItems().Count());
            Assert.AreEqual("Box_1", MainWindow.Document.GetBodyItems().First().Name);
        }
Пример #4
0
        public void ExportHlrCancelSettings()
        {
            var path = Path.Combine(FileDialogAdaptor.GetTempPath(), "hlr.svg");

            // Cancel export settings
            MainWindow.Ribbon.SelectGroup("Toolbox");
            MainWindow.Ribbon.ClickButton("ExportViewHlr");
            var dlg = new WindowAdaptor(MainWindow, "ExportViewportHlr");

            dlg.ClickButton("Ok");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.SelectFileType("*.svg");
            fileDlg.Save(path, checkFile: false);
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExportViewportHlr"));

            dlg = new WindowAdaptor(MainWindow, "ExchangerSettings");
            dlg.ClickButton("Cancel");
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            Assert.IsFalse(System.IO.File.Exists(path));
        }
Пример #5
0
        public void ExportHlrAsDxf()
        {
            var path = Path.Combine(FileDialogAdaptor.GetTempPath(), "hlr.dxf");

            // Do Export
            MainWindow.Ribbon.SelectGroup("Toolbox");
            MainWindow.Ribbon.ClickButton("ExportViewHlr");
            var dlg = new WindowAdaptor(MainWindow, "ExportViewportHlr");

            dlg.ClickButton("Ok");

            var fileDlg = new FileDialogAdaptor(MainWindow);

            fileDlg.SelectFileType("*.dxf");
            fileDlg.Save(path, checkFile: false);
            Assert.IsFalse(FileDialogAdaptor.IsDialogOpen(MainWindow));
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExportViewportHlr"));

            dlg = new WindowAdaptor(MainWindow, "ExchangerSettings");
            dlg.ClickButton("Ok");
            Assert.IsFalse(WindowAdaptor.IsWindowOpen(MainWindow, "ExchangerSettings"));

            FileDialogAdaptor.CheckFileExists(path);
        }