Skip to content

Commit b52fdf7

Browse files
Merge pull request #4241 from Ginger-Automation/master
Add new commits into Unit_Build_Test_Jobs
2 parents 617962f + d98d9fd commit b52fdf7

132 files changed

Lines changed: 7161 additions & 1101 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Ginger/Ginger/Actions/ActionConversion/ConversionConfigurationWzardPage.xaml.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ limitations under the License.
2929
using System.Windows;
3030
using System.Windows.Controls;
3131
using System.Windows.Data;
32+
using static Ginger.Actions.ActionConversion.ActionsConversionWizard;
3233

3334
namespace Ginger.Actions.ActionConversion
3435
{
@@ -82,7 +83,13 @@ private void POMSelectedEventHandler(object sender, Guid guid)
8283
/// <param name="WizardEventArgs"></param>
8384
private void Init(WizardEventArgs WizardEventArgs)
8485
{
85-
((WizardWindow)mWizard.mWizardWindow).xFinishButton.IsEnabled = false;
86+
if (mWizard.ConversionType == eActionConversionType.SingleBusinessFlow)
87+
{
88+
if (mWizard.mWizardWindow is WizardWindow wizardWindow)
89+
{
90+
wizardWindow.xFinishButton.IsEnabled = true;
91+
}
92+
}
8693
xPOMSelectionPage.OwnerWindow = (Window)mWizard.mWizardWindow;
8794
DataContext = mWizard;
8895
xRadSameActivity.IsChecked = !mWizard.NewActivityChecked;
@@ -195,7 +202,7 @@ private ObservableList<ConvertableTargetApplicationDetails> GetTargetApplication
195202
{
196203
ObservableList<ConvertableTargetApplicationDetails> lstTA = [];
197204
// fetching list of selected convertible activities from the first grid
198-
if (mWizard.ConversionType == ActionsConversionWizard.eActionConversionType.SingleBusinessFlow)
205+
if (mWizard.ConversionType == eActionConversionType.SingleBusinessFlow)
199206
{
200207
foreach (var targetBase in mWizard.Context.BusinessFlow.TargetApplications)
201208
{

Ginger/Ginger/Actions/ActionEditPage.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<DataTemplate x:Key="ClearExpectedValueBtnTemplate">
5353
<Button x:Name="ClearExpectedValueBtn" Content="X" Click="GridClearExpectedValueBtn_Click" Style="{DynamicResource DataGridCellButtonStyle}" ToolTip="Clear Expected Value"/>
5454
</DataTemplate>
55+
<DataTemplate x:Key="GridInputValuesBrowseBtnTemplate">
56+
<Button x:Name="GridInputValuesBrowseBtn" Content="Browse" Click="GridInputValuesBrowseBtn_Click" Style="{DynamicResource DataGridCellButtonStyle}" IsEnabled="{Binding IsBrowseNeeded,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"/>
57+
</DataTemplate>
5558
</Grid.Resources>
5659
<Grid.RowDefinitions>
5760
<RowDefinition Height="*" />

Ginger/Ginger/Actions/ActionEditPage.xaml.cs

Lines changed: 82 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,15 @@ private void SwitchingInputValueBoxAndGrid(Act a)
747747
//for CLI Orchestration need to show by default
748748
minimumInputValuesToHideGrid = -1;
749749
}
750+
if (a.GetType() == typeof(ActPublishArtifacts))
751+
{
752+
minimumInputValuesToHideGrid = -1;
753+
xInputValuesGrid.Title = "File Path of Artifacts to be Published.";
754+
}
755+
else
756+
{
757+
xInputValuesGrid.Title = "Input Value(s)";
758+
}
750759

751760
if (a.GetType() != typeof(ActDBValidation) && a.GetType() != typeof(ActTableElement) &&
752761
a.GetType() != typeof(ActLaunchJavaWSApplication) && a.GetType() != typeof(ActJavaEXE) &&
@@ -907,7 +916,20 @@ private void RefreshOutputValuesGridElements(object sender, RoutedEventArgs e)
907916

908917
private void AddInputValue(object sender, RoutedEventArgs e)
909918
{
910-
mAction.InputValues.Add(new ActInputValue() { Param = "p" + mAction.InputValues.Count });
919+
mAction.InputValues.Add(new ActInputValue()
920+
{
921+
Param = GetUniqueParamName()
922+
});
923+
}
924+
925+
private string GetUniqueParamName()
926+
{
927+
if (mAction is ActPublishArtifacts)
928+
{
929+
return "Artifact " + (mAction.InputValues.Select(iv => int.TryParse(iv.Param.AsSpan("Artifact ".Length), out var n) ? n : -1).DefaultIfEmpty(-1).Max() + 1);
930+
}
931+
932+
return "p" + (mAction.InputValues.Select(iv => int.TryParse(iv.Param?.TrimStart('p'), out var n) ? n : -1).DefaultIfEmpty(-1).Max() + 1);
911933
}
912934

913935
private void SetActDataSourceConfigGrid()
@@ -968,7 +990,7 @@ private void SetActReturnValuesGrid()
968990
viewCols.Add(new GridColView() { Field = ".....", Header = " ...", WidthWeight = 30, MaxWidth = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["SimulatedlValueExpressionButton"] });
969991
viewCols.Add(new GridColView() { Field = "<<", WidthWeight = 30, MaxWidth = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["AddActualToSimulButton"] });
970992
viewCols.Add(new GridColView() { Field = ActReturnValue.Fields.Actual, Header = "Actual Value", WidthWeight = 180, BindingMode = BindingMode.OneWay });
971-
viewCols.Add(new GridColView() { Field = ".......", Header = "...", WidthWeight = 30, MaxWidth = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["ShowActualValueButton"] });
993+
viewCols.Add(new GridColView() { Field = ".......", Header = "...", WidthWeight = 30, MaxWidth = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["ShowActualValueButton"] });
972994
viewCols.Add(new GridColView() { Field = ">>", WidthWeight = 30, MaxWidth = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["AddActualToExpectButton"] });
973995
viewCols.Add(new GridColView() { Field = nameof(ActReturnValue.Operator), Header = "Operator", WidthWeight = 130, BindingMode = BindingMode.TwoWay, StyleType = GridColView.eGridColStyleType.ComboBox, CellValuesList = OperatorList });
974996
// viewCols.Add(new GridColView() { Field = ">>", WidthWeight = 30, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.pageGrid.Resources["AddActualToExpectButton"] });
@@ -1159,6 +1181,7 @@ private void ColumnMultiSelectComboBox_ItemCheckBoxClick(object? sender, EventAr
11591181

11601182
case "Actual Value":
11611183
customDynamicView.GridColsView.Add(new GridColView() { Field = ActReturnValue.Fields.Actual, Visible = node.IsSelected, WidthWeight = 180 });
1184+
customDynamicView.GridColsView.Add(new GridColView() { Field = ".......", Header = " ...", Visible = node.IsSelected });
11621185
customDynamicView.GridColsView.Add(new GridColView() { Field = ">>", Visible = node.IsSelected });
11631186
columnCount = node.IsSelected ? columnCount + 1 : columnCount;
11641187
columnPreferences += node.IsSelected ? "ActualValue," : "";
@@ -1262,26 +1285,26 @@ private void SetActInputValuesGrid()
12621285
{
12631286
//Show/hide if needed
12641287
xInputValuesGrid.SetTitleLightStyle = true;
1265-
xInputValuesGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddInputValue));//?? going to be hide in next line code
1288+
xInputValuesGrid.btnAdd.RemoveHandler(Button.ClickEvent, new RoutedEventHandler(AddInputValue));
1289+
xInputValuesGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddInputValue));
12661290

12671291
xInputValuesGrid.ClearTools();
12681292
xInputValuesGrid.ShowDelete = System.Windows.Visibility.Visible;
1269-
if (mAction.GetType() == typeof(ActCLIOrchestration))
1293+
if (mAction.GetType() == typeof(ActCLIOrchestration) || mAction.GetType() == typeof(ActPublishArtifacts))
12701294
{
12711295
xInputValuesGrid.ShowAdd = System.Windows.Visibility.Visible;
12721296
xInputValuesGrid.ShowClearAll = System.Windows.Visibility.Visible;
12731297
}
12741298

1275-
//List<GridColView> view = new List<GridColView>();
1276-
GridViewDef view = new GridViewDef(GridViewDef.DefaultViewName)
1299+
GridViewDef view;
1300+
if (mAction.GetType() == typeof(ActPublishArtifacts))
12771301
{
1278-
GridColsView =
1279-
[
1280-
new GridColView() { Field = nameof(ActInputValue.Param), WidthWeight = 40 },
1281-
new GridColView() { Field = nameof(ActInputValue.Value), WidthWeight = 55 },
1282-
new GridColView() { Field = "...", WidthWeight = 5, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["InputValueExpressionButton"] },
1283-
]
1284-
};
1302+
view = GetGridViewForFilePathsInputValues();
1303+
}
1304+
else
1305+
{
1306+
view = GetGridViewForParamValueInputValues();
1307+
}
12851308
//view.GridColsView.Add(new GridColView() { Field = nameof(ActInputValue.ValueForDriver), Header = "Value ForDriver", WidthWeight = 150, BindingMode = BindingMode.OneWay });
12861309

12871310
xInputValuesGrid.SetAllColumnsDefaultView(view);
@@ -1290,6 +1313,31 @@ private void SetActInputValuesGrid()
12901313
xInputValuesGrid.DataSourceList = mAction.InputValues;
12911314
}
12921315

1316+
private GridViewDef GetGridViewForParamValueInputValues()
1317+
{
1318+
return new GridViewDef(GridViewDef.DefaultViewName)
1319+
{
1320+
GridColsView = [
1321+
new GridColView() { Field = nameof(ActInputValue.Param), WidthWeight = 10 },
1322+
new GridColView() { Field = nameof(ActInputValue.Value), WidthWeight = 55 },
1323+
new GridColView() { Field = "...", WidthWeight = 5, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["InputValueExpressionButton"] }
1324+
]
1325+
};
1326+
}
1327+
1328+
private GridViewDef GetGridViewForFilePathsInputValues()
1329+
{
1330+
return new GridViewDef("OnlyFilePaths")
1331+
{
1332+
GridColsView = [
1333+
new GridColView() { Field = nameof(ActInputValue.Param), Visible = false},
1334+
new GridColView() { Field = nameof(ActInputValue.Value), WidthWeight = 55 },
1335+
new GridColView() { Field = "...", WidthWeight = 5, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["InputValueExpressionButton"]},
1336+
new GridColView() { Field = "Browse", WidthWeight = 10, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.xPageGrid.Resources["GridInputValuesBrowseBtnTemplate"] }
1337+
]
1338+
};
1339+
}
1340+
12931341
private void LoadOperationSettingsEditPage(Act a)
12941342
{
12951343
//Each Action need to implement ActionEditPage which return the name of the page for edit
@@ -1302,7 +1350,14 @@ private void LoadOperationSettingsEditPage(Act a)
13021350
{
13031351
// Load the page
13041352
xActionPrivateConfigsFrame.SetContent(actEditPage);
1305-
xActionPrivateConfigsFrame.Visibility = System.Windows.Visibility.Visible;
1353+
if (actEditPage is ActPublishArtifactsEditPage)
1354+
{
1355+
xActionPrivateConfigsFrame.Visibility = Visibility.Collapsed;
1356+
}
1357+
else
1358+
{
1359+
xActionPrivateConfigsFrame.Visibility = System.Windows.Visibility.Visible;
1360+
}
13061361
}
13071362
}
13081363
else
@@ -2474,6 +2529,19 @@ private void xTimeoutTextBox_PreviewTextInput(object sender, TextCompositionEven
24742529

24752530
}
24762531

2532+
private void GridInputValuesBrowseBtn_Click(object sender, RoutedEventArgs e)
2533+
{
2534+
ActInputValue item = (ActInputValue)xInputValuesGrid.CurrentItem;
24772535

2536+
if (General.SetupBrowseFile(new System.Windows.Forms.OpenFileDialog()
2537+
{
2538+
DefaultExt = "*.*",
2539+
Filter = "All files (All Files)|*.*"
2540+
}) is string fileName)
2541+
{
2542+
item.Value = fileName;
2543+
xInputValuesGrid.DataSourceList.CurrentItem = item;
2544+
}
2545+
}
24782546
}
24792547
}

