Index: System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTests.csproj =================================================================== diff -u -raa3ed2f940f4567b88241d93b514067265c01022 -re56b692700e070e3e7b3b1dbb6d0531789d5795c --- System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTests.csproj (.../AutomatedSystemTests.csproj) (revision aa3ed2f940f4567b88241d93b514067265c01022) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTests.csproj (.../AutomatedSystemTests.csproj) (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -549,6 +549,9 @@ 608d45dc-fe27-457c-83c7-c201f32a598d + + 087d34b8-33ac-4d74-9e46-30c5f6522ca7 + 190c7aaf-3340-4a36-b398-aadf52f77a8b SelectTypeFailureMechanismForFM.rxrec Index: System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTestsRepository.cs =================================================================== diff -u -r5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4 -re56b692700e070e3e7b3b1dbb6d0531789d5795c --- System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTestsRepository.cs (.../AutomatedSystemTestsRepository.cs) (revision 5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTestsRepository.cs (.../AutomatedSystemTestsRepository.cs) (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -2858,6 +2858,7 @@ RepoItemInfo _btndialogInfo; RepoItemInfo _dropdownbuttoninrowpropertiespanelInfo; RepoItemInfo _fmsectionsviewtableInfo; + RepoItemInfo _securitycategoriesviewtableInfo; /// /// Creates a new DocumentViewContainer folder. @@ -2880,6 +2881,7 @@ _btndialogInfo = new RepoItemInfo(this, "BtnDialog", "?/?/button[@controlname='btnDialog']", 30000, null, "cefba828-ea6b-4e9d-a97a-641324e9af42"); _dropdownbuttoninrowpropertiespanelInfo = new RepoItemInfo(this, "DropDownButtonInRowPropertiesPanel", "?/?/button[@controlname='btnDropDown']", 30000, null, "3bf645bc-b589-440e-9827-e97c895e810b"); _fmsectionsviewtableInfo = new RepoItemInfo(this, "FMSectionsViewTable", "container[@controlname~'SectionsView']/?/table", 30000, null, "e1c75820-980f-411c-9ada-a9dcd59572ae"); + _securitycategoriesviewtableInfo = new RepoItemInfo(this, "SecurityCategoriesViewTable", "container[@controlname='AssessmentSectionAssemblyGroupsView']/?/?/table", 30000, null, "4036b6f4-d12d-47b5-9c7f-3897f5b573bd"); } /// @@ -2979,6 +2981,30 @@ } /// + /// The SecurityCategoriesViewTable item. + /// + [RepositoryItem("4036b6f4-d12d-47b5-9c7f-3897f5b573bd")] + public virtual Ranorex.Table SecurityCategoriesViewTable + { + get + { + return _securitycategoriesviewtableInfo.CreateAdapter(true); + } + } + + /// + /// The SecurityCategoriesViewTable item info. + /// + [RepositoryItemInfo("4036b6f4-d12d-47b5-9c7f-3897f5b573bd")] + public virtual RepoItemInfo SecurityCategoriesViewTableInfo + { + get + { + return _securitycategoriesviewtableInfo; + } + } + + /// /// The FM_ContributionView folder. /// [RepositoryFolder("66d5c3ad-ea35-4782-8889-9aefcb8059a9")] Index: System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTestsRepository.rxrep =================================================================== diff -u -r5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4 -re56b692700e070e3e7b3b1dbb6d0531789d5795c --- System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTestsRepository.rxrep (.../AutomatedSystemTestsRepository.rxrep) (revision 5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/AutomatedSystemTestsRepository.rxrep (.../AutomatedSystemTestsRepository.rxrep) (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -1347,6 +1347,13 @@ /form[@automationid='RiskeerMainWindow']/container/container[4]/container/container[@instance='1' and @controltypename='WinFormsAdapter']/container[@controlname='CalculationsView'] + + /form[@automationid='RiskeerMainWindow']/container/container[4]/container/container[@instance='1' and @controltypename='WinFormsAdapter']/container[@controlname='AssessmentSectionAssemblyGroupsView']/?/?/table + /form[@automationid='RiskeerMainWindow']/container/container[4]/container/container[@instance='1' and @controltypename='WinFormsAdapter'] Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSectionsDivisionsFromSectionsView.cs =================================================================== diff -u -r5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4 -re56b692700e070e3e7b3b1dbb6d0531789d5795c --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSectionsDivisionsFromSectionsView.cs (.../ReadSectionsDivisionsFromSectionsView.cs) (revision 5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSectionsDivisionsFromSectionsView.cs (.../ReadSectionsDivisionsFromSectionsView.cs) (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -78,35 +78,11 @@ foreach (var row in rowsSectionsDivisions) { fmAssessmentInformation.SectionList.Add(CreateSectionFromRow(row, sectionIndeces)); } - var trajectAssessmentInformation = BuildAssessmenTrajectInformation(trajectAssessmentInformationString); + var trajectAssessmentInformation = TrajectResultInformation.BuildAssessmenTrajectInformation(trajectAssessmentInformationString); trajectAssessmentInformation.ListFMsResultInformation.Add(fmAssessmentInformation); trajectAssessmentInformationString = JsonConvert.SerializeObject(trajectAssessmentInformation, Formatting.Indented); } - private TrajectResultInformation BuildAssessmenTrajectInformation(string trajectAssessmentInformationString) - { - TrajectResultInformation trajectAssessmentInformation; - if (trajectAssessmentInformationString=="") { - trajectAssessmentInformation = new TrajectResultInformation(); - } else { - var error = false; - trajectAssessmentInformation = JsonConvert.DeserializeObject(trajectAssessmentInformationString, new JsonSerializerSettings - { - Error = (s, e) => - { - error = true; - e.ErrorContext.Handled = true; - } - } - ); - if (error==true) { - - Report.Log(ReportLevel.Error, "error unserializing json string for trajectAssessmentInformationString: " + trajectAssessmentInformationString); - } - - } - return trajectAssessmentInformation; - } private int GetColumnIndex(Row headerRow, string textInHeader) { Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSecurityCategoriesView.cs =================================================================== diff -u --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSecurityCategoriesView.cs (revision 0) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/ActionsDocumentView/ReadSecurityCategoriesView.cs (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -0,0 +1,68 @@ +/* + * Created by Ranorex + * User: rodriqu_dd + * Date: 17/05/2022 + * Time: 18:02 + * + * To change this template use Tools > Options > Coding > Edit standard headers. + */ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Drawing; +using System.Threading; +using WinForms = System.Windows.Forms; +using Ranorex_Automation_Helpers.UserCodeCollections; +using Newtonsoft.Json; + +using Ranorex; +using Ranorex.Core; +using Ranorex.Core.Testing; + +namespace AutomatedSystemTests.Modules.ActionsDocumentView +{ + /// + /// Description of ReadSecurityCategoriesView. + /// + [TestModule("E6D61DE3-5921-45EA-8FA4-C205BD53333B", ModuleType.UserCode, 1)] + public class ReadSecurityCategoriesView : ITestModule + { + + string _trajectAssessmentInformationString = ""; + [TestVariable("6e24e9ab-a7df-4e1a-af7d-dde7952cf206")] + public string trajectAssessmentInformationString + { + get { return _trajectAssessmentInformationString; } + set { _trajectAssessmentInformationString = value; } + } + + + /// + /// Constructs a new instance. + /// + public ReadSecurityCategoriesView() + { + // Do not delete - a parameterless constructor is required! + } + + /// + /// Performs the playback of actions in this module. + /// + /// You should not call this method directly, instead pass the module + /// instance to the method + /// that will in turn invoke this method. + void ITestModule.Run() + { + var trajectAssessmentInformation = TrajectResultInformation.BuildAssessmenTrajectInformation(trajectAssessmentInformationString); + var tableRows = AutomatedSystemTestsRepository.Instance.RiskeerMainWindow.ContainerMultipleViews.DocumentViewContainer.SecurityCategoriesViewTable.Rows; + foreach (var row in tableRows) { + var cellUpperLimit = row.Cells[4]; + cellUpperLimit.Focus(); + cellUpperLimit.Select(); + trajectAssessmentInformation.UpperLimitsSecurityBoundaries.Add(cellUpperLimit.Text.ToNoGroupSeparator()); + } + trajectAssessmentInformationString = JsonConvert.SerializeObject(trajectAssessmentInformation, Formatting.Indented); + } + } +} Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/Validation/DocumentView/ValidateFailureTrajectInformationAssemblyView.cs =================================================================== diff -u -r5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4 -re56b692700e070e3e7b3b1dbb6d0531789d5795c --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/Validation/DocumentView/ValidateFailureTrajectInformationAssemblyView.cs (.../ValidateFailureTrajectInformationAssemblyView.cs) (revision 5c4cba364ae4a0f38505a4ac89c0ec9a9e7941d4) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/Validation/DocumentView/ValidateFailureTrajectInformationAssemblyView.cs (.../ValidateFailureTrajectInformationAssemblyView.cs) (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -14,6 +14,7 @@ using System.Threading; using WinForms = System.Windows.Forms; using Ranorex_Automation_Helpers.UserCodeCollections; +using System.Linq; using Ranorex; using Ranorex.Core; @@ -60,7 +61,7 @@ var trajectResultInformation = TrajectResultInformation.BuildAssessmenTrajectInformation(trajectAssessmentInformationString); var expectedFailureProbTraject = CalculateFailureProbTraject(trajectResultInformation); - var expectedAssessmentLabelTraject = CalculateAssessmentLabelTraject(trajectResultInformation, expectedFailureProbTraject); + var expectedAssessmentLabelTraject = CalculateAssessmentLabelTraject(trajectResultInformation.UpperLimitsSecurityBoundaries, expectedFailureProbTraject); Validate.AreEqual(actualFailureProbTraject, expectedFailureProbTraject); Validate.AreEqual(actualAssessmentTrajectLabel, expectedAssessmentLabelTraject); @@ -84,11 +85,25 @@ return "1/" + denomProbTraject; } - private string CalculateAssessmentLabelTraject(TrajectResultInformation trajectResultInformation, string failureProb) + private string CalculateAssessmentLabelTraject(List upperLimits, string failureProb) { - return "A"; + var lowestUpperLimit = upperLimits.Where(ul=>ProbabilityToDouble(failureProb) { + "A+", + "A", + "B", + "C", + "D" + }; + var label = allLabels[upperLimits.IndexOf(lowestUpperLimit)]; + return label; } + private double ProbabilityToDouble(string prob) + { + return 1.0 / Double.Parse(prob.Substring(2)); + } + private void ValidateCellBackgroundColorLabelAssessmentTraject(string label, RepoItemInfo textFieldfInfo) { int startX; Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Script22.rxtst =================================================================== diff -u -raa3ed2f940f4567b88241d93b514067265c01022 -re56b692700e070e3e7b3b1dbb6d0531789d5795c --- System tests/AutomatedSystemTests/AutomatedSystemTests/Script22.rxtst (.../Script22.rxtst) (revision aa3ed2f940f4567b88241d93b514067265c01022) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Script22.rxtst (.../Script22.rxtst) (revision e56b692700e070e3e7b3b1dbb6d0531789d5795c) @@ -534,6 +534,20 @@ + + + + + + @@ -1457,6 +1471,14 @@ name="ValidateFailureTrajectInformationAssemblyView" ref="443ffa80-4cc7-4849-b6f7-51c8af392630" type="UserCode"> + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1893,14 +1839,6 @@ id="59093ff3-0dda-4e58-9cf5-4b090322a67a" name="CreateOutputFolder"> - - - - + + + + (); + UpperLimitsSecurityBoundaries = new List(); } + public List ListFMsResultInformation {get; set;} + public List UpperLimitsSecurityBoundaries {get; set;} + public static TrajectResultInformation BuildAssessmenTrajectInformation(string trajectAssessmentInformationString) { TrajectResultInformation trajectAssessmentInformation; @@ -129,6 +133,7 @@ } return trajectAssessmentInformation; } + }