示例#1
0
        public static void ConnectHostWithControls(string userName = "", string hostPwd = "")
        {
            Logger.log.Info("******  Start ConnectHostWithControls() ********");

            if (userName == "")
            {
                userName = ConstantsUtil.defaultHostName;
            }
            if (hostPwd == "")
            {
                hostPwd = ConstantsUtil.defaultHostPwd;
            }
            Logger.log.Debug("    ===  Connect to Host with user name : " + userName + "  === ");

            WpfCustom settingBladeCustom = DesktopAppControls.GetSettingBladeCustom();

            Thread.Sleep(1000);
            Mouse.Click(settingBladeCustom, new Point(44, 114));  // win10
            // Mouse.Click(settingBladeCustom, new Point(62, 157));   // win7
            Thread.Sleep(8000);

            Mouse.Click(); // ??? need this
            Thread.Sleep(1000);

            Logger.log.Info("******  End ConnectHostWithControls() ********");
        }
示例#2
0
        public static void CancelConnectHost()
        {
            Logger.log.Info("******  Start CancelConnectHost() ********");

            string userName = ConstantsUtil.defaultHostName;

            WpfCustom settingBladeCustom = DesktopAppControls.GetSettingBladeCustom();

            Thread.Sleep(1000);
            Mouse.Click(settingBladeCustom, new Point(44, 114));
            Thread.Sleep(8000);


            Keyboard.SendKeys(userName);
            Thread.Sleep(1000);
            Keyboard.SendKeys("{TAB}"); // jump to pwd
            Keyboard.SendKeys("{TAB}"); // jump to "Login" or to "Cancel" if no input of credentials
            Keyboard.SendKeys("{ENTER}");
            Thread.Sleep(3000);

            // xxxx need to check bladeview is up again ??? is following working ???
            Assert.IsTrue(settingBladeCustom.GetProperty("Enabled").Equals(true));

            Logger.log.Info("******  End CancelConnectHost() ********");
        }
示例#3
0
        public List <WpfCustom> Get_C1DateTimePickers_In_Grid()
        {
            var dtp = new WpfCustom(Get_Grid());

            dtp.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.C1DateTimePicker";
            return(dtp.FindMatchingControls().Cast <WpfCustom>().ToList());
        }
 public static void ClearFileTransferControls()
 {
     _contentAppBarCustom = null;
     _contentFramePane    = null;
     _closeButton         = null;
     _fileTransferWindow  = null;
 }
示例#5
0
        public void CodedUITestMethod1()
        {
            var mainWindow = GetMainWindow();

            var btn = new WpfButton(mainWindow);

            btn.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "btn_AddShape"));
            btn.Find();
            btn.WaitForControlReady();
            Mouse.Click(btn);

            var diagram = new WpfCustom(mainWindow);

            diagram.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "diagram"));
            diagram.Find();
            diagram.WaitForControlReady();

            var element = new WpfCustom(diagram);

            element.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "CustomElement_1"));
            element.Find();
            element.WaitForControlReady();

            var itemsControl = new WpfList(element);

            itemsControl.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "itemsC"));

            //The CodedUI can't find the ItemsControl
            itemsControl.Find();
            itemsControl.WaitForControlReady();
            var items = itemsControl.Items.OfType <WpfListItem>().ToArray();

            string[] s = items.Select(x => x.AutomationId).ToArray();
            s.Should().BeEquivalentTo("ItemA", "ItemB", "ItemC", "ItemD", "ItemE", "ItemF", "ItemG", "ItemH");
        }
示例#6
0
        public void CodedUITestMethod1()
        {
            var mainWindow = GetMainWindow();

            var btn = new WpfButton(mainWindow);

            btn.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "btn_AddShape"));
            btn.Find();
            btn.WaitForControlReady();
            Mouse.Click(btn);

            var diagram = new WpfCustom(mainWindow);

            diagram.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "diagram"));
            diagram.Find();
            diagram.WaitForControlReady();

            var element = new WpfCustom(diagram);

            element.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "CustomElement_1"));
            element.Find();
            element.WaitForControlReady();

            var itemsControl = new WpfList(element);

            itemsControl.SearchProperties.Add(new PropertyExpression(WpfControl.PropertyNames.AutomationId, "itemsC"));

            //The CodedUI can't find the ItemsControl
            itemsControl.Find();
            itemsControl.WaitForControlReady();
            string[] s = itemsControl.Items.GetValuesOfControls();
        }
示例#7
0
        public void Double_Click_Connector3()
        {
            WpfCustom uIItem970f65ad1c3d4028Custom = WorkflowTabUIMap.MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart.Connector3;

            // Click '970f65ad-1c3d-4028-b657-f687a5265c56,317,5;214,5 3...' custom control
            Mouse.Click(uIItem970f65ad1c3d4028Custom, new Point(339, 274));
            Mouse.DoubleClick(uIItem970f65ad1c3d4028Custom, new Point(339, 274));
        }