Ginger/Ginger/Actions/ActionEditPages/ActAccessibilityTestingEditPage.xaml.cs

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,17 @@ public ActAccessibilityTestingEditPage(ActAccessibilityTesting act)
5656
xElementLocateByComboBox.BindControl(mAct, Act.Fields.LocateBy, LocateByList);
5757
xLocateValueVE.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(Act.Fields.LocateValue));
5858

59-
ObservableList<OperationValues> StandardTaglist = GetStandardTagslist();
59+
ObservableList<OperationValues>? StandardTaglist;
60+
if (act.Platform == ePlatformType.Mobile)
61+
{
62+
StandardTaglist = GetStandardTagslistMobile();
63+
mAct.CurrentRuleType = ePlatformType.Mobile.ToString();
64+
}
65+
else
66+
{
67+
StandardTaglist = GetStandardTagslist();
68+
mAct.CurrentRuleType = ePlatformType.Web.ToString();
69+
}
6070
ObservableList<OperationValues> SeverityList = GetSeverityList();
6171
mAct.Items = [];
6272
xStdStack.Visibility = Visibility.Visible;
@@ -222,6 +232,49 @@ public ObservableList<OperationValues> GetStandardTagslist()
222232
return StandardTagList;
223233
}
224234

235+
public ObservableList<OperationValues> GetStandardTagslistMobile()
236+
{
237+
ObservableList<OperationValues> StandardTagListMobile = new ObservableList<OperationValues>
238+
{
239+
// WCAG Principles/Levels
240+
new OperationValues() {
241+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.WCAG21A),
242+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.WCAG21A))
243+
},
244+
new OperationValues() {
245+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.WCAG21AA),
246+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.WCAG21AA))
247+
},
248+
new OperationValues() {
249+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.WCAG21AAA),
250+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.WCAG21AAA))
251+
},
252+
253+
// European Standard EN 301 549
254+
new OperationValues() {
255+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.EN_301_549),
256+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.EN_301_549))
257+
},
258+
new OperationValues() {
259+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.EN_9_4_1_2),
260+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.EN_9_4_1_2))
261+
},
262+
new OperationValues() {
263+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.EN_9_4_1_3),
264+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.EN_9_4_1_3))
265+
},
266+
267+
// General Categories / Best Practices
268+
269+
new OperationValues() {
270+
Value = nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.BestPractice),
271+
DisplayName = GingerCore.General.GetEnumValueDescription(typeof(ActAccessibilityTesting.eMobileAccessibilityStandards), nameof(ActAccessibilityTesting.eMobileAccessibilityStandards.BestPractice))
272+
}
273+
};
274+
275+
return StandardTagListMobile;
276+
}
277+
225278
public ObservableList<OperationValues> GetSeverityList()
226279
{
227280
ObservableList<OperationValues> SeverityList =

Ginger/Ginger/Actions/ActionEditPages/ActMobileDeviceEditPage.xaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@
2222
<Actions:UCValueExpression x:Name="xAppPackageVE" HorizontalAlignment="Left" VerticalAlignment="Center" Width="330" Margin="-1,5,0,0"/>
2323
<TextBlock Style="{StaticResource $TextBlockStyle}" FontSize="10" TextWrapping="Wrap" Width="330" Text="Set as 'default' for pointing the initial app package, 'current' for pointing the current running app or specifiy the wanted application package to point on."/>
2424
</StackPanel>
25-
25+
<StackPanel x:Name="xUnlockDevicePnl" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top" Margin="5,10,0,0" Visibility="Collapsed">
26+
<Label Style="{StaticResource $LabelStyle}" Content="Unlock Type:"></Label>
27+
<UserControlsLib1:UCComboBox x:Name="xUnlockTypeComboBox" VerticalAlignment="Top" Margin="0,-2,0,0" Width="241" />
28+
</StackPanel>
2629
<StackPanel x:Name="xInputPnl" HorizontalAlignment="Left" Orientation="Vertical" DockPanel.Dock="Top" Margin="7,10,0,0" Visibility="Collapsed">
27-
<Label x:Name="xInputLabelVE" Style="{StaticResource $LabelStyle}" Content="Input:"/>
30+
<Label x:Name="xInputLabelVE" Style="{StaticResource $LabelStyle}" Content="Input:"/>
2831
<Actions:UCValueExpression x:Name="xInputVE" VerticalAlignment="Top" Width="330"/>
32+
<TextBlock x:Name="xInputTextBlock" Style="{StaticResource $TextBlockStyle}" FontSize="9" TextWrapping="Wrap" Width="330" Text=""/>
2933
</StackPanel>
3034

3135
<StackPanel x:Name="xKeyPressPnl" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top" Margin="5,10,0,0" Visibility="Collapsed">
@@ -92,11 +96,12 @@
9296

9397
<StackPanel x:Name="xFileTransferPnl" HorizontalAlignment="Left" Orientation="Vertical" DockPanel.Dock="Top" Margin="5,10,0,0" Visibility="Collapsed">
9498
<Label x:Name="xFilePathLbl" Style="{StaticResource $LabelStyle}" Content="Device File Path:" Margin="-4,0,0,0"/>
95-
<Actions:UCValueExpression x:Name="xFilePathTextBox" HorizontalAlignment="Left" Margin="0,0,0,0" Width="330"/>
99+
<Actions:UCValueExpression x:Name="xFilePathTextBox" HorizontalAlignment="Left" Margin="0,0,0,0" Width="335"/>
100+
<TextBlock x:Name="xFileTextBlock" Style="{StaticResource $TextBlockStyle}" FontSize="10" TextWrapping="Wrap" Width="330" Text=""/>
96101
<Label x:Name="xFolderPathLbl" Style="{StaticResource $LabelStyle}" Content="Local Target Folder:" Margin="-3,0,0,0"/>
97-
<Actions:UCValueExpression x:Name="xFolderPathTxtBox" Width="340" />
102+
<Actions:UCValueExpression x:Name="xFolderPathTxtBox" Width="335" />
103+
<TextBlock x:Name="xFolderTextBlock" Style="{StaticResource $TextBlockStyle}" FontSize="10" TextWrapping="Wrap" Width="330" Text="Target Folders Path:&#10;Documents: /storage/emulated/0/Documents/&#10;Pictures: /storage/emulated/0/Pictures/&#10;Downloads: /storage/emulated/0/Download/"/>
98104
</StackPanel>
99-
100105
<StackPanel x:Name="xSpecificPerformanceDataPnl" HorizontalAlignment="Left" Orientation="Vertical" DockPanel.Dock="Top" Margin="0,2,0,0" Visibility="Collapsed">
101106
<Label Style="{StaticResource $LabelStyle}" Content="Data Type:" Margin="0,0,0,0"/>
102107
<UserControlsLib1:UCComboBox x:Name="xDataTypeComboBox" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,-6,0,0" Width="250"/>
@@ -105,7 +110,6 @@
105110
<Label Style="{StaticResource $LabelStyle}" Content="Choose State: "/>
106111
<UserControlsLib1:UCComboBox x:Name="xDeviceRotateComboBox" VerticalAlignment="Top" Margin="0,-2,0,0" Width="241"/>
107112
</StackPanel>
108-
109113
<Ginger:ucGrid x:Name="xMultiTouchGrid" Title="Touch Operations to Perform" ShowTitle="Collapsed" Visibility="Collapsed" Margin="0,10,0,0"/>
110114

111115
</DockPanel>

0 commit comments

Comments
 (0)