Skip to content

Commit

Permalink
Ginger Runset Execution Report DB Link to ALM
Browse files Browse the repository at this point in the history
  • Loading branch information
amanpras committed Jun 7, 2024
1 parent 3eb8bdb commit 09f3c1e
Show file tree
Hide file tree
Showing 15 changed files with 295 additions and 158 deletions.
79 changes: 44 additions & 35 deletions Ginger/Ginger/Run/RunSetActions/ExportResultsToALMConfigPage.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--//# Status=Cleaned; Comment=Cleaned on 05/23/18-->
<Page x:Class="Ginger.Run.ExportResultsToALMConfigPage"
<Page x:Class="Ginger.Run.ExportResultsToALMConfigPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand All @@ -9,33 +9,33 @@
xmlns:UserControlsLib="clr-namespace:Ginger.UserControlsLib"
xmlns:GingerCore="clr-namespace:GingerCore;assembly=GingerCore"
mc:Ignorable="d"
d:DesignHeight="210" d:DesignWidth="600"
d:DesignHeight="241.8" d:DesignWidth="570"
Title="RunSetActionPublishToQCEditPage">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">ALM Type:</Label>
<DockPanel>
<UserControlsLib:UCComboBox x:Name="xALMTypeCbx" ContextMenu="{x:Null}" Margin="170,0,0,0" Width="300" HorizontalAlignment="Left" ></UserControlsLib:UCComboBox>
<usercontrols:ucButton x:Name="xSetFieldsBtn" ButtonType="RoundTextAndImageButton" HorizontalAlignment="Left" Margin="20,0,0,0" ButtonText="Set Fields" ButtonImageType="ALM" ButtonFontImageSize="15" ButtonImageWidth="15" ButtonImageHeight="15" ButtonStyle="{StaticResource $RoundTextAndImageButtonStyle}" Click="xSetFieldsBtn_Click"/>
</DockPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">ALM Test Set Level:</Label>
<UserControlsLib:UCComboBox x:Name="xALMTestSetLevelCbx" Margin="120,0,0,0" Width="300" HorizontalAlignment="Left"></UserControlsLib:UCComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" x:Name="xExportTypePanel" Visibility="Collapsed">
<Label Style="{StaticResource @LabelStyle}">Export Type:</Label>
<UserControlsLib:UCComboBox x:Name="xExportTypeCbx" ContextMenu="{x:Null}" Margin="155,0,0,0" Width="300" HorizontalAlignment="Left"></UserControlsLib:UCComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">ALM Type:</Label>
<DockPanel>
<UserControlsLib:UCComboBox x:Name="xALMTypeCbx" ContextMenu="{x:Null}" Margin="170,0,0,0" Width="300" HorizontalAlignment="Left" ></UserControlsLib:UCComboBox>
<usercontrols:ucButton x:Name="xSetFieldsBtn" ButtonType="RoundTextAndImageButton" HorizontalAlignment="Left" Margin="20,0,0,0" ButtonText="Set Fields" ButtonImageType="ALM" ButtonFontImageSize="15" ButtonImageWidth="15" ButtonImageHeight="15" ButtonStyle="{StaticResource $RoundTextAndImageButtonStyle}" Click="xSetFieldsBtn_Click"/>
</DockPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">ALM Test Set Level:</Label>
<UserControlsLib:UCComboBox x:Name="xALMTestSetLevelCbx" Margin="120,0,0,0" Width="300" HorizontalAlignment="Left"></UserControlsLib:UCComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" x:Name="xExportTypePanel" Visibility="Collapsed">
<Label Style="{StaticResource @LabelStyle}">Export Type:</Label>
<UserControlsLib:UCComboBox x:Name="xExportTypeCbx" ContextMenu="{x:Null}" Margin="155,0,0,0" Width="300" HorizontalAlignment="Left"></UserControlsLib:UCComboBox>
</StackPanel>
<StackPanel x:Name="SearchALMEntityByNamePnl" Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">Search By Name:</Label>
<CheckBox x:Name="SearchALMEntityByName" Style="{StaticResource @CheckBoxStyle}" Margin="130,5,0,0">
</CheckBox>
</StackPanel>
<StackPanel x:Name="xExportDestinationFolder" Visibility="Collapsed">
</StackPanel>