示例#8
0
        /// <summary>
        /// TestAssert - Use 'TestAssertExpectedValues' to pass parameters into this method.
        /// </summary>
        /// <summary>
        /// xd
        /// </summary>
        public void xd()
        {
            #region Variable Declarations
            WpfCustom uIItemCustom = this.UIBusinessDesignStudioWindow.UIItemCustom.UIMyScrollViewerPane.UIItemCustom;
            #endregion

            // Click custom control
            Mouse.Click(uIItemCustom, new Point(478, 388));
        }
        /// <summary>
        /// Open_Tools_UI_Map_Designer_To_Flowchart - Use 'Open_Tools_UI_Map_Designer_To_FlowchartParams' to pass parameters into this method.
        /// </summary>
        public void Open_Tools_UI_Map_Designer_To_Flowchart()
        {
            #region Variable Declarations
            WpfCustom flowchart = this.MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart;
            #endregion

            // Verify that the 'Exists' property of 'Flowchart' custom control equals 'True'
            Assert.AreEqual(this.Open_Tools_UI_Map_Designer_To_FlowchartParams.FlowchartExists, flowchart.Exists, "Flowchart does not exist.");
        }
示例#10
0
        /// <summary>
        /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method.
        /// </summary>
        public void AssertMethod1()
        {
            #region Variable Declarations
            WpfCustom contentDockManager = this.MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.SearchTab.WorkSurfaceContent.ContentDockManager;
            #endregion

            // Verify that the 'ControlType' property of 'ContentDockManager' custom control equals 'Custom'
            Assert.AreEqual(this.AssertMethod1ExpectedValues.ContentDockManagerControlType, contentDockManager.ControlType.ToString());
        }
 public static WpfCustom GetItemCustom()
 {
     if (_itemCustom == null)
     {
         _itemCustom = new WpfCustom(GetWpfWindow());
         _itemCustom.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.ComputerLoginControl";
     }
     return(_itemCustom);
 }
 public static WpfCustom GetAppBarCustom()
 {
     if (_contentAppBarCustom == null)
     {
         _contentAppBarCustom = new WpfCustom(GetContentFramePane());
         _contentAppBarCustom.SearchProperties[WpfControl.PropertyNames.ClassName]    = "Uia.AppBar";
         _contentAppBarCustom.SearchProperties[WpfControl.PropertyNames.AutomationId] = "AppBar";
     }
     return(_contentAppBarCustom);
 }
示例#13
0
        public static void DisconnectHost()
        {
            Logger.log.Info("******  Start DisconnectHost() ********");

            WpfCustom bladeViewControlCustom = DesktopAppControls.GetBladeViewControlCustom();

            Mouse.Click(bladeViewControlCustom, new Point(1869, 18));

            Logger.log.Info("******  End DisconnectHost() ********");
        }
示例#14
0
 public static WpfCustom GetBladeViewControlCustom()
 {
     if (_bladeViewControlCustom == null)
     {
         _bladeViewControlCustom = new WpfCustom(GetShareConnectWindow());
         _bladeViewControlCustom.SearchProperties[WpfControl.PropertyNames.ClassName]    = "Uia.MultiSessionBladeView";
         _bladeViewControlCustom.SearchProperties[WpfControl.PropertyNames.AutomationId] = "BladeViewControl";
     }
     return(_bladeViewControlCustom);
 }
示例#15
0
 public static WpfCustom GetSettingBladeCustom()
 {
     if (_settingBladeCustom == null)
     {
         _settingBladeCustom = new WpfCustom(GetShareConnectWindow());
         _settingBladeCustom.SearchProperties[WpfControl.PropertyNames.ClassName]    = "Uia.SettingsBlade";
         _settingBladeCustom.SearchProperties[WpfControl.PropertyNames.AutomationId] = "SettingBlade";
     }
     return(_settingBladeCustom);
 }
示例#16
0
 public static WpfCustom GetAboutBladeCustom()
 {
     if (_aboutBladeCustom == null)
     {
         _aboutBladeCustom = new WpfCustom(GetSettingBladeCustom());
         _aboutBladeCustom.SearchProperties[WpfControl.PropertyNames.ClassName]    = "Uia.AboutBlade";
         _aboutBladeCustom.SearchProperties[WpfControl.PropertyNames.AutomationId] = "AboutBlade";
     }
     return(_aboutBladeCustom);
 }
示例#17
0
        /// <summary>
        /// OpenCatalog
        /// </summary>
        public void OpenCatalog()
        {
            #region Variable Declarations
            WpfButton uIShowmainmenuButton = this.UIWpfWindow.UIShowmainmenuButton;
            WpfCustom uIItemCustom         = this.UIWpfWindow.UIMenuRegionList.UIVirtoCommerceManagemListItem.UIBtnButton.UIItemCustom;
            #endregion

            // Click 'Show main menu' button
            Mouse.Click(uIShowmainmenuButton, new Point(13, 14));

            // Click custom control
            Mouse.Click(uIItemCustom, new Point(55, 31));
        }
