public void ConnectToLowis(bool CreateNewStore)
        {
            WpfWindow LOWISConnect = new WpfWindow();
            LOWISConnect.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            LOWISConnect.SearchProperties.Add(WpfWindow.PropertyNames.Name, "LOWIS: Connect");
            LOWISConnect.WindowTitles.Add("LOWIS: Connect");

            WpfComboBox HostCB = new WpfComboBox(LOWISConnect);
            HostCB.WindowTitles.Add("LOWIS: Connect");

            WpfEdit HostTB = new WpfEdit(HostCB);
            HostTB.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            HostTB.SearchProperties.Add(WpfEdit.PropertyNames.AutomationId, "PART_EditableTextBox");

            HostTB.Text = ConnectClientTo;
            Trace.WriteLine("Set ServerName to " + ConnectClientTo);
            WpfRadioButton Credentials = new WpfRadioButton(LOWISConnect);
            Credentials.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            Credentials.SearchProperties.Add(WpfRadioButton.PropertyNames.Name, "Use my windows credentials.");
            Credentials.WindowTitles.Add("LOWIS: Connect");

            Credentials.Selected = true;
            Trace.WriteLine("Use Windows Credentials checkbox is set to true");

            WpfButton ConnectButton = new WpfButton(LOWISConnect);
            ConnectButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            ConnectButton.SearchProperties[WpfButton.PropertyNames.AccessKey] = "\r";
            ConnectButton.WindowTitles.Add("LOWIS: Connect");

            WpfButton SettingsButton = new WpfButton(LOWISConnect);
            SettingsButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            SettingsButton.WindowTitles.Add("LOWIS: Connect");

            WpfWindow SettingsWin = new WpfWindow();
            SettingsWin.SearchProperties[WpfWindow.PropertyNames.Name] = "LOWIS: Settings";
            SettingsWin.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
            SettingsWin.WindowTitles.Add("LOWIS: Settings");

            WpfEdit CsStore = new WpfEdit(SettingsWin);
            CsStore.WindowTitles.Add("LOWIS: Settings");

            WpfButton SaveButton = new WpfButton(SettingsWin);
            SaveButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            SaveButton.SearchProperties[WpfButton.PropertyNames.AccessKey] = "\r";
            SaveButton.WindowTitles.Add("LOWIS: Settings");

            if (CreateNewStore == true)
            {
                Mouse.Click(SettingsButton);
                Trace.WriteLine("Clicked Settings button on client Logon");
                CsStore.Text = "C:\\csstore18";
                Trace.WriteLine("Set CsStore path");
                Mouse.Click(SaveButton);
                Trace.WriteLine("Clicked Save Button on settings window");
            }
            Mouse.Click(ConnectButton);
            Trace.WriteLine("Clicked LOWIS connect button");
        }
        /// <summary>
        /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method.
        /// </summary>
        public void RecordedMethod1()
        {
            #region Variable Declarations
            WpfRadioButton uIRoadBike20RadioButton        = this.UIMainWindowWindow.UIRoadBike20RadioButton;
            WpfComboBox    uIComboBoxColorComboBox        = this.UIMainWindowWindow.UIComboBoxColorComboBox;
            WpfCheckBox    uISmall1718100CheckBox         = this.UIMainWindowWindow.UISmall1718100CheckBox;
            WpfCheckBox    uISingleSpeed20CheckBox        = this.UIMainWindowWindow.UISingleSpeed20CheckBox;
            WpfCheckBox    uICarbonSaddle20CheckBox       = this.UIMainWindowWindow.UICarbonSaddle20CheckBox;
            WpfCheckBox    uIBullhorn20CheckBox           = this.UIMainWindowWindow.UIBullhorn20CheckBox;
            WpfCheckBox    uIRoadWheels30CheckBox         = this.UIMainWindowWindow.UIRoadWheels30CheckBox;
            WpfCheckBox    uIRimBrakes20CheckBox          = this.UIMainWindowWindow.UIRimBrakes20CheckBox;
            WpfCheckBox    uIUpgradeto3yearwarranCheckBox = this.UIMainWindowWindow.UIUpgradeto3yearwarranCheckBox;
            WpfButton      uISubmitPreferenceButton       = this.UIMainWindowWindow.UISubmitPreferenceButton;
            WinButton      uIYesButton   = this.UIConfirmationWindow.UIYesWindow.UIYesButton;
            WpfButton      uIClearButton = this.UIMainWindowWindow.UIClearButton;
            WpfRadioButton uIMountainBike50RadioButton = this.UIMainWindowWindow.UIMountainBike50RadioButton;
            WpfCheckBox    uILarge1920150CheckBox      = this.UIMainWindowWindow.UILarge1920150CheckBox;
            WpfCheckBox    uIItem24Speed150CheckBox    = this.UIMainWindowWindow.UIItem24Speed150CheckBox;
            WpfCheckBox    uIGelSaddle30CheckBox       = this.UIMainWindowWindow.UIGelSaddle30CheckBox;
            WpfCheckBox    uIFlat15CheckBox            = this.UIMainWindowWindow.UIFlat15CheckBox;
            WpfCheckBox    uIOffRoadWheels50CheckBox   = this.UIMainWindowWindow.UIOffRoadWheels50CheckBox;
            WinButton      uIOKButton             = this.UIOKWindow.UIOKButton;
            WpfCheckBox    uIDiscBrakes50CheckBox = this.UIMainWindowWindow.UIDiscBrakes50CheckBox;
            #endregion

            // The recording for the application under test '\\napier-mail.napier.ac.uk\students\School of Computing\User Data\40288545\My Profile\Desktop\Presentation\Presentation\Presentation\bin\Debug\Presentation.exe' may not be correct as it is located on a network share. Please install the application on a local path.

            // Select 'Road Bike £20' radio button
            uIRoadBike20RadioButton.Selected = this.RecordedMethod1Params.UIRoadBike20RadioButtonSelected;

            // Select 'Green £20' in 'ComboBoxColor' combo box
            uIComboBoxColorComboBox.SelectedItem = this.RecordedMethod1Params.UIComboBoxColorComboBoxSelectedItem;

            // Select 'Small(17"-18") £100' check box
            uISmall1718100CheckBox.Checked = this.RecordedMethod1Params.UISmall1718100CheckBoxChecked;

            // Select 'Single Speed £20' check box
            uISingleSpeed20CheckBox.Checked = this.RecordedMethod1Params.UISingleSpeed20CheckBoxChecked;

            // Select 'Carbon Saddle £20' check box
            uICarbonSaddle20CheckBox.Checked = this.RecordedMethod1Params.UICarbonSaddle20CheckBoxChecked;

            // Select 'Bullhorn £20' check box
            uIBullhorn20CheckBox.Checked = this.RecordedMethod1Params.UIBullhorn20CheckBoxChecked;

            // Select 'Road Wheels £30' check box
            uIRoadWheels30CheckBox.Checked = this.RecordedMethod1Params.UIRoadWheels30CheckBoxChecked;

            // Select 'Rim Brakes £20' check box
            uIRimBrakes20CheckBox.Checked = this.RecordedMethod1Params.UIRimBrakes20CheckBoxChecked;

            // Select 'Upgrade to 3 year warranty £50' check box
            uIUpgradeto3yearwarranCheckBox.Checked = this.RecordedMethod1Params.UIUpgradeto3yearwarranCheckBoxChecked;

            // Click 'Submit Preference' button
            Mouse.Click(uISubmitPreferenceButton, new Point(57, 35));

            // Click '&Yes' button
            Mouse.Click(uIYesButton, new Point(62, 14));

            // Click 'Clear' button
            Mouse.Click(uIClearButton, new Point(78, 24));

            // Select 'Mountain Bike £50' radio button
            uIMountainBike50RadioButton.Selected = this.RecordedMethod1Params.UIMountainBike50RadioButtonSelected;

            // Select 'Blue £20' in 'ComboBoxColor' combo box
            uIComboBoxColorComboBox.SelectedItem = this.RecordedMethod1Params.UIComboBoxColorComboBoxSelectedItem1;

            // Clear 'Small(17"-18") £100' check box
            uISmall1718100CheckBox.Checked = this.RecordedMethod1Params.UISmall1718100CheckBoxChecked1;

            // Select 'Large(19"-20") £150' check box
            uILarge1920150CheckBox.Checked = this.RecordedMethod1Params.UILarge1920150CheckBoxChecked;

            // Clear 'Single Speed £20' check box
            uISingleSpeed20CheckBox.Checked = this.RecordedMethod1Params.UISingleSpeed20CheckBoxChecked1;

            // Select '24-Speed £150' check box
            uIItem24Speed150CheckBox.Checked = this.RecordedMethod1Params.UIItem24Speed150CheckBoxChecked;

            // Clear 'Carbon Saddle £20' check box
            uICarbonSaddle20CheckBox.Checked = this.RecordedMethod1Params.UICarbonSaddle20CheckBoxChecked1;

            // Select 'Gel Saddle £30' check box
            uIGelSaddle30CheckBox.Checked = this.RecordedMethod1Params.UIGelSaddle30CheckBoxChecked;

            // Clear 'Bullhorn £20' check box
            uIBullhorn20CheckBox.Checked = this.RecordedMethod1Params.UIBullhorn20CheckBoxChecked1;

            // Select 'Flat £15' check box
            uIFlat15CheckBox.Checked = this.RecordedMethod1Params.UIFlat15CheckBoxChecked;

            // Clear 'Road Wheels £30' check box
            uIRoadWheels30CheckBox.Checked = this.RecordedMethod1Params.UIRoadWheels30CheckBoxChecked1;

            // Select 'Off-Road Wheels £50' check box
            uIOffRoadWheels50CheckBox.Checked = this.RecordedMethod1Params.UIOffRoadWheels50CheckBoxChecked;

            // Clear 'Rim Brakes £20' check box
            uIRimBrakes20CheckBox.Checked = this.RecordedMethod1Params.UIRimBrakes20CheckBoxChecked1;

            // Click 'Submit Preference' button
            Mouse.Click(uISubmitPreferenceButton, new Point(66, 50));

            // Click 'OK' button
            Mouse.Click(uIOKButton, new Point(65, 16));

            // Click 'OK' button
            Mouse.Click(uIOKButton, new Point(56, 15));

            // Click 'Clear' button
            Mouse.Click(uIClearButton, new Point(84, 15));

            // Select 'Disc Brakes £50' check box
            uIDiscBrakes50CheckBox.Checked = this.RecordedMethod1Params.UIDiscBrakes50CheckBoxChecked;

            // Click 'Submit Preference' button
            Mouse.Click(uISubmitPreferenceButton, new Point(35, 22));

            // Click '&Yes' button
            Mouse.Click(uIYesButton, new Point(49, 13));
        }
 public WpfRadioButtonControlPageModelWrapper(WpfRadioButton toWrap, TNextModel nextModel) : base(toWrap, nextModel)
 {
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TNextModel"></typeparam>
 /// <param name="radioButton"></param>
 /// <param name="nextModel"></param>
 /// <returns></returns>
 /// <remarks>
 /// WPF Radio button is an ISelectablePageModel because you can
 /// set the selection state to false explicitly
 /// </remarks>
 public static ISelectablePageModel <TNextModel> AsPageModel <TNextModel>(this WpfRadioButton radioButton, TNextModel nextModel) where TNextModel : IPageModel
 {
     return(new WpfRadioButtonControlPageModelWrapper <TNextModel>(radioButton, nextModel));
 }
        /// <summary>
        /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method.
        /// </summary>
        public void RecordedMethod1()
        {
            #region Variable Declarations
            WinWindow      uIUIAutomationTestWindWindow = this.UIUIAutomationTestWindWindow;
            WpfMenuItem    uIFileMenuItem  = this.UIUIAutomationTestWindWindow1.UIItemMenu.UIFileMenuItem;
            WpfMenuItem    uIToolsMenuItem = this.UIUIAutomationTestWindWindow1.UIItemMenu.UIToolsMenuItem;
            WpfMenuItem    uIItem1MenuItem = this.UIUIAutomationTestWindWindow1.UIItemMenu.UIItem1MenuItem;
            WpfMenuItem    uIItem2MenuItem = this.UIUIAutomationTestWindWindow1.UIItemMenu.UIItem2MenuItem;
            WpfMenuItem    uIItem3MenuItem = this.UIUIAutomationTestWindWindow1.UIItemMenu.UIItem3MenuItem;
            WpfMenuItem    uIItem4MenuItem = this.UIUIAutomationTestWindWindow1.UIItemMenu.UIItem4MenuItem;
            WpfListItem    uIItem1ListItem = this.UIUIAutomationTestWindWindow1.UIMainListViewList.UIItem1ListItem;
            WpfEdit        uITextBoxAEdit  = this.UIUIAutomationTestWindWindow1.UITextBoxAEdit;
            WpfEdit        uITextBoxBEdit  = this.UIUIAutomationTestWindWindow1.UITextBoxBEdit;
            WpfEdit        uITextBoxCEdit  = this.UIUIAutomationTestWindWindow1.UITextBoxCEdit;
            WpfRadioButton uIARadioButton  = this.UIUIAutomationTestWindWindow1.UIARadioButton;
            WpfRadioButton uIBRadioButton  = this.UIUIAutomationTestWindWindow1.UIBRadioButton;
            WpfRadioButton uICRadioButton  = this.UIUIAutomationTestWindWindow1.UICRadioButton;
            WpfButton      uIClickButton   = this.UIUIAutomationTestWindWindow1.UIClickButton;
            #endregion

            // Last mouse action was not recorded.

            // Type '{Tab}' in 'UI Automation Test Window' window
            Keyboard.SendKeys(uIUIAutomationTestWindWindow, this.RecordedMethod1Params.UIUIAutomationTestWindWindowSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'File' menu item
            Keyboard.SendKeys(uIFileMenuItem, this.RecordedMethod1Params.UIFileMenuItemSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'Tools' menu item
            Keyboard.SendKeys(uIToolsMenuItem, this.RecordedMethod1Params.UIToolsMenuItemSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'item1' menu item
            Keyboard.SendKeys(uIItem1MenuItem, this.RecordedMethod1Params.UIItem1MenuItemSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'item2' menu item
            Keyboard.SendKeys(uIItem2MenuItem, this.RecordedMethod1Params.UIItem2MenuItemSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'item3' menu item
            Keyboard.SendKeys(uIItem3MenuItem, this.RecordedMethod1Params.UIItem3MenuItemSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'item4' menu item
            Keyboard.SendKeys(uIItem4MenuItem, this.RecordedMethod1Params.UIItem4MenuItemSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'item1' list item
            Keyboard.SendKeys(uIItem1ListItem, this.RecordedMethod1Params.UIItem1ListItemSendKeys, ModifierKeys.None);

            // Type '12' in 'textBoxA' text box
            uITextBoxAEdit.Text = this.RecordedMethod1Params.UITextBoxAEditText;

            // Type '{Tab}' in 'textBoxA' text box
            Keyboard.SendKeys(uITextBoxAEdit, this.RecordedMethod1Params.UITextBoxAEditSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'textBoxB' text box
            Keyboard.SendKeys(uITextBoxBEdit, this.RecordedMethod1Params.UITextBoxBEditSendKeys, ModifierKeys.None);

            // Type 'Shift + {Tab}' in 'textBoxC' text box
            Keyboard.SendKeys(uITextBoxCEdit, this.RecordedMethod1Params.UITextBoxCEditSendKeys, ModifierKeys.Shift);

            // Type '122' in 'textBoxB' text box
            uITextBoxBEdit.Text = this.RecordedMethod1Params.UITextBoxBEditText;

            // Type '{Tab}' in 'textBoxB' text box
            Keyboard.SendKeys(uITextBoxBEdit, this.RecordedMethod1Params.UITextBoxBEditSendKeys1, ModifierKeys.None);

            // Type '{Tab}' in 'textBoxC' text box
            Keyboard.SendKeys(uITextBoxCEdit, this.RecordedMethod1Params.UITextBoxCEditSendKeys1, ModifierKeys.None);

            // Type '{Tab}' in 'A' radio button
            Keyboard.SendKeys(uIARadioButton, this.RecordedMethod1Params.UIARadioButtonSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'B' radio button
            Keyboard.SendKeys(uIBRadioButton, this.RecordedMethod1Params.UIBRadioButtonSendKeys, ModifierKeys.None);

            // Type '{Tab}' in 'C' radio button
            Keyboard.SendKeys(uICRadioButton, this.RecordedMethod1Params.UICRadioButtonSendKeys, ModifierKeys.None);

            // Type '{Space}' in 'Click' button
            Keyboard.SendKeys(uIClickButton, this.RecordedMethod1Params.UIClickButtonSendKeys, ModifierKeys.None);
        }