Beispiel #1
0
        public void DragAStartNodeOntoATool_HoverOverAToolForAWhile_NoDrillDownShouldHappen()
        {
            // Create the workflow
            RibbonUIMap.CreateNewWorkflow();
            // Get some variables
            UITestControl theTab         = TabManagerUIMap.GetActiveTab();
            UITestControl theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start");
            var           workflowPoint1 = new Point(theStartButton.BoundingRectangle.X, theStartButton.BoundingRectangle.Y + 200);

            // Drag an assign onto the Workflow
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Assign, workflowPoint1);

            //Drag Start Node
            Mouse.StartDragging(theStartButton, MouseButtons.Left);
            UITestControl assign = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Assign");
            var           point  = new Point(assign.BoundingRectangle.X + 150, assign.BoundingRectangle.Y + 50);

            //Hover over the multi assign for 5 seconds
            Mouse.Move(point);
            Playback.Wait(2000);
            Mouse.Click();

            // ensure the start btn is visible, hence no drill down
            theStartButton = WorkflowDesignerUIMap.FindControlByAutomationId(theTab, "Start");
            Assert.IsTrue(theStartButton.Exists, "Start Node Hover Caused Drilldown");
        }
Beispiel #2
0
        public void ClickSaveConnection()
        {
            WpfWindow theWindow = GetNewServerWindow();
            Point     p         = new Point(theWindow.BoundingRectangle.Left + 300, theWindow.BoundingRectangle.Top + 275);

            Mouse.Move(p);
            Mouse.Click();
        }
        public void MiddleClickCloseTab(string tabName)
        {
            Mouse.Click(new Point(Screen.PrimaryScreen.Bounds.Width / 2, Screen.PrimaryScreen.Bounds.Height / 2));
            UITestControl control    = FindTabByName(tabName);
            Point         pointInTab = new Point(control.BoundingRectangle.X + 25, control.BoundingRectangle.Y + 10);

            Mouse.Move(pointInTab);
            Mouse.Click(MouseButtons.Middle);
        }
        public bool CloseTab_Click_No(UITestControl theTab)
        {
            if (CloseTab(theTab))
            {
                UITestControlCollection saveDialogButtons = null;
                try
                {
                    var tabNameControl = theTab.GetChildren().FirstOrDefault(c => c.ClassName == "Uia.TextBlock");
                    if (tabNameControl != null)
                    {
                        if (tabNameControl.FriendlyName.EndsWith("*"))
                        {
                            saveDialogButtons = GetWorkflowNotSavedButtons();
                        }
                        else if (tabNameControl.FriendlyName == "Scheduler")
                        {
                            saveDialogButtons = GetWorkflowNotSavedButtons("Scheduler Task has changes");
                        }
                        else if (tabNameControl.FriendlyName == "Settings")
                        {
                            saveDialogButtons = GetWorkflowNotSavedButtons("Security Settings have changed");
                        }
                    }
                }
                catch (Exception)
                {
                    return(true);
                    //This is empty because if the pop cant be found then the tab must just close;)
                }
                // Only if we expect a save dialog should we search for it ;)
                if (saveDialogButtons != null)
                {
                    try
                    {
                        if (saveDialogButtons.Count > 0)
                        {
                            UITestControl theBtn = saveDialogButtons[1];
                            Point         p      = new Point(theBtn.Left + 25, theBtn.Top + 15);
                            Mouse.MouseMoveSpeed = 10000;
                            Mouse.Move(p);
                            Mouse.Click();
                            return(true);
                        }
                    }
                    catch (Exception)
                    {
                        return(true);
                        //This is empty because if the pop cant be found then the tab must just close;)
                    }
                }

                return(true);
            }

            return(false);
        }