示例#18
0
        public void Filter()
        {
            var msg  = "Default:" + Get_Grid().RowCount;
            var body = new WpfPane(Get_Grid());

            body.SearchProperties[WpfPane.PropertyNames.AutomationId] = "Body";
            var cell = new WpfCustom(body);

            cell.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.DataGridCellPresenter";
            var filterbox = new WpfEdit(cell);

            filterbox.Text = "Closed";
            msg           += ".AfterFilter:" + Get_Grid().RowCount;
            Assert.AreEqual("Default:12.AfterFilter:7", msg);
        }
示例#19
0
        /// <summary>
        /// RecordedMethod1
        /// </summary>
        public void RecordedMethod1()
        {
            #region Variable Declarations
            WpfButton uIClickHereButton       = this.UIWpfWindow.UIClickHereButton;
            WpfCustom uICustomElement_1Custom = this.UIWpfWindow.UIDiagramCustom.UICustomElement_1Custom;
            #endregion

            // Click 'Click Here!' button
            Mouse.Click(uIClickHereButton, new Point(39, 17));

            // Click 'CustomElement_1' custom control
            Mouse.Click(uICustomElement_1Custom, new Point(165, 135));

            // Click 'CustomElement_1' custom control
            Mouse.Click(uICustomElement_1Custom, new Point(225, 17));
        }
        public bool FlagExists(int index)
        {
            var mailsTable = MailsTableUIMap.UIMarktelerikdomaincomWindow.UIItemCustom.UILoadingProgressBar.UIGridViewTable;

            var virtualizingPanel = mailsTable.GetChildren().Single(item => (item as WpfControl).AutomationId == "PART_GridViewVirtualizingPanel");

            WpfRow row = new WpfRow(virtualizingPanel);
            row.SearchProperties[WpfControl.PropertyNames.AutomationId] = "Row_" + index;
            row.Find();

            WpfCell cell = new WpfCell(row);
            cell.SearchProperties[WpfControl.PropertyNames.AutomationId] = "Cell_" + index + "_3";
            cell.Find();

            WpfCustom cellElement = new WpfCustom(cell);
            cellElement.SearchProperties[WpfControl.PropertyNames.AutomationId] = "CellElement_" + index + "_3";
            return cellElement.TryFind();
        }
示例#21
0
        public static void ConnectHostLoginView()
        {
            Logger.log.Info("******  Start ConnectHostLoginView() ********");

            WpfCustom settingBladeCustom = DesktopAppControls.GetSettingBladeCustom();

            Thread.Sleep(1000);
            Mouse.Click(settingBladeCustom, new Point(44, 114));  // win10
            // Mouse.Click(settingBladeCustom, new Point(62, 157));   // win7
            Thread.Sleep(8000);

            // hamburger
            WpfImage hamburgerImageImage = LoginViewControls.GetHamburgerImageImage();

            Mouse.Click(hamburgerImageImage);
            Thread.Sleep(2000);

            // user name
            WpfComboBox userListComboBox = LoginViewControls.GetUserListComboBox();

            Mouse.Click(userListComboBox);
            Thread.Sleep(2000);

            // pwd
            WpfEdit passwordFieldEdit = LoginViewControls.GetPasswordFieldEdit();

            Mouse.Click(passwordFieldEdit);
            Thread.Sleep(2000);

            // login button
            WpfButton logInButton = LoginViewControls.GetLogInButton();

            Mouse.Click(logInButton);
            Thread.Sleep(2000);

            // cancel button
            WpfButton cancelButton = LoginViewControls.GetCancelButton();

            Mouse.Click(cancelButton);
            Thread.Sleep(2000);


            Logger.log.Info("******  End ConnectHostLoginView() ********");
        }
