/// <summary> /// Import test deduction values from TestData /// </summary> private void ImportTestDeductionValues() { var materials = HomeZone.Materials; materials.ResultColumn.SearchText.Value = S_CUSTOM_MATERIAL_NAME; materials.ResultColumn.DoSearch(); int count = materials.ResultColumn.Count; materials.ResultColumn.ClearSearch(); if (count == 0) { materials.ResultColumn.SelectItem(S_MATERIAL_NAME_TO_DUPLICATE); materials.Toolbar.Duplicate(); materials.Detail.Id.Value = S_CUSTOM_MATERIAL_NAME; materials.Toolbar.Save(); var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); var bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); bendSettings.OpenDataManagerBend(); string testDataPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), S_TESTDATA_SUB_PATH); Dictionary <string, string> baselineDictionary = Directory.GetFiles(testDataPath, S_ARVX_FILE_ENDING_FILTER).ToDictionary(item => Path.GetFileName(item), item => item); DatamanagerBend.MainWindowExists.WaitFor(TestSettings.DatamanagerBendStartTimeout); DatamanagerBend.Tools.Import(baselineDictionary.First().Value); DatamanagerBend.Close(); settingsDialog.Save(); } }
/// <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); }
private int ExportSpecifiedDeductionValuesAndGetAvailableMaterialCount(List <Action> deductionSelectionCommandList) { var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); var bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); bendSettings.OpenDataManagerBend(); DatamanagerBend.MainWindowExists.WaitFor(TestSettings.DatamanagerBendStartTimeout); DatamanagerBend.DeductionValues.Goto(); DatamanagerBend.DeductionValues.ExportTBSCSV(); foreach (var cmd in deductionSelectionCommandList) { cmd.Invoke(); } IListBox listBox = Driver.Find <IProcess>(new ProcessPattern() { ProcessName = "DataManager" }).Find <IControl>(new WPFPattern() { ClrFullClassName = "Trumpf.TruTops.DataMigrationTool.Views.Bend_Factor_Explorer.TcBendFactorTbsExportDialog" }, 2).Find <IListBox>(new WPFPattern() { ClrFullClassName = "System.Windows.Controls.ListBox" }, 2); var selectedItemsCount = listBox.wSelected.Count(); DatamanagerBend.DeductionValues.TBSExportDialog.Export(); DatamanagerBend.Close(); settingsDialog.Save(); return(selectedItemsCount); }
public void ShowLicensesTest() { Act(() => { var about = HomeZone.GotoMainMenu().OpenAboutDialog(); Assert.IsTrue(about.IsVisible, "About dialog is not visible"); var componentsDlg = about.ShowThirdPartyComponents(); Assert.IsTrue(componentsDlg.IsVisible, "Components dialog is not visible"); Assert.AreNotEqual(0, componentsDlg.HomeZoneLicenseCount, "HomeZone grid does not contain licenses"); //var license = componentsDlg.GetHomeZoneLicenseRow( 0 ); //Assert.IsFalse(string.IsNullOrEmpty(license.Component)); //license.ShowLicenseText(); var licenseTextDlg = componentsDlg.ShowLicenseText(); Assert.IsTrue(licenseTextDlg.IsVisible, "License text dialog is not visible"); licenseTextDlg.Close(); componentsDlg.Close(); about.Close(); }); }
private void DoThirdPartyLicenseTest() { Log.Info("Opening the About dialog."); var about = HomeZone.GotoMainMenu().OpenAboutDialog(); Assert.IsTrue(about.IsVisible, "About dialog is not visible"); Log.Info("About dialog successfully opened."); Log.Info("Opening the 3rd party components dialog."); var componentsDlg = about.ShowThirdPartyComponents(); Wait.For(() => componentsDlg.IsVisible, TimeSpan.FromSeconds(15)); Assert.IsTrue(componentsDlg.IsVisible, "Components dialog is not visible"); Log.Info("3rd party components dialog successfully opened."); Assert.AreNotEqual(0, componentsDlg.HomeZoneLicenseCount, "HomeZone grid does not contain licenses"); Log.Info("Some HomeZone licenses are visible."); Log.Info("Opening the license text dialog."); var licenseTextDlg = componentsDlg.ShowLicenseText(); Wait.For(() => licenseTextDlg.IsVisible, TimeSpan.FromSeconds(15)); Assert.IsTrue(licenseTextDlg.IsVisible, "License text dialog is not visible"); Log.Info("License text dialog successfully opened."); licenseTextDlg.Close(); componentsDlg.Close(); about.Close(); Log.Info("ThirdPartyLicenseTest successfully finished."); }
public void ToggleShowWelcomeScreenTest() { Act(() => { var menu = HomeZone.GotoMainMenu(); var welcomeScreen = menu.ShowWelcomeScreen(); Assert.IsTrue(welcomeScreen.IsVisible); var toggle = welcomeScreen.ShowWelcomeScreen; // invert toggle welcomeScreen.ShowWelcomeScreen = !toggle; HomeZone.MainTabControl.CloseCurrentTab(); menu.Goto(); menu.ShowWelcomeScreen(); Assert.IsTrue(welcomeScreen.IsVisible); Assert.AreNotEqual(welcomeScreen.ShowWelcomeScreen, toggle); // restore toggle welcomeScreen.ShowWelcomeScreen = toggle; HomeZone.MainTabControl.CloseCurrentTab(); }); }
/// <summary> /// Open the tools configuration dialog /// </summary> /// <param name="settingsDialog">settings dialog</param> /// <param name="bendSettings">bend settings</param> private void OpenToolsConfiguration(out TiSettingsDialog settingsDialog, out TiBendSettings bendSettings) { settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); Assert.IsTrue(bendSettings.IsVisible, S_BOOST_BEND_SETTINGS_NOT_VISIBLE); bendSettings.OpenToolsConfiguration(); }
/// <summary> /// Implementation of the open and close settings test /// </summary> private void DoOpenAndCloseSettingsTest() { var settings = HomeZone.GotoMainMenu().OpenSettingsDialog(); Assert.IsTrue(settings.IsVisible); settings.Cancel(); }
public void ShowWelcomeScreenTest() { Act(() => { var welcomeScreen = HomeZone.GotoMainMenu().ShowWelcomeScreen(); Assert.IsTrue(welcomeScreen.IsVisible); }); }
public void RefreshMasterDataTest() { Act(() => { var menu = HomeZone.GotoMainMenu(); menu.RefreshMasterData(); }); }
public void ExitTest() { Act(() => { Assert.Inconclusive(); // the test closes the HomeZone var menu = HomeZone.GotoMainMenu(); menu.CloseApplication(); }); }
public void ShowHelpTest() { Act(() => { var help = HomeZone.GotoMainMenu().OpenHelp(); Assert.IsTrue(help.IsVisible); help.Close(); }); }
public void ShowAboutTest() { Act(() => { var about = HomeZone.GotoMainMenu().OpenAboutDialog(); Assert.IsTrue(about.IsVisible); about.CopyToClipboard(); about.Close(); }); }
public void OpenAndCloseSettingsTest() { Act(() => { var settings = HomeZone.GotoMainMenu().OpenSettingsDialog(); var visible = settings.IsVisible; Assert.IsTrue(visible); settings.Cancel(); }); }
/// <summary> /// Check for Toollist in Design dropdown /// </summary> /// <param name="toolListName">name of the toollist</param> /// <param name="control">tool list control</param> /// <returns>true if the tool list was found</returns> private bool CheckToolListDropdown(string toolListName, out IControl control) { control = null; var menu = HomeZone.GotoMainMenu(); menu.RefreshMasterData(); bool found = false; IControl toggleStateButton = Driver.Find <IProcess>(new ProcessPattern() { ProcessName = "Trumpf.TruTops.Control.Shell" }).Find <IControl>(new WPFPattern() { ClrFullClassName = "Trumpf.TruTops.Control.Shell.Views.TcShellView" }, 2).Find <IControl>(new WPFPattern() { WPFControlName = "MainTabControl" }, 12).Find <IControl>(new WPFPattern() { WPFControlName = "LayoutWorkArea" }, 18).Find <IControl>(new WPFPattern() { ClrFullClassName = "DevExpress.Xpf.LayoutControl.LayoutItem", WPFControlOrdinalNo = 3 }, 2).Find <IControl>(new WPFPattern() { WPFControlName = "PART_Item" }, 4); toggleStateButton.Click(); IProcess homeZone = Driver.Find <IProcess>(new ProcessPattern() { ProcessName = "Trumpf.TruTops.Control.Shell" }); homeZone.TryFind <IControl>(new WPFPattern { ClrFullClassName = "System.Windows.Controls.Primitives.PopupRoot" }, 2, out var dropDown); found = dropDown.TryFind <IControl>(new WPFPattern() { ClrFullClassName = "System.Windows.Controls.TextBlock", WPFControlText = toolListName }, 12, out control); // DropDown has to be closed. Otherwise the first following Click Event will close the window instead of executing // the desired click event. Driver.Desktop.Keys("[Enter]"); //Close Dropdown. return(found); }
private void ImportSpecifiedDeductionValues(List <string> csvFileList) { var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); var bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); bendSettings.OpenDataManagerBend(); bendSettings.OpenBendDeductionConfiguration(); ImportExportedCSVFilesAndAssertNewDeductionValuesAdded(csvFileList); settingsDialog.Save(); }
/// <summary> /// Implementation of the app settings configuration test /// </summary> private void DoAppSettingsConfigurationTest() { var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); var bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); Assert.IsTrue(bendSettings.IsVisible); bendSettings.OpenAppSettingsConfiguration(); Flux.AppSettingsDialogExists.WaitFor(TestSettings.FluxStartTimeout); Flux.AppSettings.Close(); settingsDialog.Cancel(); }
/// <summary> /// Implementation of the open and close datamanager test /// </summary> private void DoOpenAndCloseDataManagerBendTest() { var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); var bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); Assert.IsTrue(bendSettings.IsVisible); bendSettings.OpenDataManagerBend(); DatamanagerBend.MainWindowExists.WaitFor(TestSettings.DatamanagerBendStartTimeout); DatamanagerBend.Close(); settingsDialog.Cancel(); }
/// <summary> /// Implementation of the tool list configuration test /// </summary> private void DoToolsConfigurationTest() { var settingsDialog = HomeZone.GotoMainMenu().OpenSettingsDialog(); var bendSettings = settingsDialog.BendSettings; bendSettings.Goto(); Assert.IsTrue(bendSettings.IsVisible, S_BOOST_BEND_SETTINGS_NOT_VISIBLE); bendSettings.OpenToolsConfiguration(); Flux.ToolManamgementDialogExists.WaitFor(TestSettings.FluxStartTimeout); //TODO: implement tests (like editing tools) Flux.ToolManagement.Close(); settingsDialog.Cancel(); }
private string GetHomeZoneInfo() { var about = HomeZone.GotoMainMenu().OpenAboutDialog(); try { about.CopyToClipboard(); if (HomeZone.MessageBox.MessageBoxExists()) { HomeZone.MessageBox.Ok(); return(null); } return(System.Windows.Forms.Clipboard.GetText()); } finally { about.Close(); } }
/// <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 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(); } }