<StackPanel x:Name="xExportDestinationFolder" Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}" Margin="0,10,0,0">Test Set Export Folder:</Label>
<Actions:UCValueExpression x:Name="xTestSetFolderDestination" Margin="100,10,0,0" Width="300" HorizontalAlignment="Left"/>
Expand All @@ -44,12 +44,12 @@
<Label Style="{StaticResource @LabelStyle}" Margin="0,10,0,0">Test Cases Export Folder:</Label>
<Actions:UCValueExpression x:Name="xTestCaseFolderDestination" Margin="85,10,0,0" Width="300" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}" Margin="0,10,0,0">Test Cases Results to Export :</Label>
<ComboBox x:Name="xFilterByStatusDroplist" ContextMenu="{x:Null}" Width="300" HorizontalAlignment="Left" Margin="65,0,0,0" Style="{DynamicResource $FlatEditInputComboBoxStyle}"></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}" Margin="0,10,0,0">Test Cases Results to Export :</Label>
<ComboBox x:Name="xFilterByStatusDroplist" ContextMenu="{x:Null}" Width="300" HorizontalAlignment="Left" Margin="65,0,0,0" Style="{DynamicResource $FlatEditInputComboBoxStyle}"></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">
<Label.Content>
<GingerCore:ucTextDicResource Text="Attach [ActivitiesGroups] Report to TC's:"/>
Expand All @@ -58,20 +58,29 @@
<CheckBox x:Name="AttachActivitiesGroupReportCbx" Style="{StaticResource @CheckBoxStyle}" Margin="10,6,0,0" Checked="AttachActivitiesGroupReportCbx_Checked" Unchecked="AttachActivitiesGroupReportCbx_Unchecked">
</CheckBox>

</StackPanel>
<StackPanel Orientation="Horizontal">
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">
<Label.Content>
<GingerCore:ucTextDicResource Text="Use User [Variable] TC Run Instance:"/>
<GingerCore:ucTextDicResource Text="Use User [Variable] TC Run Instance:"/>
</Label.Content>
</Label>
<CheckBox x:Name="UseVariableInTCRunNameCbx" Style="{StaticResource @CheckBoxStyle}" Margin="30,8,0,0" Checked="UseVariableInTCRunNameCbx_Checked" Unchecked="UseVariableInTCRunNameCbx_Unchecked">
<CheckBox x:Name="UseVariableInTCRunNameCbx" Style="{StaticResource @CheckBoxStyle}" Margin="32,8,0,0" Checked="UseVariableInTCRunNameCbx_Checked" Unchecked="UseVariableInTCRunNameCbx_Unchecked">
</CheckBox>
</StackPanel>
<StackPanel Margin="5,0,0,15" x:Name="VariableForTCRunNamePanel" Orientation="Horizontal" IsEnabled="False">
<Label Style="{StaticResource @LabelStyle}" Margin="0,10,0,0">TC Run Instance Name:</Label>
<Actions:UCValueExpression x:Name="VariableForTCRunName" Margin="90,0,0,0" Width="300" ToolTip="From"/>
</StackPanel>
</StackPanel>
<StackPanel x:Name="xExportReportStack" Visibility="Visible" Orientation="Horizontal">
<Label Style="{StaticResource @LabelStyle}">
<Label.Content>
<GingerCore:ucTextDicResource Text="Export Execution Report Link :"/>
</Label.Content>
</Label>
<CheckBox x:Name="ExportReportLink" Binding.TargetUpdated="ExportReportLink_TargetUpdated" Style="{StaticResource @CheckBoxStyle}" Margin="60,8,0,0">
</CheckBox>
</StackPanel>
<StackPanel x:Name="VariableForTCRunNamePanel" Orientation="Horizontal" IsEnabled="False">
<Label Style="{StaticResource @LabelStyle}" Margin="0,10,8,0">TC Run Instance Name:</Label>
<Actions:UCValueExpression x:Name="VariableForTCRunName" Margin="90,10,10,0" Width="300" ToolTip="From" Height="25"/>
</StackPanel>

