public void CreateTestMachines()
        {
            Log.OpenFolder("CreateTestMachines");

            var machines = HomeZone.GotoMachines();

            machines.ResultColumn.ClearSearch();

            var machineCount         = machines.ResultColumn.Count;
            var machinesCreatedCount = 0;

            Log.Info("Create bend machines");
            foreach (var bendMachineName in mBendMachineNames)
            {
                var newName = Name2UIT_Name(bendMachineName);
                Log.Info("Create " + newName);

                if (machines.ResultColumn.SelectItem(newName))
                {
                    Log.Warning(newName + " already exists");
                    continue;   // machine already exists
                }

                machines.NewBendMachine(bendMachineName, newName);
                machines.Toolbar.SaveShouldBeEnabled();
                machines.Toolbar.Save();
                machines.Toolbar.SaveShouldBeDisabled();

                machines.WaitForDetailOverlayDisappear(TestSettings.SavingTimeout);
                machinesCreatedCount++;
            }

            Log.Info("Create cut machines");
            foreach (var cutMachineName in mCutMachineNames)
            {
                var newName = Name2UIT_Name(cutMachineName.Item1);
                Log.Info("Create " + newName);

                if (machines.ResultColumn.SelectItem(newName))
                {
                    Log.Warning(newName + " already exists");
                    continue;   // machine already exists
                }

                machines.NewCutMachine(cutMachineName.Item1, newName, cutMachineName.Item2);
                machines.Toolbar.SaveShouldBeEnabled();
                machines.Toolbar.Save();
                machines.Toolbar.SaveShouldBeDisabled();

                machines.WaitForDetailOverlayDisappear(TestSettings.SavingTimeout);
                machinesCreatedCount++;
            }

            machines.ResultColumn.ClearSearch();

            Assert.AreEqual(machineCount + machinesCreatedCount, machines.ResultColumn.Count);
            mTestMachinesCreated = true;

            Log.CloseFolder();
        }
        public void NewBendMachineAndDeleteTest()
        {
            ExecuteUITest(() =>
            {
                var testMachineName = TestSettings.NamePrefix + Guid.NewGuid();
                var machines        = HomeZone.GotoMachines();

                var machineCount = machines.ResultColumn.Count;

                machines.NewBendMachine("TruBend 5320 (6-axes) B23", testMachineName);
                machines.Detail.TransferDirectory.Value  = @"\\LAPxxxxxx\mmc\Arbeitsplatz 1";
                machines.Detail.CreateSubDirectory.Value = true;

                Assert.IsTrue(machines.Toolbar.CanSave);
                machines.Toolbar.Save();
                Assert.IsFalse(machines.Toolbar.CanSave);
                Assert.AreEqual(machineCount + 1, machines.ResultColumn.Count);

                machines.WaitForDetailOverlayAppear();
                machines.WaitForDetailOverlayDisappear();

                machines.ResultColumn.SelectItem(testMachineName);

                Assert.IsTrue(machines.Toolbar.CanDelete);
                machines.Toolbar.Delete();
                Assert.IsFalse(machines.Toolbar.CanDelete);
                Assert.AreEqual(machineCount, machines.ResultColumn.Count);
            });
        }
        public void NewPunchMachineAndDeleteTest()
        {
            ExecuteUITest(() =>
            {
                var testMachineName = TestSettings.NamePrefix + Guid.NewGuid();
                var machines        = HomeZone.GotoMachines();

                machines.NewCutMachine("TruPunch 1000 (S05)", testMachineName);

                Assert.IsTrue(machines.Toolbar.CanSave);
                machines.Toolbar.Save();
                Assert.IsFalse(machines.Toolbar.CanSave);

                machines.WaitForDetailOverlayAppear();
                machines.WaitForDetailOverlayDisappear();

                machines.ResultColumn.SelectItem(testMachineName);

                Assert.IsTrue(machines.Toolbar.CanDelete);
                machines.Toolbar.Delete();

                machines.WaitForDetailOverlayAppear();
                machines.WaitForDetailOverlayDisappear();

                Assert.IsFalse(machines.Toolbar.CanDelete);
            });
        }
        public void NewCutMachineAndDeleteTest()
        {
            ExecuteUITest(() =>
            {
                var testMachineName = TestSettings.NamePrefix + Guid.NewGuid();
                var machines        = HomeZone.GotoMachines();

                var machineCount = machines.ResultColumn.Count;

                machines.NewCutMachine("TruLaser 3030 (L20)", testMachineName, "6000");

                Assert.IsTrue(machines.Toolbar.CanSave);
                machines.Toolbar.Save();
                Assert.IsFalse(machines.Toolbar.CanSave);
                Assert.AreEqual(machineCount + 1, machines.ResultColumn.Count);

                machines.WaitForDetailOverlayAppear();
                machines.WaitForDetailOverlayDisappear();

                machines.ResultColumn.SelectItem(testMachineName);

                Assert.IsTrue(machines.Toolbar.CanDelete);
                machines.Toolbar.Delete();

                machines.WaitForDetailOverlayAppear();
                machines.WaitForDetailOverlayDisappear();

                Assert.IsFalse(machines.Toolbar.CanDelete);

                machines.ResultColumn.ClearSearch();
                Assert.AreEqual(machineCount, machines.ResultColumn.Count);
            });
        }
        /// <summary>
        /// Implementation of the create workplaces for all bend machines test
        /// </summary>
        private void DoCreateWorkplacesForAllBendMachines()
        {
            bool       success  = true;
            TiMachines machines = HomeZone.GotoMachines();

            foreach (var machineName in machines.Detail.GetAvailableBendMachineTemplates())
            {
                mMachineHelper.CreateAndSaveBendMachine(TestSettings, machines, machineName);
                if (!machines.Detail.IsPreviewImageAvailable())
                {
                    Log.Error("No preview image is available for this machine template");
                    success = false;
                }
            }
            Assert.IsTrue(success, "Preview image is for one or more machine templates not available");
        }
        public void DeleteTestMachines()
        {
            Log.OpenFolder("DeleteTestMachines");

            var machines             = HomeZone.GotoMachines();
            var machineCount         = machines.ResultColumn.Count;
            var deletedMachinesCount = 0;

            Log.Info("Delete bend machines");
            foreach (var bendMachineName in mBendMachineNames)
            {
                var newName = Name2UIT_Name(bendMachineName);
                Log.Info("Delete " + newName);

                if (machines.DeleteMachine(newName))
                {
                    deletedMachinesCount++;
                }
            }

            Log.Info("Delete cut machines");
            foreach (var cutMachineName in mCutMachineNames)
            {
                var newName = Name2UIT_Name(cutMachineName.Item1);
                Log.Info("Delete " + newName);

                if (machines.DeleteMachine(newName))
                {
                    deletedMachinesCount++;
                }
            }

            machines.ResultColumn.ClearSearch();

            Assert.AreEqual(machineCount - deletedMachinesCount, machines.ResultColumn.Count);
            mTestMachinesCreated = false;

            Log.CloseFolder();
        }
Example #7
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();
        }