示例#22
0
        /// <summary>
        /// RecordedMethod1 - Use 'RecordedMethod1Params' to pass parameters into this method.
        /// </summary>
        public void RecordedMethod1()
        {
            #region Variable Declarations
            WinTitleBar uICInteractiveWindowTitleBar = this.UICInteractiveWindowWindow1.UICInteractiveWindowTitleBar;
            WpfCustom   uIItemCustom = this.UICInteractiveWindowWindow.UIItemPane.UICText.UIItemCustom;
            WinWindow   uICInteractiveWindowWindow1 = this.UICInteractiveWindowWindow1;
            #endregion

            WaitForReadyState();

            // Type '{#}dbg{Space}k{Enter}' in 'C# Interactive Window' window
            //Keyboard.SendKeys(uICInteractiveWindowWindow1, this.RecordedMethod1Params.UICInteractiveWindowWindow1SendKeys, ModifierKeys.None);

            //WaitForExecutionState();
            //WaitForReadyState();

            // Type 'var{Space}a{Space}={Space}new{Space}{[}{]}{Space}{RShiftKey}{{}' in 'C# Interactive Window' window
            Keyboard.SendKeys(uICInteractiveWindowWindow1, this.RecordedMethod1Params.UICInteractiveWindowWindow1SendKeys1, ModifierKeys.None);

            // Type 'Shift + {Space}' in 'C# Interactive Window' window
            Keyboard.SendKeys(uICInteractiveWindowWindow1, this.RecordedMethod1Params.UICInteractiveWindowWindow1SendKeys2, ModifierKeys.Shift);

            // Type '1,{Space}2,{Space}3,{Space}4,{Space}5,{Space}6,{Space}7,{Space}{RShiftKey}{}};{Enter}' in 'C# Interactive Window' window
            Keyboard.SendKeys(uICInteractiveWindowWindow1, this.RecordedMethod1Params.UICInteractiveWindowWindow1SendKeys3, ModifierKeys.None);

            WaitForExecutionState();
            WaitForReadyState();

            // Type 'writeln{RShiftKey}{(}a.{RShiftKey}Len{Enter}{RShiftKey}{)};{Enter}' in 'C# Interactive Window' window
            Keyboard.SendKeys(uICInteractiveWindowWindow1, this.RecordedMethod1Params.UICInteractiveWindowWindow1SendKeys4, ModifierKeys.None);

            WaitForExecutionState();
            WaitForReadyState();

            // Type 'writeln{RShiftKey}{(}a.{RShiftKey}Len{Enter}{RShiftKey}{)};{Enter}' in 'C# Interactive Window' window
            Keyboard.SendKeys(uICInteractiveWindowWindow1, "a{Enter}{Enter}", ModifierKeys.None);

            WaitForExecutionState();
            WaitForReadyState();

            // Type 'q{Enter}{Enter}' in 'C# Interactive Window' window
            Keyboard.SendKeys(uICInteractiveWindowWindow1, this.RecordedMethod1Params.UICInteractiveWindowWindow1SendKeys5, ModifierKeys.None);
        }
示例#23
0
        /// <summary>
        /// ClickOnItemsControlInShape
        /// </summary>
        public void ClickOnItemsControlInShape()
        {
            #region Variable Declarations
            WpfButton uIClickHereButton       = this.UIWpfWindow.UIClickHereButton;
            WpfCustom uICustomElement_4Custom = this.UIWpfWindow.UIDiagramCustom.UICustomElement_4Custom;
            #endregion

            // Click 'Click Here!' button
            Mouse.Click(uIClickHereButton, new Point(69, 21));

            // Move 'CustomElement_4' custom control
            Mouse.StartDragging(uICustomElement_4Custom, new Point(179, 134));
            Mouse.StopDragging(uICustomElement_4Custom, 832, 285);

            //The CodedUI Test Builder can't find the ItemsControl

            // Click 'CustomElement_4' custom control
            Mouse.Click(uICustomElement_4Custom, new Point(193, 117));

            // Click 'CustomElement_4' custom control
            Mouse.Click(uICustomElement_4Custom, new Point(190, 62));
        }
示例#24
0
        public static void LogoutDA()
        {
            Logger.log.Info("******  Start LogoutDA() ********");

            WpfImage settings_buttonImage = DesktopAppControls.GetSettings_buttonImage();

            Mouse.Click(settings_buttonImage, new Point(6, 6));
            Thread.Sleep(3000);

            WpfCustom aboutBladeCustom = DesktopAppControls.GetAboutBladeCustom();

            Mouse.Click(aboutBladeCustom, new Point(45, 330));
            Thread.Sleep(3000);

            // Click 'Yes' button
            WpfButton yesButton = DesktopAppControls.GetConfirmSignOutYesButton();

            Mouse.Click(yesButton, new Point(35, 21));
            Thread.Sleep(8000);

            Logger.log.Info("******  End LogoutDA() ********");
        }
示例#25
0
 public List<WpfCustom> Get_C1DateTimePickers_In_Grid()
 {
     var dtp = new WpfCustom(Get_Grid());
     dtp.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.C1DateTimePicker";
     return dtp.FindMatchingControls().Cast<WpfCustom>().ToList();
 }
示例#26
0
 public void Filter()
 {
     var msg = "Default:" + Get_Grid().RowCount;
     var body = new WpfPane(Get_Grid());
     body.SearchProperties[WpfPane.PropertyNames.AutomationId] = "Body";
     var cell = new WpfCustom(body);
     cell.SearchProperties[WpfCustom.PropertyNames.ClassName] = "Uia.DataGridCellPresenter";
     var filterbox = new WpfEdit(cell);
     filterbox.Text = "Closed";
     msg += ".AfterFilter:" + Get_Grid().RowCount;
     Assert.AreEqual("Default:12.AfterFilter:7", msg);
 }
