예제 #1
0
        public SeleniumRemoteWebDriverEditPage(GingerCore.Agent mAgent)
        {
            InitializeComponent();

            if (mAgent.DriverConfiguration == null)
            {
                mAgent.DriverConfiguration = new ObservableList <DriverConfigParam>();
            }

            DriverConfigParam GridHostDCP = mAgent.GetOrCreateParam(SeleniumDriver.RemoteGridHubParam, "http://127.0.0.1:4444");

            App.ObjFieldBinding(GridHostTextBox, TextBox.TextProperty, GridHostDCP, "Value");

            DriverConfigParam BrowserNameDCP = mAgent.GetOrCreateParam(SeleniumDriver.RemoteBrowserNameParam, "firefox");

            App.ObjFieldBinding(BrowserNameComboBox, ComboBox.SelectedValueProperty, BrowserNameDCP, "Value");

            DriverConfigParam PlatformDCP = mAgent.GetOrCreateParam(SeleniumDriver.RemotePlatformParam);

            App.ObjFieldBinding(PlatformComboBox, ComboBox.SelectedValueProperty, PlatformDCP, "Value");

            DriverConfigParam VersionDCP = mAgent.GetOrCreateParam(SeleniumDriver.RemoteVersionParam);

            App.ObjFieldBinding(VersionTextBox, TextBox.TextProperty, VersionDCP, "Value");
        }
예제 #2
0
        public AndroidADBDriverEditPage(GingerCore.Agent mAgent)
        {
            InitializeComponent();

            this.mAgent = mAgent;


            if (mAgent.DriverConfiguration == null)
            {
                mAgent.DriverConfiguration = new ObservableList <DriverConfigParam>();
            }

            DriverConfigParam ModelDCP = mAgent.GetOrCreateParam("Model", "");

            App.ObjFieldBinding(DeviceModelTextBox, TextBox.TextProperty, ModelDCP, "Value");

            DriverConfigParam SerialDCP = mAgent.GetOrCreateParam("Serial", "");

            App.ObjFieldBinding(DeviceSerialTextBox, TextBox.TextProperty, SerialDCP, "Value");

            DriverConfigParam LaunchEmulatorCommand = mAgent.GetOrCreateParam("LaunchEmulatorCommand", "");

            App.ObjFieldBinding(LaunchEmulatorCommandTextBox, TextBox.TextProperty, LaunchEmulatorCommand, "Value");

            DriverConfigParam DeviceConfigFolder = mAgent.GetOrCreateParam("DeviceConfigFolder", "");

            App.ObjFieldBinding(DeviceConfigFolderTextBox, TextBox.TextProperty, DeviceConfigFolder, "Value");

            UpdateDeviceViewPage();
        }
예제 #3
0
        private void ParamsGridVEButton_Click(object sender, RoutedEventArgs e)
        {
            DriverConfigParam         DCP  = (DriverConfigParam)DriverConfigurationGrid.CurrentItem;
            ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(DCP, DriverConfigParam.Fields.Value, new Context());

            VEEW.ShowAsWindow();
        }
예제 #4
0
        private void SetDeviceCapabilities(bool init = false)
        {
            DriverConfigParam deviceName = new DriverConfigParam()
            {
                Parameter = "deviceName", Value = string.Empty
            };
            DriverConfigParam udid = new DriverConfigParam()
            {
                Parameter = "udid", Description = "Unique device identifier of the connected physical device", Value = string.Empty
            };

            if (mDevicePlatformType.Value == eDevicePlatformType.Android.ToString())
            {
                deviceName.Description = "The kind of mobile device to use, for example 'Galaxy S21'";
            }
            else
            {
                deviceName.Description = "The kind of mobile device to use, for example 'iPhone 12'";
            }
            if (!init)
            {
                SetCurrentCapabilityValue(deviceName);
                SetCurrentCapabilityValue(udid);
            }
            AddOrUpdateCapability(deviceName);
            AddOrUpdateCapability(udid);
        }
