Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade appium solution #3876

Merged
merged 13 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<DockPanel>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top">
<Label Style="{StaticResource $LabelStyle}" Content="Operation:"/>
<UserControlsLib1:UCComboBox x:Name="xOperationNameComboBox" VerticalAlignment="Top" Width="200" Margin="10,0,0,0"/>
<UserControlsLib1:UCComboBox x:Name="xOperationNameComboBox" VerticalAlignment="Top" Width="250" Margin="10,0,0,0"/>
</StackPanel>

<StackPanel x:Name="xKeyPressPnl" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top" Margin="0,10,0,0" Visibility="Collapsed">
Expand Down Expand Up @@ -55,5 +55,32 @@
<UserControlsLib1:UcLabel Content="*Action will work only with a UFTM mobile device"></UserControlsLib1:UcLabel>
<UserControlsLib1:UcLabel Content="*Andoid device will simulate FingerPrint, iOS devices will simulate FaceID"></UserControlsLib1:UcLabel>
</StackPanel>

<StackPanel x:Name="xAppPnl" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top" Margin="0,10,0,0" Visibility="Collapsed">
<Label Style="{StaticResource $LabelStyle}" Content="Application package:"/>
<Actions:UCValueExpression x:Name="xAppPackageVE" VerticalAlignment="Top" Width="350"/>
</StackPanel>

<StackPanel x:Name="xPressPnl" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top" Margin="0,10,0,0" Visibility="Collapsed">
<Label Style="{StaticResource $LabelStyle}" Content="Press duration (milliseconds):" Margin="0 0 0 0"/>
<Activities:UCValueExpression x:Name="xPressDurationTxtBox" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100" />
</StackPanel>

<StackPanel x:Name="xDragPnl" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Top" Margin="0,10,0,0" Visibility="Collapsed">
<Label Style="{StaticResource $LabelStyle}" Content="Drag duration (milliseconds):" Margin="0 0 0 0"/>
<Activities:UCValueExpression x:Name="xDragDurationTxtBox" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100"/>
</StackPanel>

<StackPanel x:Name="xSwipePnl" HorizontalAlignment="Left" Orientation="Vertical" DockPanel.Dock="Top" Margin="0,10,0,0" Visibility="Collapsed">
<StackPanel x:Name="xSwipeScalePnl" Orientation="Horizontal">
<Label Style="{StaticResource $LabelStyle}" Content="Swipe scale (0.1-1):" Margin="0 0 0 0"/>
<Activities:UCValueExpression x:Name="xSwipeScaleTxtBox" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<Label Style="{StaticResource $LabelStyle}" Content="Swipe duration (milliseconds):" Margin="0 0 0 0"/>
<Activities:UCValueExpression x:Name="xSwipeDurationTxtBox" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100"/>
</StackPanel>
</StackPanel>

</DockPanel>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ private void BindControls()

xPhotoSumilationTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(nameof(ActMobileDevice.SimulatedPhotoPath)), true, true, UCValueExpression.eBrowserType.File, "*", ValueTextBox_ClickBrowse);

xAppPackageVE.Init(Context.GetAsContext(mAct.Context), mAct.ActionAppPackage, nameof(ActInputValue.Value));

xPressDurationTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.PressDuration, nameof(ActInputValue.Value));
xDragDurationTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.DragDuration, nameof(ActInputValue.Value));
xSwipeScaleTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.SwipeScale, nameof(ActInputValue.Value));
xSwipeDurationTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.SwipeDuration, nameof(ActInputValue.Value));

UpdateBaseLineImage(true);


Expand Down Expand Up @@ -196,6 +203,10 @@ private void SetControlsView()
xXY2Pnl.Visibility = Visibility.Collapsed;
xPhotoSimulationPnl.Visibility = Visibility.Collapsed;
xAuthSimulationPnl.Visibility = Visibility.Collapsed;
xAppPnl.Visibility = Visibility.Collapsed;
xPressPnl.Visibility = Visibility.Collapsed;
xDragPnl.Visibility = Visibility.Collapsed;
xSwipePnl.Visibility = Visibility.Collapsed;

