/// <summary>
 /// Drags the widget to the specified dropzone
 /// </summary>
 /// <param name="widgetElement">The Widget</param>
 /// <param name="dropZone">The Dropzone</param>
 private void AddWidgetToDropZone(HtmlDiv widgetElement, HtmlDiv dropZone)
 {
     ActiveBrowser.RefreshDomTree();
     widgetElement.Refresh();
     widgetElement.DragTo(dropZone);
 }
 /// <summary>
 /// Drags the widget to the specified dropzone
 /// </summary>
 /// <param name="widgetElement">The Widget</param>
 /// <param name="dropZone">The Dropzone</param>
 private void AddWidgetToDropZone(HtmlDiv widgetElement, HtmlDiv dropZone)
 {
     ActiveBrowser.RefreshDomTree();
     widgetElement.Refresh();
     widgetElement.DragTo(dropZone);
 }
예제 #3
0
        public void EditStanderPage(string Name, string TopContent)
        {
            //Click On the Edit Button
            Thread.Sleep(20000);
            myManager.ActiveBrowser.RefreshDomTree();
            HtmlSpan EditButton     = myManager.ActiveBrowser.Find.ByExpression("id=#dijit_form_ToggleButton_.", "title=All Properties").As <HtmlSpan>();
            HtmlSpan EditButtonSpan = EditButton.Find.AllByTagName("span")[0].As <HtmlSpan>();

            EditButtonSpan.ScrollToVisible();
            EditButtonSpan.MouseHover();
            EditButtonSpan.MouseClick();
            Thread.Sleep(7000);


            //Click on the rightTogglebar to get blocks
            ObjEditMode editmode = new ObjEditMode(myManager);

            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            HtmlSpan righttogglebar = editmode.RightPane.As <HtmlSpan>();

            righttogglebar.MouseClick();

            //click on the pin icon
            Thread.Sleep(5000);
            myManager.ActiveBrowser.RefreshDomTree();
            HtmlSpan PagesTreePin = editmode.RightSideBLockPin.As <HtmlSpan>();

            PagesTreePin.MouseClick();

            //Search for the top block
            HtmlInputText Searchforblocks = editmode.RightPaneSearchText.As <HtmlInputText>();

            Searchforblocks.Text = TopContent;
            Searchforblocks.MouseClick();
            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, Searchforblocks.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);


            Thread.Sleep(5000);
            myManager.ActiveBrowser.RefreshDomTree();
            //Selected dev
            HtmlDiv Kbanner = myManager.ActiveBrowser.Find.ById("dgrid_4-row-16206").As <HtmlDiv>();

            HtmlDiv topcontentarea = editmode.topcontentarea.As <HtmlDiv>();

            var des = new System.Drawing.Point();

            des.X = topcontentarea.ScrollTop + 50;
            des.Y = topcontentarea.ScrollLeft + 50;

            Kbanner.DragTo(topcontentarea, ArtOfTest.Common.OffsetReference.TopCenter, des);

            //Add other details
            ObjStanderd standerdpage = new ObjStanderd(myManager);

            HtmlInputText Heading      = standerdpage.Heading.As <HtmlInputText>();
            HtmlTextArea  Introduction = standerdpage.Introduction.As <HtmlTextArea>();

            //adding just the heading wont add the text to the contorl
            Heading.ScrollToVisible();
            Heading.MouseHover();
            Heading.MouseClick();
            Heading.Text = _Heading;

            Introduction.ScrollToVisible();
            Introduction.MouseHover();
            Introduction.MouseClick();
            Introduction.Text = _Introduction;

            ArtOfTest.WebAii.Core.Browser t1_frame = myManager.ActiveBrowser.Frames[0];
            Element TextEditor = t1_frame.Find.ByXPath("/html/body");

            myManager.ActiveBrowser.Actions.SetText(TextEditor, _BodyText);

            //Publish
            //Click on publish
            HtmlSpan PublishButton = editmode.PublishDropdown.As <HtmlSpan>();

            PublishButton.ScrollToVisible();
            PublishButton.MouseHover();
            PublishButton.MouseClick();
            Thread.Sleep(2000);

            myManager.ActiveBrowser.RefreshDomTree();
            HtmlSpan Publish = editmode.PublishButton.As <HtmlSpan>();

            Publish.MouseHover();
            Publish.MouseClick();
            Thread.Sleep(10000);

            myManager.ActiveBrowser.Refresh();
            //Click on options dropdown
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            HtmlSpan OptionsButton = editmode.OptionsButton.As <HtmlSpan>();

            OptionsButton.ScrollToVisible();
            OptionsButton.MouseHover();
            OptionsButton.MouseClick();


            //Click on the URL
            Thread.Sleep(5000);
            myManager.ActiveBrowser.WaitUntilReady();
            myManager.ActiveBrowser.RefreshDomTree();
            HtmlDiv    OptionsDropdown = editmode.OptionsDropdown.As <HtmlDiv>();
            HtmlAnchor pagelink        = OptionsDropdown.Find.AllByTagName <HtmlAnchor>("a")[0];

            pagelink.MouseClick();
            Thread.Sleep(2000);


            ValidatePage(_Heading);
        }