<Button x:Name="xExportToALMBtn" Content="Export To ALM" Style="{StaticResource @WindowButtonStyle}" Width="100" Margin="5 0 0 0" HorizontalAlignment="Left" Visibility="Collapsed" Click="xExportToALMBtn_Click"></Button>
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ limitations under the License.
using Amdocs.Ginger.Repository;
using Amdocs.Ginger.UserControls;
using Ginger.ALM;
using Ginger.Reports;
using Ginger.Run.RunSetActions;
using GingerCore;
using GingerCore.ALM;
Expand All @@ -47,6 +48,7 @@ public partial class ExportResultsToALMConfigPage : Page
GenericWindow genWin = null;
ObservableList<BusinessFlow> mBfs = new ObservableList<BusinessFlow>();
PublishToALMConfig mPublishToALMConfig = new PublishToALMConfig();
ExecutionLoggerConfiguration mExecutionLoggerConfiguration = new ExecutionLoggerConfiguration();
public bool IsProcessing = false;
ImageMakerControl loaderElement;
ValueExpression mVE = null;
Expand All @@ -64,6 +66,7 @@ public ExportResultsToALMConfigPage(RunSetActionPublishToQC runSetActionPublishT
BindingHandler.ObjFieldBinding(VariableForTCRunName, TextBox.TextProperty, runSetActionPublishToQC, nameof(RunSetActionPublishToQC.VariableForTCRunName));
BindingHandler.ObjFieldBinding(UseVariableInTCRunNameCbx, CheckBox.IsCheckedProperty, runSetActionPublishToQC, nameof(RunSetActionPublishToQC.isVariableInTCRunUsed));
BindingHandler.ObjFieldBinding(AttachActivitiesGroupReportCbx, CheckBox.IsCheckedProperty, runSetActionPublishToQC, nameof(RunSetActionPublishToQC.toAttachActivitiesGroupReport));
BindingHandler.ObjFieldBinding(ExportReportLink, CheckBox.IsCheckedProperty, runSetActionPublishToQC, nameof(RunSetActionPublishToQC.toExportReportLink));
BindingHandler.ObjFieldBinding(SearchALMEntityByName, CheckBox.IsCheckedProperty, runSetActionPublishToQC, nameof(RunSetActionPublishToQC.SearchALMEntityByName));
xFilterByStatusDroplist.BindControl(runSetActionPublishToQC, nameof(RunSetActionPublishToQC.FilterStatus));
xALMTypeCbx.Init(runSetActionPublishToQC, nameof(RunSetActionPublishToQC.PublishALMType),
Expand All @@ -79,6 +82,7 @@ public ExportResultsToALMConfigPage(RunSetActionPublishToQC runSetActionPublishT
xALMTypeCbx_SelectionChanged(this, null);
SetTestLevelComboBoxList(runSetActionPublishToQC.RunAt);
PropertyChangedEventManager.AddHandler(runSetActionPublishToQC, RunAt_PropertyChanged, string.Empty);

}

private ExportResultsToALMConfigPage()
Expand All @@ -93,6 +97,7 @@ private ExportResultsToALMConfigPage()
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(VariableForTCRunName, TextBox.TextProperty, mPublishToALMConfig, nameof(PublishToALMConfig.VariableForTCRunName));
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(UseVariableInTCRunNameCbx, CheckBox.IsCheckedProperty, mPublishToALMConfig, nameof(PublishToALMConfig.IsVariableInTCRunUsed));
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(AttachActivitiesGroupReportCbx, CheckBox.IsCheckedProperty, mPublishToALMConfig, nameof(PublishToALMConfig.ToAttachActivitiesGroupReport));
GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ExportReportLink, CheckBox.IsCheckedProperty, mPublishToALMConfig, nameof(PublishToALMConfig.ToExportReportLink));
xFilterByStatusDroplist.BindControl(mPublishToALMConfig, nameof(PublishToALMConfig.FilterStatus));
}