Beispiel #5
0
        public void WhenIThenDragToolboxCommentOntoSwitchRightArmOnDesignSurface()
        {
            var switchRightAutoConnector = new Point(360, 200);

            MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart.EnsureClickable(switchRightAutoConnector);
            Mouse.StartDragging(UIMap.MainStudioWindow.DockManager.SplitPaneLeft.ToolBox.ToolListBox.UtilityTools.Comment, new Point(16, 25));
            Mouse.Move(MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart, switchRightAutoConnector);
            Mouse.StopDragging(MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart, switchRightAutoConnector);
            Assert.IsTrue(DialogsUIMap.DecisionOrSwitchDialog.Exists, "DecisionSwitch Dialog did not open");
        }
        public void CloseTab_Click_Cancel(string tabName)
        {
            CloseTab(tabName);

            UITestControlCollection saveDialogButtons = GetWorkflowNotSavedButtons();
            UITestControl           cancelButton      = saveDialogButtons[2];
            Point p = new Point(cancelButton.Left + 25, cancelButton.Top + 15);

            Mouse.Move(p);
            Mouse.Click();
        }
Beispiel #7
0
        public void First_Drag_Toolbox_Comment_Onto_Switch_Left_Arm_On_DesignSurface()
        {
            UIMap.MainStudioWindow.DockManager.SplitPaneLeft.ToolBox.SearchTextBox.Text = "Comment";
            var switchLeftAutoConnector = new Point(250, 200);

            MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart.EnsureClickable(switchLeftAutoConnector);
            Mouse.StartDragging(UIMap.MainStudioWindow.DockManager.SplitPaneLeft.ToolBox.ToolListBox.UtilityTools.Comment, new Point(16, 25));
            Mouse.Move(MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart, switchLeftAutoConnector);
            Mouse.StopDragging(MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart, switchLeftAutoConnector);
            Assert.IsTrue(WorkflowTabUIMap.MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart.Connector2.Exists, "Second connector does not exist on design surface after drop onto autoconnector.");
            Assert.IsTrue(UtilityToolsUIMap.MainStudioWindow.DockManager.SplitPaneMiddle.TabManSplitPane.TabMan.WorkflowTab.WorkSurfaceContext.WorkflowDesignerView.DesignerView.ScrollViewerPane.ActivityTypeDesigner.WorkflowItemPresenter.Flowchart.Comment.Exists, "Comment tool does not exist on the design surface after drag and drop from the toolbox.");
        }
Beispiel #8
0
        public void ClearServerAddress()
        {
            WpfWindow theWindow = GetNewServerWindow();
            Point     p         = new Point(theWindow.BoundingRectangle.Left + 300, theWindow.BoundingRectangle.Top + 125);

            Mouse.Move(p);
            Mouse.Click();
            SendKeys.SendWait("{END}");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("+{HOME}");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("{DELETE}");
        }
Beispiel #9
0
        // ReSharper disable InconsistentNaming
        public void StudioTooling_StudioToolingUITest_CanOpenLargeView_NoExceptionsThrown()
        // ReSharper restore InconsistentNaming
        {
            var toolsWithLargeView = new List <string>
            {
                "DsfPathCopy",
                "DsfPathCreate",
                "DsfPathDelete",
                "DsfWebGetRequestActivity",
                "DsfAssignActivity",
                "DsfPathRename",
                "DsfSqlBulkInsertActivity",
                "DsfPathMove",
                "DsfFileRead",
                "DsfFileWrite",
                "DsfFolderRead ",
                "DsfUnZip",
                "DsfZip"
            };

            // Open the Explorer
            ExplorerUIMap.EnterExplorerSearchText("AllTools");

            // Open the Workflow
            ExplorerUIMap.DoubleClickOpenProject("localhost", "Mocake", "AllTools");
            UITestControl theTab = TabManagerUIMap.GetActiveTab();

            var designer = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab);

            var toolsWithLargeViews = designer.GetChildren()
                                      .Where(t => toolsWithLargeView.Contains(t.FriendlyName))
                                      .ToList();

            foreach (var child in toolsWithLargeViews)
            {
                //Some of the tools on the design surface are out of view, look for them...
                WorkflowDesignerUIMap.ScrollControlIntoView(theTab, child);

                Mouse.Move(child, new Point(15, 15));
                Playback.Wait(2500); // Sorted with framework ;)

                WorkflowDesignerUIMap.OpenCloseLargeView(child.Name, theTab);
                Playback.Wait(500);
                WorkflowDesignerUIMap.OpenCloseLargeView(child.Name, theTab);
                Playback.Wait(500);
            }
        }