示例#27
0
        public static void SetUIAItemControlValue(string name, string type, string value, WinWindow parent)
        {
            WinWindow itemWindow = new WinWindow(parent);
            itemWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
            itemWindow.WaitForControlReady();
            WpfPane pane = new WpfPane(itemWindow);
            WpfCustom customControl = new WpfCustom(pane);
            customControl.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.SegmentedEntry";
            customControl.WaitForControlReady();
            WpfControl uIControl = new WpfControl(customControl);
            uIControl.TechnologyName = "UIA";
            uIControl.SearchProperties.Add("ControlType", type);
            uIControl.SearchProperties.Add("AutomationId", name);
            uIControl.WaitForControlReady();

            if (type == "CheckBox")
            {
                WpfCheckBox mUICheckBox = new WpfCheckBox(uIControl);
                mUICheckBox.Checked = Convert.ToBoolean(value);
            }
            else if (type == "Edit")
            {
                WpfEdit mUIEdit = new WpfEdit(uIControl);
                mUIEdit.Text = value;
            }
        }
示例#28
0
        public static void FileTransfer_Upload_Files()
        {
            ConnectToHost();

            GeneralUtilities.FileTransferUtil.OpenFileTransfer();

            WpfCustom appBarCustom = GeneralUtilities.FileTransferControls.GetAppBarCustom();

            Mouse.Click(appBarCustom, new Point(481, 28));
            Thread.Sleep(1000);

            // root folder that cannot have files uploaded
            WpfButton okButton = new WpfButton(GeneralUtilities.FileTransferControls.GetFileTransferWindow());

            okButton.SearchProperties[WpfButton.PropertyNames.AutomationId] = "OkButton";
            Thread.Sleep(1000);
            Mouse.Click(okButton, new Point(30, 19));

            // move to other folders, 1st level folder
            WpfCustom folderListCustom1 = new WpfCustom(GeneralUtilities.FileTransferControls.GetFileTransferWindow());

            folderListCustom1.SearchProperties[WpfControl.PropertyNames.ClassName]    = "Uia.FolderListControl";
            folderListCustom1.SearchProperties[WpfControl.PropertyNames.AutomationId] = "FolderList";

            WpfTable fullListTable = new WpfTable(folderListCustom1);

            fullListTable.SearchProperties[WpfTable.PropertyNames.AutomationId] = "FullList";

            WpfControl itemDataItem1 = new WpfControl(fullListTable);

            itemDataItem1.SearchProperties[WpfControl.PropertyNames.ControlType] = "DataItem";
            itemDataItem1.SearchProperties[WpfControl.PropertyNames.Instance]    = "3";

            WpfCell itemCell = new WpfCell(itemDataItem1);

            itemCell.SearchProperties[WpfCell.PropertyNames.ColumnHeader] = "FILE NAME";

            Mouse.DoubleClick(itemCell, new Point(37, 18));
            Thread.Sleep(2000);

            // 2nd level folder, **** need to clean the old controls (the way CodedUI/SC do) and start new ones as following
            GeneralUtilities.FileTransferControls.ClearFileTransferControls();

            WpfCustom folderListCustom2 = new WpfCustom(GeneralUtilities.FileTransferControls.GetFileTransferWindow());

            folderListCustom2.SearchProperties[WpfControl.PropertyNames.ClassName]    = "Uia.FolderListControl";
            folderListCustom2.SearchProperties[WpfControl.PropertyNames.AutomationId] = "FolderList";

            WpfTable fullListTable2 = new WpfTable(folderListCustom2);

            fullListTable2.SearchProperties[WpfTable.PropertyNames.AutomationId] = "FullList";

            WpfControl itemDataItem2 = new WpfControl(fullListTable2);

            itemDataItem2.SearchProperties[WpfControl.PropertyNames.ControlType] = "DataItem";

            WpfCell itemCell2 = new WpfCell(itemDataItem2);

            itemCell2.SearchProperties[WpfCell.PropertyNames.ColumnHeader] = "FILE NAME";

            Mouse.DoubleClick(itemCell2, new Point(59, 15));
            Thread.Sleep(2000);

            // click Upload button
            appBarCustom = GeneralUtilities.FileTransferControls.GetAppBarCustom();
            Mouse.Click(appBarCustom, new Point(481, 28));
            Thread.Sleep(1000);

            // make sure "Select File" window is up
            WinWindow selectFilesWindow = GeneralUtilities.FileTransferControls.GetSelectFileWindow();

            Thread.Sleep(1000);
            Assert.IsTrue(selectFilesWindow.Exists, "Select File Window does not show up!");

            // Select a file
            WinEdit nameEdit = GeneralUtilities.FileTransferControls.GetSelectFileNameEdit();

            Mouse.Click(nameEdit, new Point(123, 15));

            // Open/load the file
            WinButton openButton = GeneralUtilities.FileTransferControls.GetSelectFileOpenButton();

            Mouse.Click(openButton, new Point(24, 9));
            Thread.Sleep(3000);

            // xxxx make sure the file is there, may use FT window move arounf directories then come back to verify it

            WpfButton homeButton = new WpfButton(GeneralUtilities.FileTransferControls.GetFileTransferWindow());

            homeButton.SearchProperties[WpfButton.PropertyNames.Name] = "Home";
            Mouse.Click(homeButton, new Point(14, 9));
            Thread.Sleep(2000);

            GeneralUtilities.FileTransferUtil.CloseFileTransfer();
            Thread.Sleep(1000);

            // Clean up the files under the upload directory
            // launch command window on host and run batch
            Keyboard.SendKeys("R", System.Windows.Input.ModifierKeys.Windows);
            Thread.Sleep(1000);
            Keyboard.SendKeys("cmd");
            Thread.Sleep(1000);
            Keyboard.SendKeys("{ENTER}");
            Thread.Sleep(1000);
            Keyboard.SendKeys("cd C:\\ShareConnect");
            Keyboard.SendKeys("{ENTER}");
            Thread.Sleep(1000);
            Keyboard.SendKeys("DeleteFiles.bat");
            Keyboard.SendKeys("{ENTER}");
            Thread.Sleep(1000);
            Keyboard.SendKeys("exit");
            Keyboard.SendKeys("{ENTER}");

            DisconnectFromHost();
        }
