Ejemplo n.º 1
0
        public void DoCutOpenClose()
        {
            Trace.WriteLine(@"Starting Cut open / close test.");
            var parts = HomeZone.GotoParts();

            parts.Toolbar.Import(@"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            parts.SingleDetailCutSolutions.New();
            parts.SingleDetailCutSolutions.OpenCutSolution("Cut1");
            parts.WaitForDetailOverlayAppear();

            var cut = CutApp;

            if (cut.TechnologyTableSelectionDialog.IsDialogVisible(TestSettings.CutStartTimeout, TimeSpan.FromMilliseconds(500)))
            {
                cut.TechnologyTableSelectionDialog.Close();
            }

            var visible = cut.IsMainWindowVisible(TestSettings.CutStartTimeout, TimeSpan.FromMilliseconds(500));

            if (visible)
            {
                cut.CloseApp();

                parts.WaitForDetailOverlayDisappear();
            }

            parts.Toolbar.Delete();

            Assert.IsTrue(visible, "Cut window was not visible.");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Implementation of the Flux open and close test
        /// </summary>
        private void DoFluxOpenClose()
        {
            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, S_FLUX_MACHINE_5320);


            var namePrefix = TestSettings.NamePrefix + Guid.NewGuid();
            var parts      = HomeZone.GotoParts();

            List <string> partList = new List <string>()
            {
                @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Eckwinkel.scdoc",
                @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo"
            };

            foreach (var part in partList)
            {
                mPartHelper.ImportPart(TestSettings, parts, part);
                parts.SingleDetailBendSolutions.New();
                parts.SingleDetailBendSolutions.OpenBendSolution("Bend1");
                parts.WaitForDetailOverlayAppear();

                Flux.MainWindowFluxExists.WaitFor(TestSettings.FluxBoostAndStartTimeout);
                Flux.MainWindowFlux.Close();

                parts.WaitForDetailOverlayDisappear();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Implemenation of the release boosted part test
        /// </summary>
        private void DoReleaseBoostedPart()
        {
            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, S_FLUX_MACHINE_5320);

            var    parts        = HomeZone.GotoParts();
            string solutionName = "Bend1";

            mPartHelper.ImportPart(TestSettings, parts, @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");

            parts.SingleDetailBendSolutions.New();
            parts.SingleDetailBendSolutions.BoostSolution(solutionName);
            parts.TryWaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            // freigeben
            parts.SingleDetailBendSolutions.ToggleReleaseButton(solutionName);
            parts.TryWaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            parts.SingleDetailBendSolutions.OpenSolutionDetail(solutionName);

            Assert.IsTrue(parts.SingleDetailBendSolutions.NcButtonVisible(solutionName));
            Assert.IsTrue(parts.SingleDetailBendSolutions.SetupPlanButtonVisible(solutionName));
            Assert.IsTrue(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(solutionName));

            // widerrufen
            parts.SingleDetailBendSolutions.ToggleUnreleaseButton(solutionName);
            parts.TryWaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            Assert.IsTrue(parts.SingleDetailBendSolutions.NcButtonVisible(solutionName));
            Assert.IsTrue(parts.SingleDetailBendSolutions.SetupPlanButtonVisible(solutionName));
            Assert.IsFalse(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(solutionName));
        }
Ejemplo n.º 4
0
        public void NewPartOrderAndDeleteTest()
        {
            Act(() =>
            {
                var parts = HomeZone.GotoParts();
                parts.Toolbar.New();
                parts.SingleDetail.Id         = "TestPart";
                parts.SingleDetail.Name.Value = "TestPart";
                parts.Toolbar.Save();

                var partOrders = HomeZone.GotoPartOrders();
                var toolbar    = partOrders.Toolbar;

                toolbar.New();

                //TODO complete test
                Assert.IsFalse(toolbar.CanSave);

                partOrders.BaseInfo.ID.Value = "TestOrder";
                partOrders.PartInfo.SelectPart("TestPart");
                partOrders.Toolbar.Save();

                partOrders.ResultColumn.SelectItem("TestOrder");

                Assert.IsTrue(toolbar.CanDelete);
                toolbar.Delete();
                Assert.IsFalse(toolbar.CanDelete);

                parts = HomeZone.GotoParts();
                parts.ResultColumn.SelectItem("TestPart");
                parts.Toolbar.Delete();
            });
        }
        /// <summary>
        /// Implementation of the delete tool list test
        /// </summary>
        private void DoDeleteToolListsTest()
        {
            // Create a toollist
            OpenToolsConfiguration(out var settingsDialog, out var bendSettings);

            string toollistName = "rubbishTools";

            Flux.ToolManamgementDialogExists.WaitFor(TestSettings.FluxStartTimeout);
            Flux.ToolManagement.NewToolList(toollistName);
            Flux.ToolManagement.Close();
            Flux.SaveChanges();
            Flux.WaitForSynchronization(TestSettings.FluxSyncTimeout);
            settingsDialog.Save();

            // Delete the  toollist
            bendSettings = HomeZone.GotoMainMenu().OpenSettingsDialog().BendSettings;
            bendSettings.Goto();
            Assert.IsTrue(bendSettings.IsVisible, S_BOOST_BEND_SETTINGS_NOT_VISIBLE);
            bendSettings.OpenToolsConfiguration();

            Flux.ToolManamgementDialogExists.WaitFor(TestSettings.FluxStartTimeout);
            Flux.ToolManagement.DeleteToolList(toollistName);
            Flux.ToolManagement.Close();
            Flux.WaitForSynchronization(TestSettings.FluxSyncTimeout);
            settingsDialog.Save();

            // import part and use toollist
            var parts = HomeZone.GotoParts();

            mPartHelper.ImportPart(TestSettings, parts, S_TEST_GEOMETRY);

            Assert.IsFalse(CheckToolListDropdown(toollistName, out var control), S_MISSING_FLUX_TOOL_LIST_IN_BOOST);
        }
        public void DeleteTestParts()
        {
            Log.OpenFolder("DeleteTestParts");

            var parts             = HomeZone.GotoParts();
            var partCount         = parts.ResultColumn.Count;
            var deletedPartsCount = 0;

            for (int i = 0; i < mPartNames.Count; i++)
            {
                var partName = Path.GetFileNameWithoutExtension(mPartNames[i].Name);
                var name     = Name2UIT_Name(partName);
                Log.Info("Delete " + name);

                if (parts.DeletePart(name))
                {
                    deletedPartsCount++;
                }
            }

            parts.ResultColumn.ClearSearch();

            Assert.AreEqual(partCount - deletedPartsCount, parts.ResultColumn.Count);

            Log.CloseFolder();
        }
        public void CreateTestParts()
        {
            Log.OpenFolder("CreateTestParts");

            if (!mTestMachinesCreated)
            {
                CreateTestMachines();
            }

            if (!mTestCustomersCreated)
            {
                CreateTestCustomers();
            }

            var parts             = HomeZone.GotoParts();
            var partCount         = parts.ResultColumn.Count;
            var partsCreatedCount = 0;

            for (var i = 0; i < mPartNames.Count; i++)
            {
                var name = Name2UIT_Name(Path.GetFileNameWithoutExtension(mPartNames[i].Name));
                Log.Info("Create " + name);

                if (parts.ResultColumn.SelectItem(name))
                {
                    Log.Warning(name + " already exists");
                    continue;   // part already exists
                }

                parts.Toolbar.Import(mPartNames[i].FullName);
                parts.WaitForDetailOverlayDisappear();
                parts.SingleDetail.WaitForNameEnabled(TimeSpan.FromSeconds(60));
                parts.SingleDetail.Name.Value           = TestSettings.NamePrefix + parts.SingleDetail.Name.Value;
                parts.SingleDetail.Id                   = parts.SingleDetail.Name.Value;
                parts.SingleDetail.Customer             = Name2UIT_Name(mCustomerNames[i]);
                parts.SingleDetail.DrawingNumber.Value  = TestSettings.NamePrefix + "DrawNr";
                parts.SingleDetail.DrawingVersion.Value = "V08.15-007";
                parts.SingleDetail.ExternalName         = TestSettings.NamePrefix + "ExtName";
                parts.SingleDetail.Note.Value           = TestSettings.NamePrefix + "Note";
                parts.SingleDetailBendSolutions.New();
                parts.SingleDetailCutSolutions.New();
                parts.Toolbar.SaveShouldBeEnabled();
                parts.Toolbar.Save();
                parts.Toolbar.SaveShouldBeDisabled();
                partsCreatedCount++;
            }

            parts.ResultColumn.ClearSearch();

            Assert.AreEqual(partCount + partsCreatedCount, parts.ResultColumn.Count);

            Log.CloseFolder();
        }
Ejemplo n.º 8
0
        public void Add10TabsWithPartSelected()
        {
            Act(() =>
            {
                var mainTabControl  = HomeZone.MainTabControl;
                var initialTabCount = mainTabControl.Count();

                for (int i = 0; i < 10; i++)
                {
                    mainTabControl.AddNewTab();
                    HomeZone.GotoParts();
                }
                Assert.AreEqual(mainTabControl.Count(), initialTabCount + 10);
            });
        }
Ejemplo n.º 9
0
        public void SelectPartIntoOrderTest()
        {
            var parts = HomeZone.GotoParts();

            parts.Toolbar.New();
            parts.SingleDetail.Id         = "TestPart";
            parts.SingleDetail.Name.Value = "TestPart";
            parts.Toolbar.Save();

            var partOrders = HomeZone.GotoPartOrders();

            partOrders.Toolbar.New();
            partOrders.PartInfo.SelectPart("TestPart");

            Assert.IsTrue(partOrders.Toolbar.CanSave);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Implementation of the close without save test
        /// </summary>
        private void DoCloseWithoutSave()
        {
            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, S_FLUX_MACHINE_5320);

            var    parts        = HomeZone.GotoParts();
            string solutionName = "Bend1";

            mPartHelper.ImportPart(TestSettings, parts, @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");

            parts.SingleDetailBendSolutions.New();
            parts.SingleDetailBendSolutions.OpenBendSolution(solutionName);
            parts.WaitForDetailOverlayAppear();

            var  flux    = FluxApp;
            bool visible = flux.IsMainWindowVisible(TestSettings.FluxBoostAndStartTimeout, TimeSpan.FromMilliseconds(500));

            flux.ChangeSolution();
            parts.WaitForDetailOverlayDisappear();
        }
Ejemplo n.º 11
0
        public void ImportPartTest()
        {
            ExecuteUITest(() =>
            {
                var parts = HomeZone.GotoParts();

                parts.Toolbar.Import(@"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Eckwinkel.scdoc");

                parts.WaitForDetailOverlayAppear();
                parts.WaitForDetailOverlayDisappear();
                parts.SingleDetail.WaitForNameEnabled(TimeSpan.FromSeconds(10));

                parts.SingleDetail.Name.Value = TestSettings.NamePrefix + "ImportPartTest";

                parts.SingleDetail.DrawingNumber.Value  = "ImportPartTest_DrawNr";
                parts.SingleDetail.DrawingVersion.Value = "V08.15-007";
                parts.SingleDetail.ExternalName         = "ImportPartTest_ExtName";
                parts.SingleDetail.Archivable           = false;
                parts.SingleDetail.Note.Value           = "ImportPartTest_Note";
                parts.SingleDetailBendSolutions.New();
                parts.SingleDetailCutSolutions.New();

                parts.Toolbar.SaveShouldBeEnabled();
                parts.Toolbar.Save();
                parts.Toolbar.SaveShouldBeDisabled();

                parts.Toolbar.BoostShouldBeEnabled();
                parts.Toolbar.Boost();
                parts.WaitForDetailOverlayAppear();
                parts.WaitForDetailOverlayDisappear();

                // boost again to check dialog box handling
                parts.Toolbar.BoostShouldBeEnabled();
                parts.Toolbar.Boost();
                parts.WaitForDetailOverlayAppear();
                parts.WaitForDetailOverlayDisappear();

                parts.Toolbar.DeleteShouldBeEnabled();
                parts.Toolbar.Delete();
                parts.Toolbar.DeleteShouldBeDisabled();
            });
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Implementation of the Boost solution with error test
        /// </summary>
        private void DoBoostSolutionWithErrorTest()
        {
            string testMachine = "TruBend 3066 (2-axes, Asia) B26";

            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, testMachine);

            var    parts        = HomeZone.GotoParts();
            string solutionName = "Bend1";

            mPartHelper.ImportPart(TestSettings, parts, @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");

            parts.SingleDetailBendSolutions.New();
            parts.SingleDetailBendSolutions.BoostSolution(solutionName);
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            parts.SingleDetailBendSolutions.OpenSolutionDetail(solutionName);

            Assert.IsFalse(parts.SingleDetailBendSolutions.NcButtonVisible(solutionName));
            Assert.IsFalse(parts.SingleDetailBendSolutions.SetupPlanButtonVisible(solutionName));
            Assert.IsFalse(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(solutionName));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Implementation of the Flux save and close test
        /// </summary>
        private void DoFluxSaveAndCloseTest()
        {
            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, S_FLUX_MACHINE_5320);

            var    parts        = HomeZone.GotoParts();
            string solutionName = "Bend1";

            mPartHelper.ImportPart(TestSettings, parts, @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");

            parts.SingleDetailBendSolutions.New();
            parts.SingleDetailBendSolutions.OpenBendSolution(solutionName);

            Flux.MainWindowFluxExists.WaitFor(TestSettings.FluxBoostAndStartTimeout);
            Flux.MainWindowFlux.OpenMenu();
            Flux.MainWindowFlux.SettingsMenu.Save();
            Flux.MainWindowFlux.Close();

            parts.WaitForDetailOverlayDisappear();

            var isManual = parts.SingleDetailBendSolutions.IsManuallyChanged(solutionName);

            Assert.IsTrue(isManual);
        }
Ejemplo n.º 14
0
        public void DoDesignOpenClose()
        {
            Trace.WriteLine(@"Starting Design open / close test.");
            var parts = HomeZone.GotoParts();

            parts.Toolbar.Import(@"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            parts.SingleDetailDesign.Open();

            var visible = DesignApp.IsMainWindowVisible(TestSettings.DesignStartTimeout, TimeSpan.FromMilliseconds(500));

            if (visible)
            {
                DesignApp.CloseApp();

                parts.WaitForDetailOverlayDisappear();
            }

            parts.Toolbar.Delete();

            Assert.IsTrue(visible, "Design window was not visible.");
        }
        /// <summary>
        /// Implementation of the rename tool list test
        /// </summary>
        private void DoRenameToolList()
        {
            // Create a toollist
            OpenToolsConfiguration(out var settingsDialog, out var bendSettings);

            string toollistName = "oldName";

            Flux.ToolManamgementDialogExists.WaitFor(TestSettings.FluxStartTimeout);
            Flux.ToolManagement.NewToolList(toollistName);
            Flux.ToolManagement.Close();
            Flux.SaveChanges();
            Flux.WaitForSynchronization(TestSettings.FluxSyncTimeout);
            settingsDialog.Save();

            // rename toollist
            Random random  = new Random();
            string newName = "newName" + random.Next(0, 99); //randomize to reduce test interference

            bendSettings = HomeZone.GotoMainMenu().OpenSettingsDialog().BendSettings;
            bendSettings.Goto();
            Assert.IsTrue(bendSettings.IsVisible, S_BOOST_BEND_SETTINGS_NOT_VISIBLE);
            bendSettings.OpenToolsConfiguration();
            Flux.ToolManamgementDialogExists.WaitFor(TestSettings.FluxStartTimeout);
            Flux.ToolManagement.RenameToolList(toollistName, newName);
            Flux.ToolManagement.Close();
            Flux.SaveChanges();
            Flux.WaitForSynchronization(TestSettings.FluxSyncTimeout);
            settingsDialog.Save();

            // import part and use toollist
            var parts = HomeZone.GotoParts();

            mPartHelper.ImportPart(TestSettings, parts, S_TEST_GEOMETRY);

            Assert.IsTrue(CheckToolListDropdown(newName, out var control), "Newly created tool list is not available in HomeZone UI");
        }
        /// <summary>
        /// Implementation of the tool list configuration test
        /// </summary>
        private void DoToolListsConfigurationTest()
        {
            // Create a toollist
            OpenToolsConfiguration(out var settingsDialog, out var bendSettings);

            Random random       = new Random();
            string toollistName = "superTools" + random.Next(0, 99); //randomize to reduce test interference

            Flux.ToolManamgementDialogExists.WaitFor(TestSettings.FluxStartTimeout);
            Flux.ToolManagement.NewToolList(toollistName);
            Flux.ToolManagement.Close();
            Flux.SaveChanges();
            Flux.WaitForSynchronization(TestSettings.FluxSyncTimeout);

            settingsDialog.Cancel();

            // import part and use toollist
            var parts = HomeZone.GotoParts();

            mPartHelper.ImportPart(TestSettings, parts, S_TEST_GEOMETRY);
            Assert.IsTrue(CheckToolListDropdown(toollistName, out var toolList), S_MISSING_FLUX_TOOL_LIST_IN_BOOST);

            parts.Toolbar.Delete();
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Implementation of the Boost all showcase parts test
        /// </summary>
        private void DoBoostAllShowcaseParts()
        {
            string        bendSolutionName = "Bend1";
            string        samplesPath      = @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase";
            List <string> showcasePartList = new List <string>()
            {
                "Halter_rechts.scdoc",
                "Lochgitter.scdoc",
                "Lueftergehauese.scdoc",
                "Motorhalter.scdoc",
                "Pumpenhalter.scdoc",
                "Rueckwand.scdoc",
                "Traeger.scdoc",
                "Umlenker.scdoc",
                "Wanne.scdoc",
                "Zugwinkel.scdoc",
                "Abdeckblech.scdoc",
                //"Abdeckung_mitExtAttributen.scdoc", //no material assigned automatically -> no boosted design per default
                "Aufnahmegehaeuse.scdoc",
                "Bruecke.scdoc",
                "Demoteil.geo",
                "Distanzblech.scdoc",
                "Eckwinkel.scdoc",
                "Entluefterwinkel.scdoc",
                "Halteplatte.scdoc"
            };

            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, S_FLUX_MACHINE_5320);

            var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog();
            var bendSettings   = settingsDialog.BendSettings;

            bendSettings.Goto();
            bendSettings.AddDefaultBendProgram();
            settingsDialog.Save();

            try
            {
                TiParts parts = HomeZone.GotoParts();
                foreach (var item in showcasePartList)
                {
                    mPartHelper.ImportPart(TestSettings, parts, Path.Combine(samplesPath, item));
                }
                parts.ResultColumn.SelectAll();
                parts.Toolbar.WaitForBoostButtonEnabled();
                parts.Toolbar.Boost();

                int timeoutCount = 0;
                foreach (var item in showcasePartList)
                {
                    parts.ResultColumn.SelectItems(Path.GetFileNameWithoutExtension(item));
                    bool waitSuccess = false;
                    do
                    {
                        waitSuccess = parts.TryWaitForDetailOverlayDisappear();
                        timeoutCount++;
                    } while(!waitSuccess && timeoutCount < showcasePartList.Count);   //wait max: number of parts * timeout

                    Assert.AreEqual(TcAppLangDependentStrings.ReleaseMissing, parts.SingleDetailBendSolutions.SingleBendSolutionStateToolTip(bendSolutionName), "Bend solution has wrong state");
                    Assert.IsFalse(parts.SingleDetailBendSolutions.IsManuallyChanged(bendSolutionName), "Bend solution indicates manual change but there is none");
                    parts.SingleDetailBendSolutions.OpenSolutionDetail(bendSolutionName);
                    Assert.IsTrue(parts.SingleDetailBendSolutions.SetupPlanButtonVisible(bendSolutionName), "Setup plan is missing for boosted solution");
                    Assert.IsTrue(parts.SingleDetailBendSolutions.NcButtonVisible(bendSolutionName), "NC code is missing for boosted solution");
                }
            }
            finally
            {
                bendSettings.Goto();
                bendSettings.DeleteDefaultBendProgram();
                settingsDialog.Save();
            }
        }
Ejemplo n.º 18
0
        private void DoReleasePathChange()
        {
            TcMachineHelper machineHelper = new TcMachineHelper();

            string machineName = $"{S_FLUX_MACHINE_5320} - ReleasePathTest";

            mMachineHelper.CreateAndSaveBendMachine(TestSettings, HomeZone.Machines, S_FLUX_MACHINE_5320, machineName);

            string releasePathDefault     = machineHelper.GetReleasePathOfMachine(machineName, HomeZone.Machines);
            string uniqueTestFolderName   = TestContext.TestDir.Split('\\').Last();
            string releasePathFirstBoost  = Path.Combine(releasePathDefault, uniqueTestFolderName, "myFirstBoostPath");
            string releasePathSecondBoost = Path.Combine(releasePathDefault, uniqueTestFolderName, "mySeconBoostPath");


            // Change Release-path in the machine-settings.
            Assert.IsTrue(machineHelper.ChangeReleasePathOfMachine(machineName, releasePathFirstBoost, HomeZone.Machines),
                          "First release-path: Unable to find machine or set the release-path.");

            // Import a part from file.
            var parts = HomeZone.GotoParts();

            mPartHelper.ImportPart(TestSettings, parts, @"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");

            // -------------------------------------------------
            // First boost attempt.
            // -------------------------------------------------
            // Create and boost the solution.
            parts.SingleDetailBendSolutions.New();
            const string SOLUTION_NAME_1 = "Bend1";

            parts.SingleDetailBendSolutions.BoostSolution(SOLUTION_NAME_1);
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            // Release the solution.
            parts.SingleDetailBendSolutions.ToggleReleaseButton(SOLUTION_NAME_1);
            parts.SingleDetailBendSolutions.OpenSolutionDetail(SOLUTION_NAME_1);
            Assert.IsTrue(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(SOLUTION_NAME_1));
            AssertFileCountInReleaseFolder(2, releasePathFirstBoost, "After first release");

            // Un-release the solution.
            parts.SingleDetailBendSolutions.ToggleUnreleaseButton(SOLUTION_NAME_1);
            Assert.IsFalse(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(SOLUTION_NAME_1));
            AssertFileCountInReleaseFolder(0, releasePathFirstBoost, "After first un-release");


            // -------------------------------------------------
            // Second boost attempt.
            // -------------------------------------------------
            // Change Release-path in the machine-settings.
            Assert.IsTrue(machineHelper.ChangeReleasePathOfMachine(machineName, releasePathSecondBoost, HomeZone.Machines),
                          "First release-path: Unable to find machine or set the release-path.");

            // Boost the solution again.
            parts = HomeZone.GotoParts();
            parts.SingleDetailBendSolutions.New();
            const string SOLUTION_NAME_2 = "Bend2";

            parts.SingleDetailBendSolutions.BoostSolution(SOLUTION_NAME_2);
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();

            // Release the solution.
            parts.SingleDetailBendSolutions.ToggleReleaseButton(SOLUTION_NAME_2);
            parts.SingleDetailBendSolutions.OpenSolutionDetail(SOLUTION_NAME_2);
            Assert.IsTrue(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(SOLUTION_NAME_2));
            AssertFileCountInReleaseFolder(2, releasePathSecondBoost, "After second release");

            // Un-release the solution.
            parts.SingleDetailBendSolutions.ToggleUnreleaseButton(SOLUTION_NAME_2);
            Assert.IsFalse(parts.SingleDetailBendSolutions.OpenReleaseButtonVisible(SOLUTION_NAME_2));
            AssertFileCountInReleaseFolder(0, releasePathSecondBoost, "After second un-release");
        }
Ejemplo n.º 19
0
        public void BulkChangeTest()
        {
            var name    = TestSettings.NamePrefix + "BulkChangeTest";
            var machine = "TruBend 5320 (6-axes) B23";

            Log.Info("---Create workplace---");
            var workplace = HomeZone.GotoMachines();

            workplace.NewBendMachine(machine, name);

            Log.Info("---Create customer---");
            var customers = HomeZone.GotoCustomers();

            customers.NewCustomer(
                name,
                "C" + Guid.NewGuid(),
                "TRUMPF Allee 1",
                "71254",
                "Ditzingen",
                "Deutschland",
                "no comment");
            customers.Apply();
            customers.Cancel();

            Log.Info("---Import 2 parts---");
            var parts = HomeZone.GotoParts();

            parts.Toolbar.Import(@"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Eckwinkel.scdoc");
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();
            parts.SingleDetail.Name.Value = TestSettings.NamePrefix + "Bulk1";
            parts.SingleDetailBendSolutions.New();
            parts.Toolbar.Save();
            parts.Toolbar.Import(@"C:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Zugwinkel.scdoc");
            parts.WaitForDetailOverlayAppear();
            parts.WaitForDetailOverlayDisappear();
            parts.SingleDetail.Name.Value = TestSettings.NamePrefix + "Bulk2";
            parts.SingleDetailBendSolutions.New();
            parts.Toolbar.Save();

            Log.Info("---Select the imported parts and create part orders---");
            parts.ResultColumn.SelectItems(TestSettings.NamePrefix + "Bulk");
            parts.Toolbar.CreatePartOrder();

            Log.Info("---Modify part orders---");
            var partOrders = HomeZone.GotoPartOrders();

            partOrders.BaseInfoBulk.ID.Value                  = "BulkID";
            partOrders.BaseInfoBulk.FinishDate.Value          = (DateTime.Today + TimeSpan.FromDays(2));
            partOrders.BaseInfoBulk.QuantityValue.Value       = 42;
            partOrders.BaseInfoBulk.Customer.Value            = name;
            partOrders.PartInfoBulk.Design.Material.Value     = "AlMg3";
            partOrders.PartInfoBulk.Design.RawMaterial.Value  = "AL0M0200---";
            partOrders.PartInfoBulk.Bend.BendingProgram.Value = TcAppLangDependentStrings.NoBending;

            partOrders.Toolbar.Save();
            partOrders.WaitForDetailOverlayDisappear();


            Log.Info("---Clean up---");
            partOrders.Toolbar.Delete();
            partOrders.ResultColumn.ClearSearch();

            parts.Goto();
            parts.ResultColumn.SelectItems(TestSettings.NamePrefix + "Bulk");
            parts.Toolbar.Delete();
            parts.ResultColumn.ClearSearch();

            customers.Goto();
            var amount = customers.DeleteCustomersWithNameContaining(name);

            if (amount > 0)
            {
                customers.Apply();
            }
            customers.Cancel();

            workplace.Goto();
            workplace.DeleteMachine(name);

            var mainTabControl = HomeZone.MainTabControl;

            mainTabControl.CloseCurrentTab();
        }
Ejemplo n.º 20
0
        public void OrdersTableTest()
        {
            const string PartName     = "UiT_Demoteil";
            const string OrderName    = "UiT_OR_OrdersTable";
            const string NestingName  = "UiT_N_OrdersTable";
            const string CustomerName = "UiT_OrdersTableTest";
            var          FinishDate   = new DateTime(2018, 7, 31);

            Act(() =>
            {
                var parts = HomeZone.GotoParts();
                parts.Toolbar.Import(@"c:\Users\Public\Documents\TRUMPF\TruTops\Samples\Showcase\Demoteil.geo");
                parts.SingleDetail.Name.Value = PartName;
                parts.SingleDetail.Id         = PartName;
                parts.SingleDetail.Note.Value = "Noote";

                var customerAdmin = parts.SingleDetail.OpenCustomerAdministration();
                if (customerAdmin.Count() == 1 && customerAdmin.Name.Value == string.Empty)
                {
                    customerAdmin.Name.Value = CustomerName;
                    customerAdmin.Apply();
                    customerAdmin.Select();
                }
                else if (!customerAdmin.SelectCustomer(CustomerName))
                {
                    customerAdmin.NewCustomer(CustomerName, "", "", "", "", "", "");
                    customerAdmin.Apply();
                    customerAdmin.Select();
                }
                else
                {
                    customerAdmin.Select();
                }

                parts.Toolbar.Save();

                var partOrders = HomeZone.GotoPartOrders();
                partOrders.Toolbar.New();
                partOrders.BaseInfo.ID.Value         = OrderName;
                partOrders.BaseInfo.FinishDate.Value = FinishDate;
                partOrders.PartInfo.SelectPart(PartName);
                partOrders.Toolbar.Save();

                var nestings = HomeZone.GotoCutJobs();
                nestings.Toolbar.New();
                nestings.BaseInfo.Id.Value = NestingName;
                nestings.ContainedOrders.AddPartOrder(OrderName);
                nestings.Toolbar.Save();

                var row = nestings.ContainedOrders.GetRow(0);

                Assert.IsNotNull(row.DrawingButton);
                Assert.AreEqual($"{PartName} ({PartName})", row.PartLink.Label);
                Assert.AreEqual(0, row.Pending);
                Assert.AreEqual(1, row.Total);
                Assert.AreEqual(OrderName, row.OrderLink.Label);
                Assert.AreEqual(CustomerName, row.Customer);
                Assert.AreEqual(StripTime(FinishDate), StripTime(row.TargetDate.Value));
                Assert.AreEqual("Reprocessing", row.CuttingProgram);
                Assert.IsTrue(row.AngularPositions.Contains("0"));
                Assert.AreEqual("Grid machining", row.DistanceMode);
                Assert.IsFalse(row.IgnoreProcessings.Value);
                Assert.AreEqual(0, row.SamplePartsCount);
                Assert.AreEqual("Noote", row.Note);

                row.DrawingButton.Click();
                Thread.Sleep(5000);

                Assert.IsTrue(parts.IsVisible);

                HomeZone.GotoCutJobs();
                nestings.ResultColumn.SelectItem(NestingName);
                nestings.Toolbar.Delete();

                HomeZone.GotoPartOrders();
                partOrders.ResultColumn.SelectItem(OrderName);
                partOrders.Toolbar.Delete();

                HomeZone.GotoParts();
                parts.ResultColumn.SelectItem(PartName);
                parts.Toolbar.Delete();
            });
        }