Beispiel #10
0
        public void CopyDecisionsWithContextMenuAndPasteExpectedNoWizardsDisplayed()
        {
            //Initialize
            Clipboard.SetText(" ");
            RibbonUIMap.CreateNewWorkflow();
            UITestControl theTab = TabManagerUIMap.GetActiveTab();

            //Drag on two decisions
            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, WorkflowDesignerUIMap.GetPointUnderStartNode(theTab));
            WizardsUIMap.WaitForWizard();

            _decisionWizardUiMap.HitDoneWithKeyboard();
            var newPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab);

            newPoint.Y = newPoint.Y + 200;

            var clickPoint = new Point(newPoint.X, newPoint.Y);

            ToolboxUIMap.DragControlToWorkflowDesigner(ToolType.Decision, newPoint);
            WizardsUIMap.WaitForWizard(7000);

            _decisionWizardUiMap.HitDoneWithKeyboard();

            //Rubber-band select them
            var startDragPoint = WorkflowDesignerUIMap.GetPointUnderStartNode(theTab);

            startDragPoint.X = startDragPoint.X - 100;
            startDragPoint.Y = startDragPoint.Y - 100;
            Mouse.Move(startDragPoint);
            newPoint.X = newPoint.X + 100;
            newPoint.Y = newPoint.Y + 100;
            Mouse.StartDragging();
            Mouse.StopDragging(newPoint);
            startDragPoint.X = startDragPoint.X + 150;
            startDragPoint.Y = startDragPoint.Y + 150;
            Mouse.Click(MouseButtons.Right, ModifierKeys.None, clickPoint);
            var designSurface = WorkflowDesignerUIMap.GetFlowchartDesigner(theTab);

            SendKeys.SendWait("{DOWN}{DOWN}{ENTER}");
            Mouse.Click(designSurface);
            SendKeys.SendWait("^v");
            UITestControl uIItemImage = DatabaseServiceWizardUIMap.UIBusinessDesignStudioWindow.GetChildren()[0].GetChildren()[0];

            // Assert
            Assert.AreEqual("System Menu Bar", uIItemImage.FriendlyName);
        }
Beispiel #11
0
        public string SaveWindow_EnterNameText_Return_NameText(string text)
        {
            Clipboard.SetText("asduansldkuansdio7asnd");
            WpfWindow theWindow = GetNewServerWindow();
            Point     p         = new Point(theWindow.BoundingRectangle.Left + 300, theWindow.BoundingRectangle.Top + 450);

            Mouse.Move(p);

            // Click the box
            Mouse.Click();

            // Enter the text
            SendKeys.SendWait(text);

            // Copy it (It's not copy friendly...)
            System.Threading.Thread.Sleep(500);
            Mouse.DoubleClick();
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^(C)");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^(c)");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^C");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^c");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^(C)");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^(c)");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^C");
            System.Threading.Thread.Sleep(500);
            SendKeys.SendWait("^c");
            System.Threading.Thread.Sleep(500);
            string returnText = Clipboard.GetText();

            // And return it
            return(returnText);
        }