switch (mAct.MobileDeviceAction)
{
Expand All @@ -204,24 +215,52 @@ private void SetControlsView()
xKeyPressPnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.PressXY:
case ActMobileDevice.eMobileDeviceAction.LongPressXY:
case ActMobileDevice.eMobileDeviceAction.TapXY:
case ActMobileDevice.eMobileDeviceAction.DoubleTapXY:
case ActMobileDevice.eMobileDeviceAction.LongPressXY:
xXY1Pnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.PressXY:
xXY1Pnl.Visibility = Visibility.Visible;
xPressPnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.DragXYXY:
xXY1Pnl.Visibility = Visibility.Visible;
xXY2Pnl.Visibility = Visibility.Visible;
xPressPnl.Visibility = Visibility.Visible;
xDragPnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.SwipeByCoordinates:
xXY1Pnl.Visibility = Visibility.Visible;
xXY2Pnl.Visibility = Visibility.Visible;
xSwipePnl.Visibility = Visibility.Visible;
xSwipeScalePnl.Visibility = Visibility.Collapsed;
break;

case ActMobileDevice.eMobileDeviceAction.SwipeDown:
case ActMobileDevice.eMobileDeviceAction.SwipeUp:
case ActMobileDevice.eMobileDeviceAction.SwipeLeft:
case ActMobileDevice.eMobileDeviceAction.SwipeRight:
xSwipePnl.Visibility = Visibility.Visible;
xSwipeScalePnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.SimulatePhoto:
case ActMobileDevice.eMobileDeviceAction.SimulateBarcode:
xPhotoSimulationPnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.SimulateBiometrics:
xAuthSimulationPnl.Visibility = Visibility.Visible;
break;

case ActMobileDevice.eMobileDeviceAction.CloseApp:
case ActMobileDevice.eMobileDeviceAction.OpenApp:
xAppPnl.Visibility = Visibility.Visible;
break;
}
}

Expand Down
18 changes: 11 additions & 7 deletions Ginger/Ginger/Drivers/DriversWindows/MobileDriverWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:UserControls="clr-namespace:Amdocs.Ginger.UserControls" xmlns:Ginger="clr-namespace:Ginger" xmlns:GingerCore="clr-namespace:GingerCore;assembly=GingerCore"
mc:Ignorable="d"
Title="Loading Device..." Height="685" Width="323"
MinHeight="600" MinWidth="300" WindowStyle="SingleBorderWindow"
MinHeight="600" MinWidth="300" WindowStyle="ToolWindow" ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen" Closing="Window_Closing" SizeChanged="Window_SizeChanged" Loaded="Window_Loaded"
Topmost="False" KeyDown="Window_KeyDown">
<Grid x:Name="xWindowGrid" Background="{StaticResource $BackgroundColor_LightGray}">
<Grid x:Name="xWindowGrid" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="xMeticsCol" Width="350"/>
<ColumnDefinition Width="35*"/>
Expand Down Expand Up @@ -79,7 +79,6 @@

<Grid x:Name="xDeviceViewGrid" Margin="5" Grid.Column="1" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>