示例#29
0
        /// <summary>
        /// RecordedMethod2
        /// </summary>
        public void RecordedMethod2()
        {
            #region Variable Declarations
            WpfImage    uIItemImage             = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom.UIItemImage;
            WpfTabPage  uIКвестыTabPage         = this.UIMyLifeRPGOrganizerXWindow.UITabControlTabList.UIКвестыTabPage;
            WpfTabPage  uIНавыкиTabPage         = this.UIMyLifeRPGOrganizerXWindow.UITabControlTabList.UIНавыкиTabPage;
            WpfTabPage  uIХарактеристикиTabPage = this.UIMyLifeRPGOrganizerXWindow.UITabControlTabList.UIХарактеристикиTabPage;
            WpfTabPage  uIИнформацияTabPage     = this.UIMyLifeRPGOrganizerXWindow.UITabControlTabList.UIИнформацияTabPage;
            WpfButton   uIOKButton                   = this.UIMyLifeRPGOrganizerXWindow.UIOKButton;
            WpfButton   uIButtonFocusButton          = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom1.UIButtonFocusButton;
            WpfButton   uIОКButton                   = this.UIMyLifeRPGOrganizerXWindow.UIОКButton;
            WpfButton   uIButtonFocusButton1         = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom1.UIButtonFocusButton1;
            WpfListItem uISampleModelTaskListItem    = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom2.UIItemList.UISampleModelTaskListItem;
            WpfButton   uIРедактироватьзадачуButton  = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom2.UIРедактироватьзадачуButton;
            WpfButton   uIOKButton1                  = this.UIMyLifeRPGOrganizerXWindow.UIUcTasksSettingsViewCustom.UIOKButton;
            WpfButton   uIОКButton1                  = this.UIMyLifeRPGOrganizerXWindow.UIОКButton1;
            WpfCustom   uIUserControlCustom3         = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom3;
            WpfImage    uIItemImage1                 = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom11.UIItemImage;
            WpfButton   uIButtonFocusButton2         = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom21.UIButtonFocusButton;
            WpfButton   uIButtonFocusButton11        = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom22.UIButtonFocusButton1;
            WpfListItem uISampleModelTaskListItem1   = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom31.UIItemList.UISampleModelTaskListItem;
            WpfButton   uIРедактироватьзадачуButton1 = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom32.UIРедактироватьзадачуButton;
            WpfMenuItem uIВыходMenuItem              = this.UIMyLifeRPGOrganizerXWindow.UIUserControlCustom4.UIItemMenu.UIВыходMenuItem;
            #endregion

            // Щелкните рисунок
            Mouse.Click(uIItemImage, new Point(172, 121));

            // Щелкните "Квесты" вкладка
            Mouse.Click(uIКвестыTabPage, new Point(180, 11));

            // Щелкните "Навыки" вкладка
            Mouse.Click(uIНавыкиTabPage, new Point(141, 5));

            // Щелкните "Характеристики" вкладка
            Mouse.Click(uIХарактеристикиTabPage, new Point(139, 29));

            // Щелкните "Информация" вкладка
            Mouse.Click(uIИнформацияTabPage, new Point(151, 24));

            // Щелкните "OK" кнопка
            Mouse.Click(uIOKButton, new Point(733, 11));

            // Щелкните "ButtonFocus" кнопка
            Mouse.Click(uIButtonFocusButton, new Point(558, 164));

            // Щелкните "Ок" кнопка
            Mouse.Click(uIОКButton, new Point(889, 26));

            // Щелкните "ButtonFocus" кнопка
            Mouse.Click(uIButtonFocusButton1, new Point(104, 200));

            // Щелкните "Sample.Model.Task" элемент списка
            Mouse.Click(uISampleModelTaskListItem, new Point(193, 200));

            // Щелкните "Редактировать задачу" кнопка
            Mouse.Click(uIРедактироватьзадачуButton, new Point(53, 28));

            // Щелкните "OK" кнопка
            Mouse.Click(uIOKButton1, new Point(606, 15));

            // Щелкните "Ок" кнопка
            Mouse.Click(uIОКButton1, new Point(876, 17));

            // Щелкните "UserControl" пользовательский элемент управления
            Mouse.Click(uIUserControlCustom3, new Point(632, 544));

            // Щелкните рисунок
            Mouse.Click(uIItemImage1, new Point(152, 86));

            // Щелкните "OK" кнопка
            Mouse.Click(uIOKButton, new Point(823, 16));

            // Щелкните "ButtonFocus" кнопка
            Mouse.Click(uIButtonFocusButton2, new Point(532, 153));

            // Щелкните "Ок" кнопка
            Mouse.Click(uIОКButton, new Point(874, 27));

            // Щелкните "ButtonFocus" кнопка
            Mouse.Click(uIButtonFocusButton11, new Point(184, 228));

            // Щелкните "Sample.Model.Task" элемент списка
            Mouse.Click(uISampleModelTaskListItem1, new Point(226, 225));

            // Щелкните "Редактировать задачу" кнопка
            Mouse.Click(uIРедактироватьзадачуButton1, new Point(43, 12));

            // Щелкните "OK" кнопка
            Mouse.Click(uIOKButton1, new Point(635, 23));

            // Щелкните "Ок" кнопка
            Mouse.Click(uIОКButton1, new Point(892, 3));

            // Щелкните "Выход" элемент меню
            Mouse.Click(uIВыходMenuItem, new Point(14, 9));
        }
