diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-22 15:58:38 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-22 15:58:38 +0300 |
| commit | fa5e1c45ab2da4e988cf256c0e5ec521288e537f (patch) | |
| tree | 4ee0608e0382757f5a9ad7f7681c89b65691b20e /Software/Visual_Studio/MachineStudio | |
| parent | de099bd3b50b8ea52b212b8d322626582c2648be (diff) | |
| download | Tango-fa5e1c45ab2da4e988cf256c0e5ec521288e537f.tar.gz Tango-fa5e1c45ab2da4e988cf256c0e5ec521288e537f.zip | |
Implemented some UI test automation for Job create/delete.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
6 files changed, 51 insertions, 11 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index c575ef2a3..99b3a9712 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -6,6 +6,7 @@ xmlns:global="clr-namespace:Tango.MachineStudio.Developer" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:techViews="clr-namespace:Tango.MachineStudio.Technician.Views;assembly=Tango.MachineStudio.Technician" xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" @@ -233,7 +234,7 @@ <TextBlock VerticalAlignment="Center">Remove</TextBlock> </StackPanel> </Button> - <Button Command="{Binding AddSegmentCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10" ToolTip="Add Segment"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddSegmentButton}" Command="{Binding AddSegmentCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10" ToolTip="Add Segment"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">New</TextBlock> @@ -242,7 +243,7 @@ </StackPanel> </Border> - <controls:MultiSelectListBox Style="{StaticResource {x:Type ListBox}}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SegmentsCollectionView}" SelectedItem="{Binding SelectedSegment}" SelectedItemsList="{Binding SelectedSegments,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> + <controls:MultiSelectListBox AutomationProperties.AutomationId="{x:Static automation:Developer.SegmentsListBox}" Style="{StaticResource {x:Type ListBox}}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SegmentsCollectionView}" SelectedItem="{Binding SelectedSegment}" SelectedItemsList="{Binding SelectedSegments,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> @@ -438,13 +439,13 @@ <Grid HorizontalAlignment="Right" Margin="0 0 10 0"> <StackPanel Orientation="Horizontal"> - <Button Height="70" Width="100" Margin="0 0 10 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.ToJobsButton}" Height="70" Width="100" Margin="0 0 10 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> <StackPanel> <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="KeyboardBackspace" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">TO JOBS</TextBlock> </StackPanel> </Button> - <Button Height="70" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.SaveJobButton}" Height="70" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> <StackPanel> <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="ContentSave" /> <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">SAVE JOB</TextBlock> @@ -581,7 +582,7 @@ <TextBlock VerticalAlignment="Center">Remove</TextBlock> </StackPanel> </Button> - <Button Command="{Binding AddBrushStopCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddBrushStopButton}" Command="{Binding AddBrushStopCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">New</TextBlock> @@ -605,7 +606,7 @@ </Rectangle> </Grid> <Grid Margin="0 10 10 0"> - <controls:MultiSelectListBox SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> + <controls:MultiSelectListBox AutomationProperties.AutomationId="{x:Static automation:Developer.BrushStopsListBox}" SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index a8274a4f7..066dc870b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -6,6 +6,7 @@ xmlns:global="clr-namespace:Tango.MachineStudio.Developer" xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" @@ -90,19 +91,19 @@ <Grid DockPanel.Dock="Bottom" Margin="0 20 0 0"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20 0 0 0"> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.DeleteJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF995A" BorderBrush="#FF995A" Command="{Binding DuplicateJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.DuplicateJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF995A" BorderBrush="#FF995A" Command="{Binding DuplicateJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">DUPLICATE</TextBlock> </StackPanel> </Button> - <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddJobCommand}"> + <Button AutomationProperties.AutomationId="{x:Static automation:Developer.NewJobButton}" Margin="0 0 10 0" MinWidth="160" Height="50" Background="#65C682" BorderBrush="#65C682" Command="{Binding AddJobCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> <TextBlock Margin="5 0 0 0" FontSize="16">NEW JOB</TextBlock> @@ -120,7 +121,7 @@ </Grid> <Grid Margin="0 20 0 0"> - <controls:MultiSelectDataGrid Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding JobsCollectionView}" SelectedItem="{Binding SelectedMachineJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}"> + <controls:MultiSelectDataGrid AutomationProperties.AutomationId="{x:Static automation:Developer.JobsDataGrid}" Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding JobsCollectionView}" SelectedItem="{Binding SelectedMachineJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}"> <DataGrid.CellStyle> <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> <Setter Property="BorderThickness" Value="0"/> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Automation/Developer.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Automation/Developer.cs new file mode 100644 index 000000000..2f0437d43 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Automation/Developer.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Automation +{ + public class Developer + { + public static String JobsDataGrid { get; set; } = nameof(JobsDataGrid); + public static String NewJobButton { get; set; } = nameof(NewJobButton); + public static String DeleteJobButton { get; set; } = nameof(DeleteJobButton); + public static String DuplicateJobButton { get; set; } = nameof(DuplicateJobButton); + public static String ToJobsButton { get; set; } = nameof(ToJobsButton); + public static String SaveJobButton { get; set; } = nameof(SaveJobButton); + public static String AddSegmentButton { get; set; } = nameof(AddSegmentButton); + public static String AddBrushStopButton { get; set; } = nameof(AddBrushStopButton); + public static String SegmentsListBox { get; set; } = nameof(SegmentsListBox); + public static String BrushStopsListBox { get; set; } = nameof(BrushStopsListBox); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Automation/UI.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Automation/UI.cs new file mode 100644 index 000000000..2c200e10f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Automation/UI.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Automation +{ + public class UI + { + public static String LoginButton { get; set; } = nameof(LoginButton); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index f722d13ae..4723c7c8b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -73,6 +73,8 @@ </ItemGroup> <ItemGroup> <Compile Include="AutoComplete\MachinesProvider.cs" /> + <Compile Include="Automation\Developer.cs" /> + <Compile Include="Automation\UI.cs" /> <Compile Include="Controls\HiveColorPickerControl.xaml.cs"> <DependentUpon>HiveColorPickerControl.xaml</DependentUpon> </Compile> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml index 7f54263b7..08e1006c1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml @@ -5,6 +5,7 @@ xmlns:rules="clr-namespace:Tango.MachineStudio.Common.ValidationRules;assembly=Tango.MachineStudio.Common" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" @@ -35,7 +36,7 @@ <PasswordBox x:Name="txtPass" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" AutomationProperties.IsRequiredForForm="True" /> </DockPanel> <CheckBox Margin="25 20 0 0" IsChecked="{Binding RememberMe}">Remember me</CheckBox> - <Button Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" Content="LOGIN"> + <Button AutomationProperties.AutomationId="{x:Static automation:UI.LoginButton}" Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" Content="LOGIN"> </Button> </StackPanel> |
