1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
<UserControl x:Class="Tango.FSE.Stubs.Views.TestRunnerExecutionView"
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"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:global="clr-namespace:Tango.FSE.Stubs"
xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels"
xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
xmlns:local="clr-namespace:Tango.FSE.Stubs.Views"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1280" d:DesignStyle="{StaticResource FSE_User_Control_Designer}" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
<Grid>
<Ellipse Fill="{StaticResource FSE_PrimaryBackgroundDarkBrush}" Opacity="0.7" Width="2050" Margin="-1500 -500 0 -500" />
<Grid Margin="10">
<DockPanel>
<Grid Margin="20 20 0 0" Height="100" VerticalAlignment="Top" DockPanel.Dock="Top">
<DockPanel>
<Grid>
<Image Margin="0 10 0 0" Source="../Images/project.png" Stretch="None" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="Fant" />
<material:PackIcon Margin="0 0 -15 15" Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" Width="48" Height="48" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
</Grid>
<StackPanel Margin="20 0 0 0">
<TextBlock FontSize="{StaticResource FSE_ModuleHeaderFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Text="{Binding RunningTestProject.Name}"></TextBlock>
<TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="18" Text="{Binding RunningTestProject.Description}"></TextBlock>
</StackPanel>
</DockPanel>
</Grid>
<Grid Margin="105 0 0 0">
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
<StackPanel>
<StackPanel>
<StackPanel IsEnabled="{Binding ProjectRunner.CanRun}" Margin="0 40 0 0" Visibility="{Binding HasTestInputs,Converter={StaticResource BooleanToVisibilityConverter},FallbackValue='Visible',TargetNullValue='Visible'}">
<TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Inputs</TextBlock>
<!--<Rectangle Margin="0 2 0 0" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />-->
<TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" Text="Please provide the necessary inputs or leave as defaults."></TextBlock>
<ItemsControl Margin="0 10 0 0" ItemsSource="{Binding RunningTestProject.Inputs}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel Margin="0 10 20 10">
<material:PackIcon VerticalAlignment="Center" Kind="Pen" Width="32" Height="32" />
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding DisplayName,FallbackValue='N/A'}"></TextBlock>
<StackPanel Orientation="Horizontal">
<TextBox HorizontalAlignment="Left" Style="{StaticResource FSE_Rounded_Corners_TextBox}" Width="250" Padding="5" Margin="0 2 0 0" Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<material:PackIcon VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource FSE_GrayBrush}" Kind="InfoCircleOutline" />
<TextBlock Margin="5 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Description,FallbackValue='No description provided'}"></TextBlock>
</StackPanel>
</StackPanel>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<StackPanel HorizontalAlignment="Left" Width="1050" Margin="0 20 0 0">
<DockPanel>
<Grid Margin="20 0 0 0" DockPanel.Dock="Right" >
<Button material:ButtonAssist.CornerRadius="25" Command="{Binding StartProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}" IsEnabled="{Binding ProjectRunner.CanRun}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Width="200" Height="50">
<DockPanel>
<material:PackIcon Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" Width="24" Height="24" />
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center">START</TextBlock>
</DockPanel>
</Button>
<Button material:ButtonAssist.CornerRadius="25" Command="{Binding StopProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Width="200" Height="50">
<DockPanel>
<material:PackIcon Kind="Stop" Foreground="{StaticResource FSE_RedBrush}" Width="24" Height="24" />
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center">STOP</TextBlock>
</DockPanel>
</Button>
</Grid>
<StackPanel VerticalAlignment="Bottom">
<TextBlock Text="{Binding Status}"></TextBlock>
<ProgressBar Margin="0 5 0 0" Height="10" IsIndeterminate="{Binding ProjectRunner.IsRunning}" />
</StackPanel>
</DockPanel>
</StackPanel>
</StackPanel>
<StackPanel Margin="0 100 0 0" HorizontalAlignment="Left" Visibility="{Binding ProjectRunner.State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Failed'}">
<TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_RedBrush}">Test Failed</TextBlock>
<TextBlock Margin="0 20 0 0">The test has failed to complete with the following error:</TextBlock>
<TextBlock Text="{Binding FailedError}" Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap"></TextBlock>
</StackPanel>
<StackPanel>
<StackPanel.Style>
<Style TargetType="StackPanel">
<Setter Property="Opacity" Value="0"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ProjectRunner.State}" Value="Completed">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.5" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.5" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<StackPanel Margin="0 100 0 0" HorizontalAlignment="Left" Width="1050">
<TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Results</TextBlock>
<!--<Rectangle Margin="0 2 0 0" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />-->
</StackPanel>
<Grid>
<ItemsControl ItemsSource="{Binding Results}" HorizontalAlignment="Left" Margin="0 20 0 0">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel Margin="10">
<material:PackIcon HorizontalAlignment="Center" VerticalAlignment="Center" Width="42" Height="42">
<material:PackIcon.Style>
<Style TargetType="material:PackIcon">
<Setter Property="Kind" Value="Check"></Setter>
<Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Type}" Value="Warning">
<Setter Property="Kind" Value="Alert"></Setter>
<Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="Failed">
<Setter Property="Kind" Value="Alert"></Setter>
<Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</material:PackIcon.Style>
</material:PackIcon>
<StackPanel Margin="15 0 0 0" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}" ></TextBlock>
<Grid Margin="0 2 0 0">
<TextBlock Visibility="{Binding IsValueArray,Converter={StaticResource BooleanToVisibilityInverseConverter}}" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Value}"></TextBlock>
<StackPanel Orientation="Horizontal" Visibility="{Binding IsValueArray,Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}">
<Run>This test result contains</Run>
<Run Text="{Binding Value.Count,Mode=OneWay}"></Run>
<Run Text="Values."></Run>
</TextBlock>
<Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DisplayResultGridCommand}" CommandParameter="{Binding}" Height="22" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Background="Transparent" BorderBrush="Transparent" Margin="0 -4 0 0">(Grid View)</Button>
</StackPanel>
</Grid>
</StackPanel>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</DockPanel>
</Grid>
</Grid>
</UserControl>
|