<ColumnDefinition Width="12"/>
<ColumnDefinition Width="100*"/>
<ColumnDefinition Width="12"/>
Expand All @@ -97,10 +96,10 @@
<UserControls:ImageMakerControl x:Name="xRecordingImage" Grid.Row="0" Grid.Column="1" Height="16" Width="16" ImageType="Recording" Foreground="Red" ImageForeground="Red" HorizontalAlignment="Right" VerticalAlignment="Center" SetBorder="False" ToolTip="Recording..." Margin="0,0,80,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xConfigurationsBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Right" VerticalAlignment="Bottom" ButtonFontImageSize="15" ButtonImageType="Config" Click="xConfigurationsBtn_Click" ToolTip="Show Configurations" Margin="0,0,25,0" />
<UserControls:ucButton x:Name="xPinBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Right" VerticalAlignment="Bottom" ButtonFontImageSize="14" ButtonImageType="Pin" Click="xPinBtn_Click" ToolTip="Dock Window" Margin="0,1,5,0" />
<UserControls:ucButton x:Name="xCordBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="13" ButtonImageType="Target" Click="xCordBtn_Click" ToolTip="Show Mouse Coordinates" Margin="45,0,0,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xSwipeBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="13" ButtonImageType="Pointer" Click="xSwipeBtn_Click" ToolTip="Perform Swipe" Margin="25,0,0,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xPortraiteBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="16" ButtonImageType="Mobile" Click="xOrientationBtn_Click" ToolTip="Switch to Portrait" Margin="5,0,0,0" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xLandscapeBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="16" ButtonImageType="Mobile" Click="xOrientationBtn_Click" ToolTip="Switch to Landscape" Margin="5,0,0,0" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
<UserControls:ucButton x:Name="xCordBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="13" ButtonImageType="Target" Click="xCordBtn_Click" ToolTip="Show Mouse Coordinates" Margin="65,0,0,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xSwipeBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="13" ButtonImageType="Pointer" Click="xSwipeBtn_Click" ToolTip="Perform Swipe" Margin="45,0,0,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xPortraiteBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="16" ButtonImageType="Mobile" Click="xOrientationBtn_Click" ToolTip="Switch to Portrait" Margin="26,0,0,0" Visibility="Collapsed"/>
<UserControls:ucButton x:Name="xLandscapeBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="16" ButtonImageType="Mobile" Click="xOrientationBtn_Click" ToolTip="Switch to Landscape" Margin="26,0,0,0" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
<UserControls:ucButton.RenderTransform>
<TransformGroup>
<ScaleTransform/>
Expand All @@ -110,6 +109,7 @@
</TransformGroup>
</UserControls:ucButton.RenderTransform>
</UserControls:ucButton>
<UserControls:ucButton x:Name="xExternalViewBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" ButtonFontImageSize="13" ButtonImageType="ShareExternal" Click="xExternalViewBtn_Click" ToolTip="Open Device External View" Margin="5,0,0,0" Visibility="Collapsed" />
<UserControls:ucButton x:Name="xMetricsBtn" Grid.Row="0" Grid.Column="1" ButtonType="ImageButton" HorizontalAlignment="Right" VerticalAlignment="Bottom" ButtonFontImageSize="15" ButtonImageType="Parameter" Click="xMetricsBtn_Click" ToolTip="Show Device Metrics" Margin="0,0,50,0" />

<!--Sides-->
Expand Down Expand Up @@ -211,6 +211,10 @@
</ComboBox>
</StackPanel>
<UserControls:ucButton x:Name="xClearHighlightBtn" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="Invisible" Click="xClearHighlightsBtn_Click" ToolTip="Clear Highlights" Margin="0,5,0,0"/>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<UserControls:ucButton x:Name="xZoomInBtn" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="PlusSquare" Click="xZoomInBtn_Click" ToolTip="Zoom In" Margin="10,0,0,0"/>
<UserControls:ucButton x:Name="xZoomOutBtn" ButtonType="ImageButton" HorizontalAlignment="Left" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="MinusSquare" Click="xZoomOutBtn_Click" ToolTip="Zoom Out" Margin="10,0,0,0"/>
</StackPanel>
<UserControls:ucButton x:Name="xDeviceSettingsBtn" ButtonType="RoundTextAndImageButton" HorizontalAlignment="Left" Visibility="Collapsed" VerticalAlignment="Center" ButtonFontImageSize="16" ButtonImageHeight="16" ButtonImageWidth="16" ButtonImageType="Config" Click="xDeviceSettingsBtn_Click" ButtonText="Device Settings" Margin="0,10,0,0"/>
</StackPanel>
</ScrollViewer>
Expand Down
Loading
Loading