示例#30
0
        public void AutomateVS()
        {
            //ApplicationUnderTest app = ApplicationUnderTest.Launch(@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe");
            WinWindow mainwindow = new WinWindow();

            mainwindow.SearchProperties.Add(WinWindow.PropertyNames.Name, "Start Page - Microsoft Visual Studio");
            WinMenuBar mainmenubar = new WinMenuBar(mainwindow);

            //mainmenubar.SearchProperties.Add(WinMenuBar.PropertyNames.Name, "MenuBar");
            //WinMenuItem filemenuitem = new WinMenuItem(mainmenubar);
            //filemenuitem.SearchProperties.Add(WinMenuItem.PropertyNames.Name, "File");
            //Mouse.Click(filemenuitem);
            //Thread.Sleep(1000);

            //WpfMenuItem newMenuItem = new WpfMenuItem(filemenuitem);
            //newMenuItem.SearchProperties.Add(WpfMenuItem.PropertyNames.Name, "New");
            //newMenuItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            ////Mouse.Hover(newMenuItem);

            //WpfMenuItem newProject = new WpfMenuItem(newMenuItem);
            //newProject.SearchProperties.Add(WpfMenuItem.PropertyNames.Name, "Project...");
            //newProject.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //Mouse.Click(newProject);

            //WpfWindow newprojectwindow = new WpfWindow(mainwindow);
            //newprojectwindow.SearchProperties.Add(WinWindow.PropertyNames.Name, "New Project");
            //newprojectwindow.DrawHighlight();
            //WpfControl installedDatagrid = new WpfControl(newprojectwindow);

            //installedDatagrid.SearchProperties[WpfControl.PropertyNames.ControlType] = "DataItem";
            //installedDatagrid.SearchProperties[WpfControl.PropertyNames.AutomationId] = "Installed";
            //WpfExpander expand = new WpfExpander(installedDatagrid);
            //WpfTree installedTreeView = new WpfTree(expand);
            //installedTreeView.SearchProperties.Add(WpfTree.PropertyNames.AutomationId, "Installed");

            ////installedTreeView.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //installedTreeView.DrawHighlight();
            //WpfTreeItem tempTreeItem = new WpfTreeItem(installedTreeView);
            //tempTreeItem.SearchProperties.Add(WpfTreeItem.PropertyNames.AutomationId, "Templates");
            ////tempTreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //tempTreeItem.DrawHighlight();

            //WpfTreeItem visualCtreeItem = new WpfTreeItem(tempTreeItem);
            //visualCtreeItem.SearchProperties.Add(WpfTreeItem.PropertyNames.AutomationId, "Visual C#");
            ////visualCtreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //visualCtreeItem.DrawHighlight();
            //expand.Expanded = true;
            //WpfTreeItem testTreeItem = new WpfTreeItem(visualCtreeItem);

            //testTreeItem.SearchProperties.Add(WpfTreeItem.PropertyNames.AutomationId, "Test");
            ////testTreeItem.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
            //testTreeItem.DrawHighlight();

            //Mouse.Click(testTreeItem);

            //WpfButton okbutton = new WpfButton(newprojectwindow);
            //okbutton.SearchProperties.Add(WpfButton.PropertyNames.Name, "OK");
            //Mouse.Click(okbutton);

            WpfWindow MainWindow1 = new WpfWindow();

            MainWindow1.SearchProperties.Add(WinWindow.PropertyNames.Name, "CodedUITestProject6 - Microsoft Visual Studio");

            MainWindow1.DrawHighlight();


            WinWindow Generatetest = new WinWindow();

            Generatetest.SearchProperties.Add(WinWindow.PropertyNames.Name, "Generate Code for Coded UI Test");
            // Generatetest.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "Generate Code for Coded UI Test");
            //"WindowsForms10.Window", PropertyExpressionOperator.Contains


            // WpfButton OkButton = new WpfButton(Generatetest);
            // OkButton.SearchProperties.Add(WpfButton.PropertyNames.AutomationId, "CancelButton");


            //// this.UIMap.RecordedMethod2();
            // Mouse.Click(OkButton);


            WpfButton TestExplorerTab = new WpfButton(MainWindow1);

            //  TestExplorerTab.SearchProperties.Add(WpfButton.PropertyNames.AutomationId, "Text");
            TestExplorerTab.SearchProperties.Add(WpfButton.PropertyNames.Name, "Test Explorer");
            // TestExplorerTab.DrawHighlight();
            // Mouse.Click(TestExplorerTab);

            WpfPane TextExplorerpane = new WpfPane(MainWindow1);

            TextExplorerpane.SearchProperties.Add(WpfControl.PropertyNames.AutomationId, "PART_HwndHost");
            //TextExplorerpane.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.SearchControl";
            // TextExplorerpane.SearchProperties.Add(WpfControl.PropertyNames.Name, "Test Explorer");
            //var controls=TextExplorerpane.FindMatchingControls();

            //TextExplorerpane.DrawHighlight();
            WpfCustom customsearch = new WpfCustom(TextExplorerpane);

            customsearch.SearchProperties.Add(WpfCustom.PropertyNames.AutomationId, "SearchControl");

            WpfText TestExplorerSearchText = new WpfText(customsearch);
            //TestExplorerSearchText.SearchProperties.Add(WpfText.PropertyNames.AutomationId, "PART_SearchBox");
            var controls = TestExplorerSearchText.FindMatchingControls();

            TestExplorerSearchText.DrawHighlight();
            Mouse.Click(TestExplorerSearchText);
        }