Expand Down Expand Up @@ -124,7 +129,7 @@ public bool Init(ObservableList<BusinessFlow> bfs, ValueExpression VE, Context C
xALMTypeCbx.IsEnabled = false;
mBfs = bfs;
mVE = VE;
mContext = Context;
mContext = Context;
return true;
}
else
Expand Down
12 changes: 8 additions & 4 deletions Ginger/GingerCore/ALM/RQM/ExportToRQM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,16 @@ private ExecutionResult GetExeResultforActivityGroup(BusinessFlow businessFlow,
exeResult.ExecutionRecordExportID = exeRecordId;
exeResult.StartDate = businessFlow.StartTimeStamp.ToString("o");
exeResult.EndDate = businessFlow.EndTimeStamp.ToString("o");
if (!string.IsNullOrEmpty(publishToALMConfig.HtmlReportUrl))
if (publishToALMConfig.ToExportReportLink)
{
exeResult.HtmlReportUrl = publishToALMConfig.HtmlReportUrl;
exeResult.ExecutionId = publishToALMConfig.ExecutionId;
exeResult.ExecutionInstanceId = businessFlow.InstanceGuid.ToString();
if (!string.IsNullOrEmpty(publishToALMConfig.HtmlReportUrl))
{
exeResult.HtmlReportUrl = publishToALMConfig.HtmlReportUrl;
exeResult.ExecutionId = publishToALMConfig.ExecutionId;
exeResult.ExecutionInstanceId = businessFlow.InstanceGuid.ToString();
}
}

int i = 1;
StringBuilder errors;
var relevantActivities = businessFlow.Activities.Where(x => x.ActivitiesGroupID == activGroup.FileName);
Expand Down
4 changes: 3 additions & 1 deletion Ginger/GingerCore/GingerCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<Reference Include="ALM_CommonStd">
<HintPath>DLLs\ALM_CommonStd.dll</HintPath>
</Reference>
<Reference Include="Ginger.ExecuterService.Contracts">
<HintPath>..\GingerCoreNET\DLLS\Ginger.ExecuterService.Contracts.dll</HintPath>
</Reference>
<Reference Include="Interop.TDAPIOLELib">
<HintPath>DLLs\Interop.TDAPIOLELib.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -563,7 +566,6 @@
<PackageReference Include="Freeware.Pdf2Png">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Ginger.ExecuterService.Contracts" Version="24.2.6" />
<PackageReference Include="Google.Protobuf">
<Version>3.15.0</Version>
</PackageReference>
Expand Down
17 changes: 17 additions & 0 deletions Ginger/GingerCoreCommon/ALM/PublishToALMConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ private void OnPropertyChanged(string name)

public bool ToAttachActivitiesGroupReport { get; set; }

private bool mToExportReportLink;
public bool ToExportReportLink
{
get
{
return mToExportReportLink;
}
set
{
if (mToExportReportLink != value)
{
mToExportReportLink = value;
OnPropertyChanged(nameof(ToExportReportLink));
}
}
}

public FilterByStatus FilterStatus { get; set; }
public eALMType PublishALMType { get; set; }
public eALMTestSetLevel ALMTestSetLevel { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ public class RunSetActionPublishToQC : RunSetActionBase, INotifyPropertyChanged
[IsSerializedForLocalRepository]
public bool toAttachActivitiesGroupReport { get { return mtoAttachActivitiesGroupReport; } set { if (mtoAttachActivitiesGroupReport != value) { mtoAttachActivitiesGroupReport = value; OnPropertyChanged(nameof(toAttachActivitiesGroupReport)); } } }


private bool mtoExportReportLink;
[IsSerializedForLocalRepository]
public bool toExportReportLink
{
get
{
return mtoExportReportLink;
}
set
{
if(mtoExportReportLink != value)
{
mtoExportReportLink = value;
OnPropertyChanged(nameof(toExportReportLink));
}
}
}

private FilterByStatus mFilterStatus;
[IsSerializedForLocalRepository]
public FilterByStatus FilterStatus
Expand Down
Loading

0 comments on commit 09f3c1e

Please sign in to comment.