예제 #5
0
        private void CapabilitiesGridVEButton_Click(object sender, RoutedEventArgs e)
        {
            DriverConfigParam         capability = (DriverConfigParam)xCapabilitiesGrid.CurrentItem;
            ValueExpressionEditorPage VEEW       = new ValueExpressionEditorPage(capability, DriverConfigParam.Fields.Value, new Context());

            VEEW.ShowAsWindow();
        }
예제 #6
0
        private void DeleteCapabilityIfExist(string capabilityName)
        {
            DriverConfigParam existingCap = mAppiumCapabilities.MultiValues.Where(x => x.Parameter == capabilityName).FirstOrDefault();

            if (existingCap != null)
            {
                mAppiumCapabilities.MultiValues.Remove(existingCap);
            }
        }
예제 #7
0
        private void SetCurrentCapabilityValue(DriverConfigParam capability)
        {
            DriverConfigParam existingCap = mAppiumCapabilities.MultiValues.Where(x => x.Parameter == capability.Parameter).FirstOrDefault();

            if (existingCap != null && string.IsNullOrEmpty(existingCap.Value) == false)
            {
                capability.Value = existingCap.Value;
            }
        }
예제 #8
0
        private void SetOtherCapabilities(bool init = false)
        {
            DriverConfigParam newCommandTimeout = new DriverConfigParam()
            {
                Parameter = "newCommandTimeout", Description = "How long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the session", Value = "300"
            };

            if (!init)
            {
                SetCurrentCapabilityValue(newCommandTimeout);
            }
            AddOrUpdateCapability(newCommandTimeout);
        }
예제 #9
0
        private void AddOrUpdateCapability(DriverConfigParam capability)
        {
            DriverConfigParam existingCap = mAppiumCapabilities.MultiValues.Where(x => x.Parameter == capability.Parameter).FirstOrDefault();

            if (existingCap != null)
            {
                existingCap.Value       = capability.Value;
                existingCap.Description = capability.Description;
            }
            else
            {
                mAppiumCapabilities.MultiValues.Add(capability);
            }
        }
예제 #10
0
        private void BindRadioButtons()
        {
            mDeviceAutoScreenshotRefreshMode = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.DeviceAutoScreenshotRefreshMode), eAutoScreenshotRefreshMode.Live.ToString());
            BindingHandler.ObjFieldBinding(xLiveRdBtn, RadioButton.IsCheckedProperty, mDeviceAutoScreenshotRefreshMode, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eAutoScreenshotRefreshMode.Live.ToString());
            BindingHandler.ObjFieldBinding(xPostOperationRdBtn, RadioButton.IsCheckedProperty, mDeviceAutoScreenshotRefreshMode, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eAutoScreenshotRefreshMode.PostOperation.ToString());
            BindingHandler.ObjFieldBinding(xDisabledRdBtn, RadioButton.IsCheckedProperty, mDeviceAutoScreenshotRefreshMode, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eAutoScreenshotRefreshMode.Disabled.ToString());

            mDevicePlatformType = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.DevicePlatformType));
            BindingHandler.ObjFieldBinding(xAndroidRdBtn, RadioButton.IsCheckedProperty, mDevicePlatformType, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eDevicePlatformType.Android.ToString());
            BindingHandler.ObjFieldBinding(xIOSRdBtn, RadioButton.IsCheckedProperty, mDevicePlatformType, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eDevicePlatformType.iOS.ToString());

            mAppType = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.AppType));
            BindingHandler.ObjFieldBinding(xNativeHybRdBtn, RadioButton.IsCheckedProperty, mAppType, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eAppType.NativeHybride.ToString());
            BindingHandler.ObjFieldBinding(xWebRdBtn, RadioButton.IsCheckedProperty, mAppType, nameof(DriverConfigParam.Value), bindingConvertor: new RadioBtnEnumConfigConverter(), converterParameter: eAppType.Web.ToString());
        }