示例#31
0
        private static void VerifyUserInfo(string userName = "", string userEmail = "")
        {
            Logger.log.Info("******  Start VerifyUserInfo() ********");

            if (userName == "")
            {
                userName = GeneralUtilities.ConstantsUtil.defaultUserName;
            }
            if (userEmail == "")
            {
                userEmail = GeneralUtilities.ConstantsUtil.defaultUserEmail;
            }
            Logger.log.Debug("    ===  Log in Desktop App with user name : " + userName + " & user email : " + userEmail);

            WpfCustom bladeViewControlCustom = GeneralUtilities.DesktopAppControls.GetBladeViewControlCustom();

            WpfText userNameContainer = new WpfText(bladeViewControlCustom);

            userNameContainer.SearchProperties[WpfText.PropertyNames.AutomationId] = "FirstNameLabel";

            WpfText userNameText = new WpfText(userNameContainer);

            userNameText.SearchConfigurations.Add(SearchConfiguration.DisambiguateChild);

            WpfText userEmailContainer = new WpfText(bladeViewControlCustom);

            userEmailContainer.SearchProperties[WpfText.PropertyNames.AutomationId] = "EmailLabel";

            WpfText userEmailText = new WpfText(userEmailContainer);

            userEmailText.SearchConfigurations.Add(SearchConfiguration.DisambiguateChild);


            //
            // **** Using Try/Catch so the test will keep going without stopping when Assert is true, but it'll mark the test successfully run.
            //  SHOULD WE USE TRY/CATCH ????

            try
            {
                // Verify that the 'Name' property of user name is correct
                Assert.AreEqual(userName, userNameText.Name.ToString(), "!!! Wrong User Name Displayed !!!");
                Logger.log.Info("    ===  Correct User Name displayed : " + userNameText.Name.ToString());
            }
            catch (AssertFailedException ex)
            {
                Logger.log.Error(ex.Message.ToString());
            }

            try
            {
                // Verify that the 'Name' property of user email is correct
                Assert.AreEqual(userEmail, userEmailText.Name.ToString(), "!!! Wrong Email Address Displayed !!!");
                Logger.log.Info("    ===  Correct Email Address displayed : " + userEmailText.Name.ToString());
            }
            catch (AssertFailedException ex)
            {
                Logger.log.Error(ex.Message.ToString());
            }

            Logger.log.Info("******  End VerifyUserInfo() ********");
        }