Beispiel #12
0
        public void TC02_RetrieveNewLink2()
        {
            DiscussGroupLinkService linkService = new DiscussGroupLinkService();
            List <DiscussGroupLink> list        = linkService.getByStatus(EntityStatus.Waiting);

            Console.WriteLine("获得{0}条未处理的DiscussGroupLink", list.Count);

            int count = list.Count;

            for (int i = 0; i < count; i++)
            {
                DiscussGroupLink link = list[i];
                Console.WriteLine("处理DiscussGroupLink, ID={0}", link.ID);

                string root    = (new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location)).Directory.FullName;
                string exeFile = root + "\\files\\ShowNotify.exe";
                Process.Start(exeFile, "2000 " + string.Format("正在处理:{0}/{1}", i, count));

                try
                {
                    linkService.UpdateStatus(link.ID, EntityStatus.Processing, "处理中");
                    string newLink = "";

                    //QQ讨论组
                    if (link.LinkType == "Z")
                    {
                        string oldLink = link.OldLink;

                        //使用默认浏览器(IE)打开指定地址
                        Console.WriteLine("[{0}] 打开IE浏览器", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        JoinTalkWebPage jtPage = new JoinTalkWebPage();
                        jtPage.LaunchUrl(new System.Uri(oldLink));
                        //点击“加入多人聊天”按钮
                        Console.WriteLine("[{0}] 点击“加入多人聊天”按钮", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        jtPage.JoinTalkDoc.BtnJoinTalk.WaitForControlExist();
                        Mouse.Click(jtPage.JoinTalkDoc.BtnJoinTalk);
                        //关闭浏览器
                        Console.WriteLine("[{0}] 关闭浏览器", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        jtPage.Close();
                        //jtPage.WaitForControlNotExist();

                        //获取聊天对话框
                        Console.WriteLine("[{0}] 获取聊天对话框", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        QQTalkWindow2 window = new QQTalkWindow2();
                        //获取工具条按钮
                        Console.WriteLine("[{0}] 获取工具条按钮", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        //WinButton moreInfoButton = window.TalkToolBar.MoreInfoButton;
                        //点击“邀请加入多人聊天”
                        Console.WriteLine("[{0}] 点击“邀请加入多人聊天”", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        //Mouse.Click(moreInfoButton);
                        Mouse.Click(new Point(1158, 205));
                        Thread.Sleep(1000);

                        //获取弹出窗口
                        Console.WriteLine("[{0}] 获取弹出窗口", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        UIMenuWindow uiMenuWindow = new UIMenuWindow();
                        //等待弹出窗口显示完毕
                        Console.WriteLine("[{0}] 等待弹出窗口显示完毕", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        //uiMenuWindow.UIMenu.CopyLinkMenuItem.WaitForControlExist();
                        Thread.Sleep(100);
                        //点击“复制邀请链接”
                        Console.WriteLine("[{0}] 点击“复制邀请链接”", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        //Mouse.Click(uiMenuWindow.UIMenu.CopyLinkMenuItem);
                        Mouse.Move(new Point(Mouse.Location.X, Mouse.Location.Y + 104));
                        Mouse.Click();
                        Console.WriteLine("[{0}] 休眠1秒钟", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        Thread.Sleep(500);

                        //从黏贴板中读取新邀请链接
                        Console.WriteLine("[{0}] 从黏贴板中读取新邀请链接", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        newLink = Clipboard.GetText();
                        if (!string.IsNullOrWhiteSpace(newLink) && newLink.StartsWith("点击链接加入多人聊天"))
                        {
                            newLink = Clipboard.GetText().Split("\r\n".ToCharArray())[1];
                        }

                        //Keyboard.SendKeys(window.Input, ":) just for holding this group. sorry to bother.");
                        //Keyboard.SendKeys(window.Input, KeyboardKeys.ENTER);

                        //关闭讨论组标签
                        Console.WriteLine("[{0}] 关闭讨论组标签", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        Keyboard.SendKeys(window, KeyboardKeys.ESC);
                    }
                    else
                    {
                        //QQ群
                    }

                    //保存新Url,http://url.cn/5rUmF4D
                    if (!string.IsNullOrWhiteSpace(newLink))
                    {
                        linkService.UpdateNewLink(link.ID, newLink);
                    }
                    else
                    {
                        linkService.UpdateStatus(link.ID, EntityStatus.Fail, "获取新链接失败");
                    }
                }
                catch (Exception ex)
                {
                    linkService.UpdateStatus(link.ID, EntityStatus.Fail, HttpUtility.UrlEncode(ex.Message));
                }

                //break;
            }
        }
        /// <summary>
        /// Gets the adorner hover point.
        /// </summary>
        /// <param name="boundingRectangle">The bounding rectangle.</param>
        /// <returns></returns>
        public void MoveMouseForAdornersToAppear(Rectangle boundingRectangle)
        {
            var p = new Point((boundingRectangle.X + 25), (boundingRectangle.Y + 60));

            Mouse.Move(p);
        }