예제 #11
0
        private void SelectDeviceButton_Click(object sender, RoutedEventArgs e)
        {
            AndroidDeviceSelectPage p = new AndroidDeviceSelectPage(mAgent);

            p.ShowAsWindow();

            //???
            //TODO: fix me , from some reason the bind above didn't work so after the window is closed we bind again.. temp solution
            DriverConfigParam ModelDCP = mAgent.GetOrCreateParam("Model", "");

            App.ObjFieldBinding(DeviceModelTextBox, TextBox.TextProperty, ModelDCP, "Value");

            DriverConfigParam SerialDCP = mAgent.GetOrCreateParam("Serial", "");

            App.ObjFieldBinding(DeviceSerialTextBox, TextBox.TextProperty, SerialDCP, "Value");
        }
예제 #12
0
        private void BindConfigurationsFields()
        {
            mAppiumServer = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.AppiumServer), @"http://127.0.0.1:4723/wd/hub");
            //BindingHandler.ObjFieldBinding(xServerURLTextBox, TextBox.TextProperty, mAppiumServer, nameof(DriverConfigParam.Value));
            xServerURLTextBox.Init(null, mAppiumServer, nameof(DriverConfigParam.Value));
            BindingHandler.ObjFieldBinding(xServerURLTextBox, TextBox.ToolTipProperty, mAppiumServer, nameof(DriverConfigParam.Description));

            BindingHandler.ObjFieldBinding(xLoadDeviceWindow, CheckBox.IsCheckedProperty, mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.LoadDeviceWindow), "true"), nameof(DriverConfigParam.Value), bindingConvertor: new CheckboxConfigConverter());

            DriverConfigParam proxy = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.Proxy));

            xProxyTextBox.Init(null, proxy, nameof(DriverConfigParam.Value));
            BindingHandler.ObjFieldBinding(xProxyTextBox, TextBox.ToolTipProperty, proxy, nameof(DriverConfigParam.Description));
            xUseProxyChkBox.IsChecked = !string.IsNullOrEmpty(proxy.Value);

            mApplitoolKey = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.ApplitoolsViewKey));
            xApplitoolKeyTxtBox.Init(null, mApplitoolKey, nameof(DriverConfigParam.Value));
            BindingHandler.ObjFieldBinding(xApplitoolKeyTxtBox, TextBox.ToolTipProperty, mApplitoolKey, nameof(DriverConfigParam.Description));

            mApplitoolURL = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.ApplitoolsServerUrl));
            xApplitoolURLTxtBox.Init(null, mApplitoolURL, nameof(DriverConfigParam.Value));
            BindingHandler.ObjFieldBinding(xApplitoolURLTxtBox, TextBox.ToolTipProperty, mApplitoolURL, nameof(DriverConfigParam.Description));


            xLoadTimeoutTxtbox.Init(null, mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.DriverLoadWaitingTime)), nameof(DriverConfigParam.Value));
            BindingHandler.ObjFieldBinding(xLoadTimeoutTxtbox, TextBox.ToolTipProperty, mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.DriverLoadWaitingTime)), nameof(DriverConfigParam.Description));

            BindingHandler.ObjFieldBinding(xAutoUpdateCapabiltiies, CheckBox.IsCheckedProperty, mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.AutoSetCapabilities), "true"), nameof(DriverConfigParam.Value), bindingConvertor: new CheckboxConfigConverter());

            BindRadioButtons();

            mAppiumCapabilities = mAgent.GetOrCreateParam(nameof(GenericAppiumDriver.AppiumCapabilities));
            if (mAppiumCapabilities.MultiValues == null || mAppiumCapabilities.MultiValues.Count == 0)
            {
                mAppiumCapabilities.MultiValues = new ObservableList <DriverConfigParam>();
                AutoSetCapabilities(true);
            }
            SetCapabilitiesGridView();
        }
예제 #13
0
        private void SetPlatformCapabilities()
        {
            DriverConfigParam platformName = new DriverConfigParam()
            {
                Parameter = "platformName", Description = "Which mobile OS platform to use"
            };
            DriverConfigParam automationName = new DriverConfigParam()
            {
                Parameter = "automationName", Description = "Which automation engine to use"
            };

            if (mDevicePlatformType.Value == eDevicePlatformType.Android.ToString())
            {
                platformName.Value   = "Android";
                automationName.Value = "UiAutomator2";
            }
            else
            {
                platformName.Value   = "iOS";
                automationName.Value = "XCUITest";
            }
            AddOrUpdateCapability(platformName);
            AddOrUpdateCapability(automationName);
        }
예제 #14
0
        public AgentConfigControl(DriverConfigParam Config)
        {
            InitializeComponent();
            Name.Content        = Config.Parameter;
            Description.Content = Config.Description;


            if (Config.OptionalValues == null || Config.OptionalValues.Count == 0)
            {
                Ginger.Actions.UCValueExpression txtBox = new Ginger.Actions.UCValueExpression()
                {
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Width = 600
                };

                txtBox.Visibility = Visibility.Visible;
                txtBox.Init(null, Config, "Value", isVENeeded: true);
                ControlPanel.Children.Add(txtBox);
            }
            else
            {
                ComboBox comboBox = new ComboBox()
                {
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Visibility          = Visibility.Visible,
                    Width  = 600,
                    Margin = new Thickness(10, 0, 0, 0)
                };
                //   comboBox.Init(Config, "Value");
                // ((Ginger.UserControlsLib.UCComboBox)comboBox).ComboBox.ItemsSource = Config.OptionalValues;
                ControlPanel.Children.Add(comboBox);
                ControlPanel.UpdateLayout();
            }
        }
 public DriverConfigurationParamEditWindow(DriverConfigParam DCP)
 {
     InitializeComponent();
     ParamValue.Init(null, DCP, DriverConfigParam.Fields.Value);
     ParamNameLabel.Content = DCP.Parameter;
 }
예제 #16
0
        private void SetApplicationCapabilities(bool init = false)
        {
            DriverConfigParam appPackage = new DriverConfigParam()
            {
                Parameter = "appPackage", Description = "Java package of the Android app you want to run", Value = "com.android.settings"
            };
            DriverConfigParam appActivity = new DriverConfigParam()
            {
                Parameter = "appActivity", Description = "Activity name for the Android activity you want to launch from your package", Value = "com.android.settings.Settings"
            };
            DriverConfigParam bundleId = new DriverConfigParam()
            {
                Parameter = "bundleId", Description = "Bundle ID of the app under test", Value = "com.apple.Preferences"
            };
            DriverConfigParam browserName = new DriverConfigParam()
            {
                Parameter = "browserName", Description = "Name of mobile web browser to automate"
            };
            DriverConfigParam defualtURL = new DriverConfigParam()
            {
                Parameter = "defaultURL", Description = "Ginger Capability | Default URL to load on browser connection", Value = "https://ginger.amdocs.com/"
            };

            if (mAppType.Value == eAppType.NativeHybride.ToString())
            {
                if (mDevicePlatformType.Value == eDevicePlatformType.Android.ToString())
                {
                    if (!init)
                    {
                        SetCurrentCapabilityValue(appPackage);
                        SetCurrentCapabilityValue(appActivity);
                    }
                    AddOrUpdateCapability(appPackage);
                    AddOrUpdateCapability(appActivity);
                    DeleteCapabilityIfExist(bundleId.Parameter);
                }
                else
                {
                    if (!init)
                    {
                        SetCurrentCapabilityValue(bundleId);
                    }
                    AddOrUpdateCapability(bundleId);
                    DeleteCapabilityIfExist(appPackage.Parameter);
                    DeleteCapabilityIfExist(appActivity.Parameter);
                }
                DeleteCapabilityIfExist(browserName.Parameter);
                DeleteCapabilityIfExist(defualtURL.Parameter);
            }
            else
            {
                if (mDevicePlatformType.Value == eDevicePlatformType.Android.ToString())
                {
                    browserName.Value = "Chrome";
                }
                else
                {
                    browserName.Value = "Safari";
                }
                AddOrUpdateCapability(browserName);
                AddOrUpdateCapability(defualtURL);
                DeleteCapabilityIfExist(bundleId.Parameter);
                DeleteCapabilityIfExist(appPackage.Parameter);
                DeleteCapabilityIfExist(appActivity.Parameter);
            }
        }