/// <summary>
        /// Waits for a new page to load on the frontend.
        /// </summary>
        /// <param name="expectedUrl">The expected url after the item is loaded.</param>
        /// <param name="openInNewWindow">true or false dependingon Open in new window option</param>
        public void WaitForNewPageToLoad(string expectedUrl, bool openInNewWindow)
        {
            if (openInNewWindow)
            {
                Manager.WaitForNewBrowserConnect(expectedUrl, true, TimeOut);
            }
            else
            {
                ActiveBrowser.WaitUntilReady();
                ActiveBrowser.WaitForUrl(expectedUrl);
            }

            HttpResponseMessage response = new HttpResponseMessage();

            Assert.AreEqual(200, (int)response.StatusCode);
        }
예제 #2
0
        /// <summary>
        /// Checks the field is present.
        /// </summary>
        /// <returns>Is success message field contained</returns>
        private bool CheckFieldIsPresent()
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();

            HtmlDiv sucessMessage = ActiveBrowser.Find.ByExpression <HtmlDiv>("TagName=div", "InnerText=Your changes are saved");

            bool result = false;

            if (sucessMessage != null)
            {
                result = true;
            }

            return(result);
        }
예제 #3
0
        /// <summary>
        /// Select shared content block
        /// </summary>
        /// <param name="sharedContentTitle">The title of the shared content</param>
        public void SelectContentBlock(string sharedContentTitle)
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncRequests();
            ActiveBrowser.RefreshDomTree();

            HtmlDiv sharedContentBlockList = EM.GenericContent.ContentBlockWidget.ContentBlockList
                                             .AssertIsPresent("Shared content list");

            var itemSpan = sharedContentBlockList.Find.ByExpression <HtmlSpan>("class=ng-binding", "InnerText=" + sharedContentTitle);

            itemSpan.Wait.ForVisible();
            itemSpan.ScrollToVisible();
            itemSpan.MouseClick();
            this.DoneSelectingButton();
        }
예제 #4
0
        /// <summary>
        /// Selects all templates from the sidebar.
        /// </summary>
        private void SelectAllTemplatesFromTheSidebar()
        {
            BAT.Utilities().InMultiSiteMode(() =>
            {
                ActiveBrowser.WaitUntilReady();
                ActiveBrowser.WaitForAsyncOperations();
                ActiveBrowser.WaitForBinding();

                HtmlAnchor allTemplatesFilter = ActiveBrowser.Find.ByExpression <HtmlAnchor>("id=?_controlTemplatesBackendList_ctl00_ctl00_sidebar_allTemplates_ctl00_ctl00_allTemplates")
                                                .AssertIsPresent("all templates filter");
                allTemplatesFilter.Click();

                ActiveBrowser.WaitForAsyncOperations();
                ActiveBrowser.WaitForBinding();
            });
        }
예제 #5
0
        /// <summary>
        /// Click search link
        /// </summary>
        /// <param name="resultPageUrl">results page URL</param>
        public void ClickSearchLink(string resultsPageUrl)
        {
            Manager.Current.Wait.For(() =>
            {
                ActiveBrowser.RefreshDomTree();
                var link    = ActiveBrowser.Find.ByExpression <HtmlAnchor>("tagname=a", "innerText=Search");
                bool result = link != null && link.IsVisible();
                return(result);
            });
            HtmlAnchor searchButton = this.EM.Search.SearchFrontend.SearchLink.AssertIsPresent("Search link");

            searchButton.Click();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForUrl(resultsPageUrl);
            ActiveBrowser.WaitForAsyncJQueryRequests();
        }
예제 #6
0
        /// <summary>
        /// Verifies user single bootstrap page after clicking on a user link
        /// </summary>
        /// <param name="userFirstLastName">user first and last anme</param>
        /// <param name="singlePageURlEnding">single user page URL ending</param>
        public void VerifySingleUserOnBootstrapPage(string userFirstLastName, string userEmail, string singlePageURlEnding)
        {
            HtmlAnchor userLink = this.EM.Identity.UsersListFrontend.GetSingleUserLink(userFirstLastName).AssertIsPresent("link to single user page");

            userLink.Click();

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForUrl(singlePageURlEnding);
            ActiveBrowser.WaitForAsyncJQueryRequests();

            HtmlDiv usersDiv = this.EM.Identity.UsersListFrontend.SingleUserDivBootstrapPage.AssertIsPresent("single user");

            Assert.AreEqual("/SFRes/images/Telerik.Sitefinity.Resources/Images.DefaultPhoto.png", usersDiv.ChildNodes[0].ChildNodes[0].As <HtmlImage>().Src, "Scr of user profile");
            Assert.AreEqual(userFirstLastName, usersDiv.ChildNodes[1].ChildNodes[0].InnerText, "first and last name");
            Assert.AreEqual(userEmail, usersDiv.ChildNodes[1].ChildNodes[1].InnerText, "user email");
        }
        /// <summary>
        /// Checks the custom confirmation is present.
        /// </summary>
        /// <returns>The result</returns>
        private bool CheckCustomConfirmationIsPresent()
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();

            HtmlDiv customConfirmaion = this.EM.Forms.FormsBackend.UseCustomConfirmationDiv;

            bool result = false;

            if (customConfirmaion != null)
            {
                result = true;
            }

            return(result);
        }
예제 #8
0
        /// <summary>
        /// Provide access to advance button
        /// </summary>
        public void AdvanceButtonSelecting()
        {
            HtmlDiv contentBlockFooter = EM.GenericContent
                                         .ContentBlockWidget
                                         .ContentBlockWidgetFooter
                                         .AssertIsPresent("Footer");

            HtmlAnchor advanceButton = contentBlockFooter.Find
                                       .ByExpression <HtmlAnchor>("class=btn btn-default btn-xs m-top-xs designer-btn-PropertyGrid ng-scope", "InnerText=Advanced")
                                       .AssertIsPresent("Advance selecting button");

            advanceButton.Click();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncRequests();
            ActiveBrowser.RefreshDomTree();
        }
예제 #9
0
        /// <summary>
        /// Verify if element By InnerText is present.
        /// </summary>
        /// <param name="innerText">The inner text of the element.</param>
        /// <returns>If element is present.</returns>
        public bool IsElementByInnerTextPresent(string innerText)
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();

            HtmlControl element = Manager.Current.ActiveBrowser.Find.ByExpression <HtmlControl>("innertext=~" + innerText);

            bool result = false;

            if (element != null)
            {
                result = element.IsVisible();
            }

            return(result);
        }
        public void AddAndRemoveChoicesToCheckBoxField()
        {
            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FormName);
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(CheckboxesField);
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ChangeLabel(ChoiceText);
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ClickToAddNewChoiceLink();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().AddNewChoiceLabel(NewChoice);
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ClickToRemoveFirstChoiceLink();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().AddOtherChoice();
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm();

            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture);
            Assert.IsTrue(ActiveBrowser.ContainsText(NewChoice), "Choice not found on the page");
            Assert.IsFalse(ActiveBrowser.ContainsText(Choice), "Choice was not found on the page");
            Assert.IsTrue(ActiveBrowser.ContainsText(OtherChoice), "Choice not found on the page");
            Assert.IsTrue(ActiveBrowser.ContainsText(ChoiceText), "Choice not found on the page");
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SelectCheckbox(NewChoice);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SubmitForm();

            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().ViewFormResponses(FormName);

            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyNumberOfResponses(ExpectedResponsesCount1);
            BAT.Wrappers().Backend().Forms().FormsResponseScreen().SelectResponse(ExpectedResponsesCount1);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseAuthorUsername(ExpectedAuthorName);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseSubmitDate();
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseMultipleChoiceAnswer(NewChoice);

            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SelectOtherCheckboxButton();
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SetTextToOtherChoiceInCheckBoxField(OtherChoiceText);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SubmitForm();

            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().ViewFormResponses(FormName, TwoResponses);

            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyNumberOfResponses(ExpectedResponsesCount2);
            BAT.Wrappers().Backend().Forms().FormsResponseScreen().SelectResponse(ExpectedResponsesCount2);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseAuthorUsername(ExpectedAuthorName);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseSubmitDate();
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseMultipleChoiceAnswer(OtherChoiceText);
        }
예제 #11
0
        /// <summary>
        /// Provide access to "Create content" link
        /// </summary>
        public void CreateContentLink()
        {
            HtmlAnchor createContent = EM.GenericContent
                                       .ContentBlockWidget
                                       .CreateContent
                                       .AssertIsPresent("Create content");

            createContent.Click();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncRequests();
            ActiveBrowser.RefreshDomTree();

            HtmlFindExpression expression = new HtmlFindExpression("class=modal-title", "InnerText=ContentBlock");

            ActiveBrowser.WaitForElement(expression, TimeOut, false);
            Manager.Current.Wait.For(this.WaitForSaveButton, Manager.Current.Settings.ClientReadyTimeout);
        }
        /// <summary>
        /// Click select button by date
        /// </summary>
        public void ClickSelectButtonByDate()
        {
            var selectButtons = EM.Widgets.WidgetDesignerContentScreen.SelectButtonsDate;

            foreach (var button in selectButtons)
            {
                if (button.IsVisible())
                {
                    button.Click();
                    break;
                }
            }

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncRequests();
            ActiveBrowser.RefreshDomTree();
        }
예제 #13
0
        public void UploadUserAvatar()
        {
            BATFeather.Wrappers().Frontend().Identity().ProfileWrapper().ClickUploadPhotoLink();
            string fullImagesPath = DeploymentDirectory + @"\";
            var    fullFilePath   = string.Concat(fullImagesPath, FileToUpload);

            var uploadDialog = new FileUploadDialog(Manager.Current.ActiveBrowser, fullFilePath, DialogButton.OPEN);

            Manager.Current.DialogMonitor.AddDialog(uploadDialog);
            Manager.Current.DialogMonitor.Start();

            uploadDialog.WaitUntilHandled();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();

            BATFeather.Wrappers().Frontend().Identity().ProfileWrapper().SaveChangesButton();
        }
 public void PreviewFormWithTextField()
 {
     BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
     BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FormName);
     ActiveBrowser.WaitUntilReady();
     ActiveBrowser.WaitForAsyncOperations();
     ActiveBrowser.RefreshDomTree();
     BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(TextField);
     BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ChangeTexboxLabel(TextFieldLabel);
     BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges();
     BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ClickPreviewButton();
     ActiveBrowser.WaitUntilReady();
     ActiveBrowser.RefreshDomTree();
     ActiveBrowser.WaitUntilReady();
     Assert.IsTrue(ActiveBrowser.ContainsText(TextFieldLabel), "Text was not found on the page");
     BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyTextboxFieldContainerIsVisible();
 }
예제 #15
0
        /// <summary>
        /// Verifies the navigation pages labels.
        /// </summary>
        /// <param name="labels">The labels.</param>
        /// <param name="navIndex">Index of the nav.</param>
        public void VerifyNavigationPagesLabels(List <string> labels, int navIndex = 0)
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitUntilReady();

            var lists = ActiveBrowser.Find.AllByExpression <HtmlUnorderedList>("class=sf-FormNav");

            lists[navIndex].AssertIsVisible("Navigation list");

            var pageLabels = lists[navIndex].Find.AllByTagName("li");

            for (int i = 0; i < labels.Count; i++)
            {
                Assert.AreEqual((i + 1) + labels[i], pageLabels[i].InnerText);
            }
        }
        public void Associate_toUSOffice_CodedStep()
        {
            IList <Element> secondaryofcs = Find.AllByXPath("//select[@class='listBox']/option");
            int             ecount        = secondaryofcs.Count();

            //Console.WriteLine(ecount);
            //Console.ReadLine();
            //if(ecount > 0 )

            ActiveBrowser.ContentWindow.SetFocus();
            Pages.EditUser.SelectedSecondaryOfficeIdsSelect.ScrollToVisible();
            Pages.EditUser.SelectedSecondaryOfficeIdsSelect.Focus();
            ActiveBrowser.Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Shift+Down"), 100, ecount);
            ActiveBrowser.WaitUntilReady();
            Pages.EditUser.BtnLeftButton.Click();

            //Pages.EditUser.BtnLeftButton.Click();
        }
예제 #17
0
        /// <summary>
        /// Checks the field is present.
        /// </summary>
        /// <returns></returns>
        private bool CheckFieldIsPresent()
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();

            Manager.Current.ActiveBrowser.RefreshDomTree();

            HtmlDiv cb = ActiveBrowser.Find.ByCustom <HtmlDiv>(x => x.CssClass.Contains("sfFieldEditable"));

            bool result = false;

            if (cb != null)
            {
                result = true;
            }

            return(result);
        }
        public void SetRequiredFileUpload()
        {
            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FormName);
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(FileField);
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().CheckRequiredFileUploadFieldCheckbox();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ChangeRequiredMessageFileUpload(NewRequiredMessage);
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm();

            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().ClickSubmit();
            Assert.IsTrue(ActiveBrowser.ContainsText(NewRequiredMessage), "Text was not found on the page");
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyPageUrl(PageName);
        }
예제 #19
0
        public void SetRequiredTextboxField()
        {
            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().ClickCreateAFormButton();
            BAT.Wrappers().Backend().Forms().FormsCreateScreen().SetFormName(FormName);
            BAT.Wrappers().Backend().Forms().FormsCreateScreen().ClickCreateAndAddContent();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().AddField(FieldName);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(FieldName);
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().CheckRequiredFieldCheckbox();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ChangeRequiredMessage(NewRequiredMessage);
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm();

            BAT.Macros().NavigateTo().Pages(this.Culture);

            BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName);
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(WidgetName);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName);
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInFormWidgetSelector(FormName);
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage();

            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().ClickSubmit();
            Assert.IsTrue(ActiveBrowser.ContainsText(NewRequiredMessage), "Text was not found on the page");
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyPageUrl(PageName);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SetTextboxContent(TextBoxContent);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SubmitForm();

            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().ViewFormResponses(FormName);

            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyNumberOfResponses(ExpectedResponsesCount);
            BAT.Wrappers().Backend().Forms().FormsResponseScreen().SelectResponse(ResponseNumber);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseAuthorUsername(ExpectedAuthorName);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseSubmitDate();
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseTextboxAnswer(TextBoxContent);
        }
예제 #20
0
        /// <summary>
        /// Click search button
        /// </summary>
        /// <param name="resultPageUrl">results page URL</param>
        public void ClickSearchButton(string resultsPageUrl)
        {
            Manager.Current.Wait.For(() =>
            {
                ActiveBrowser.RefreshDomTree();
                var button  = ActiveBrowser.Find.ByExpression <HtmlButton>("tagname=button", "innerText=Search");
                bool result = button != null && button.IsVisible();
                return(result);
            });

            HtmlButton searchButton = this.EM.Search.SearchFrontend.SearchButton.AssertIsPresent("Search button");

            searchButton.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.focus);
            searchButton.AsjQueryControl().InvokejQueryEvent(jQueryControl.jQueryControlEvents.click);

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForUrl(resultsPageUrl);
            ActiveBrowser.WaitForAsyncJQueryRequests();
        }
예제 #21
0
        /// <summary>
        /// Clicks edit link for a selected widget.
        /// </summary>
        /// <param name="widgetName">The widget name.</param>
        /// <param name="dropZoneIndex">The drop zone index.</param>
        public void EditWidget(string widgetName, int dropZoneIndex = 0)
        {
            ActiveBrowser.RefreshDomTree();
            var widgetHeader = ActiveBrowser
                               .Find
                               .AllByCustom <HtmlDiv>(d => d.CssClass.StartsWith("rdTitleBar") && d.ChildNodes.First().InnerText.Equals(widgetName))[dropZoneIndex]
                               .AssertIsPresent(widgetName);

            widgetHeader.ScrollToVisible();
            HtmlAnchor editLink = widgetHeader.Find
                                  .ByCustom <HtmlAnchor>(a => a.TagName == "a" && a.Title.Equals("Edit"))
                                  .AssertIsPresent("edit link");

            editLink.Focus();
            editLink.Click();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
        }
예제 #22
0
        public void BreadcrumbDetailEventItemVirtualNodes()
        {
            RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/sitefinity/pages", false));
            BAT.Macros().NavigateTo().Pages(this.Culture);
            BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageTitle);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName);
            BATFeather.Wrappers().Backend().ModuleBuilder().DynamicWidgetAdvancedSettingsWrapper().ClickAdvancedSettingsButton();
            BATFeather.Wrappers().Backend().ModuleBuilder().DynamicWidgetAdvancedSettingsWrapper().ClickModelButton();
            BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().SetAllowVirtualNodes("True");
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage();

            BAT.Macros().NavigateTo().CustomPage("~/" + PageTitle.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().CommonWrapper().VerifySelectedAnchorLink(EventsTitle, this.expectedUrl);
            ActiveBrowser.WaitUntilReady();
            BATFeather.Wrappers().Frontend().Navigation().NavigationWrapper().VerifyBreadcrumbInFrontend(PageTitle, EventsTitle);

            BAT.Macros().NavigateTo().Pages(this.Culture);
        }
예제 #23
0
        /// <summary>
        /// Verify comments author and content
        /// </summary>
        /// <param name="commentsAuthor">Comments author</param>
        /// <param name="commentsContent">Comments content</param>
        public void VerifyCommentsAuthorAndContent(string[] commentsAuthor, string[] commentsContent)
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitForAsyncJQueryRequests();
            ActiveBrowser.WaitForAjax(10000);

            IList <HtmlDiv> allCommentsDivs = this.EM.CommentsAndReviews.CommentsFrontend.ResultsCommentsList;

            Assert.IsNotNull(allCommentsDivs, "Comments list is null");
            Assert.AreNotEqual(0, allCommentsDivs.Count, "Comments list has no elements");

            Assert.AreEqual(commentsContent.Count(), allCommentsDivs.Count, "Expected and actual count of comments are not equal");

            for (int i = 0; i < allCommentsDivs.Count(); i++)
            {
                Assert.AreEqual(commentsAuthor[i], allCommentsDivs[i].ChildNodes[0].InnerText);
                Assert.AreEqual(commentsContent[i], allCommentsDivs[i].ChildNodes[2].InnerText);
            }
        }
예제 #24
0
        /// <summary>
        /// Selects media from media selector.
        /// </summary>
        /// <param name="title">The media title.</param>
        public void SelectMediaFile(string title, bool isDocumentFile = false)
        {
            ActiveBrowser.WaitUntilReady();

            HtmlControl element;

            if (isDocumentFile)
            {
                element = ActiveBrowser.Find.ByExpression <HtmlDiv>("tagName=div", "class=Media-item-title ng-binding", "innertext=" + title);
            }
            else
            {
                element = ActiveBrowser.Find.ByExpression <HtmlImage>("tagName=img", "alt=" + title);
            }

            Assert.IsNotNull(element, "Could not find element for media item \"" + title + "\" to select.");
            element.ScrollToVisible();
            element.Focus();
            element.MouseClick();
        }
예제 #25
0
        public void ApplyTwoDifferentTemplatesFromDifferentPackagesToPages()
        {
            BAT.Macros().NavigateTo().Design().PageTemplates();
            BAT.Wrappers().Backend().PageTemplates().PageTemplateMainScreen().IsPageTemplatePresentInGridView(Template1Title);
            BAT.Wrappers().Backend().PageTemplates().PageTemplateMainScreen().IsPageTemplatePresentInGridView(Template2Title);

            BAT.Arrange(this.TestName).ExecuteArrangement("CreatePages");

            BAT.Macros().NavigateTo().CustomPage("~/" + Page1Title, false);
            Assert.IsTrue(ActiveBrowser.ContainsText(Package1LayoutText), "Layout text is not correct");
            ActiveBrowser.Refresh();
            ActiveBrowser.WaitUntilReady();
            Assert.IsTrue(ActiveBrowser.ContainsText(Package1LayoutText), "Layout text is not correct");

            BAT.Macros().NavigateTo().CustomPage("~/" + Page2Title, false);
            Assert.IsTrue(ActiveBrowser.ContainsText(Package2LayoutText), "Layout text is not correct");
            ActiveBrowser.Refresh();
            ActiveBrowser.WaitUntilReady();
            Assert.IsTrue(ActiveBrowser.ContainsText(Package2LayoutText), "Layout text is not correct");
        }
예제 #26
0
        public void DeleteFormFieldInUseVerityFrontend()
        {
            RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/" + FeatherGlobals.BootstrapPageName.ToLower(), true, this.Culture, new HtmlFindExpression("id=PublicWrapper")));

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyCheckboxesFieldLabelIsVisible(FeatherGlobals.SelectAChoiceLabelName);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyDropdownListFieldLabelIsVisible(FeatherGlobals.SelectAChoiceLabelName);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifySubmitButtonIsVisible();
            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FeatherGlobals.FormName);
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ClickOnWidgetMenuItem(FeatherGlobals.CheckboxControlName, FeatherGlobals.DeleteWidgetMenuOption);
            ActiveBrowser.WaitForAsyncOperations();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().VerifyFormCheckboxWidgetIsDeleted();
            BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm();
            BAT.Macros().NavigateTo().CustomPage("~/" + FeatherGlobals.BootstrapPageName.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyCheckboxesFieldIsNotVisible();
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyDropdownListFieldLabelIsVisible(FeatherGlobals.SelectAChoiceLabelName);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifySubmitButtonIsVisible();
        }
예제 #27
0
        /// <summary>
        /// Type a message.
        /// </summary>
        /// <param name="message">Message.</param>
        public void TypeAMessage(string message)
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitForAjax(10000);
            ActiveBrowser.WaitForAsyncJQueryRequests();

            HtmlDiv editable = this.EM.CommentsAndReviews.CommentsFrontend.LeaveACommentArea
                               .AssertIsPresent("Leave area");

            editable.ScrollToVisible();
            editable.Focus();
            editable.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);
            Manager.Current.Desktop.KeyBoard.TypeText(message);
        }
        /// <summary>
        /// Checks the field is present.
        /// </summary>
        /// <returns>Is success message field contained</returns>
        private bool CheckFieldIsPresent(string fieldContent, string widgetName)
        {
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();

            Manager.Current.ActiveBrowser.RefreshDomTree();
            var widgetHeader = Manager.Current
                               .ActiveBrowser
                               .Find
                               .ByCustom <HtmlDiv>(d => d.CssClass.StartsWith("rdTitleBar") && d.ChildNodes.First().InnerText.Equals(widgetName))
                               .AssertIsPresent(widgetName);

            widgetHeader.ScrollToVisible();
            HtmlTable elementTable = widgetHeader.Parent <HtmlTableRow>().Parent <HtmlTable>();
            HtmlDiv   content      = elementTable.Find.ByExpression <HtmlDiv>("class=rdContent");
            string    innerText    = content.InnerText;

            bool result = innerText.Contains(fieldContent);

            return(result);
        }
예제 #29
0
        public void VerifyViewPermissionsForDocumentsListWidget()
        {
            RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/sitefinity/pages", true, null, new HtmlFindExpression("class=~sfMain")));
            BAT.Macros().NavigateTo().Pages(this.Culture);
            BAT.Macros().NavigateTo().Modules().Documents(this.Culture);
            BAT.Wrappers().Backend().DocumentsAndFiles().DocumentsAndFilesDashboardWrapper().ClickActionMenuAndChooseOption(0, OptionSetPermissions);
            BAT.Wrappers().Backend().Permissions().PermissionsContentWrapper().ClickBreakInheritanceButton();
            var changeBtn = BAT.Wrappers().Backend().Permissions().PermissionsContentWrapper().ChangePermissionButton("View document");

            changeBtn.Click();
            BAT.Wrappers().Backend().Permissions().PermissionsContentWrapper().SelectAndAddRole("TestRole2");

            BAT.Macros().NavigateTo().Modules().Documents(this.Culture);
            BAT.Wrappers().Backend().DocumentsAndFiles().DocumentsAndFilesDashboardWrapper().ClickActionMenuAndChooseOption(1, OptionSetPermissions);
            BAT.Wrappers().Backend().Permissions().PermissionsContentWrapper().ClickBreakInheritanceButton();
            changeBtn.Click();
            BAT.Wrappers().Backend().Permissions().PermissionsContentWrapper().SelectAndAddRole("TestRole1");

            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture);
            BAT.Macros().User().LogOut();
            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture);
            BATFeather.Wrappers().Frontend().Identity().LoginFormWrapper().EnterEmail(UserName);
            BATFeather.Wrappers().Frontend().Identity().LoginFormWrapper().EnterPassword(UserPassword);
            BATFeather.Wrappers().Frontend().Identity().LoginFormWrapper().PressLoginButton();
            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture);
            Assert.IsTrue(BATFeather.Wrappers().Frontend().CommonWrapper().AreTitlesPresentOnThePageFrontend(new string[] { DocumentTitle1, DocumentTitle2 }));
            BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().ClickDocument(DocumentTitle1);
            ActiveBrowser.WaitUntilReady();
            BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().IsDocumentTitlePresentOnDetailMasterPage(DocumentTitle1);
            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture);
            BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().ClickDocument(DocumentTitle2);
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.ContainsText("HTTP Error 403.0 - Forbidden");
            ActiveBrowser.ContainsText("This is a generic 403 error and means the authenticated user is not authorized to view the page.");
            ActiveBrowser.ContainsText("You do not have permission to view this directory or page.");
            Assert.IsFalse(ActiveBrowser.ContainsText("You are not authorized to 'View document' ('Document')."), "Text was not found on the page");
            ActiveBrowser.WaitUntilReady();
            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture);
            BATFeather.Wrappers().Frontend().Identity().LoginStatusWrapper().Logout();
        }
        public void ViewFormWithContentBlockOnPageAndVerifyResponseInBackend()
        {
            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().ClickCreateAFormButton();
            BAT.Wrappers().Backend().Forms().FormsCreateScreen().SetFormName(FormName);
            BAT.Wrappers().Backend().Forms().FormsCreateScreen().ClickCreateAndAddContent();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().AddField(FieldName);
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncOperations();
            ActiveBrowser.RefreshDomTree();
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(FieldName);
            BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().FillContentToContentBlockWidget(ExpectedContent);
            BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges();
            BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm();

            BAT.Macros().NavigateTo().Pages(this.Culture);
            BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddMvcWidgetHybridModePage(WidgetName);
            BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName);
            BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInFormWidgetSelector(FormName);
            BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges();
            BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage();

            BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().WaitForContentOnFrontend(ExpectedContent);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyContentBlockFieldTextIsVisible(ExpectedContent);
            BATFeather.Wrappers().Frontend().Forms().FormsWrapper().SubmitForm();

            BAT.Macros().NavigateTo().Modules().Forms(this.Culture);
            BAT.Wrappers().Backend().Forms().FormsDashboard().ViewFormResponses(FormName);

            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyNumberOfResponses(ExpectedResponsesCount);
            BAT.Wrappers().Backend().Forms().FormsResponseScreen().SelectResponse(ResponseNumber);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseAuthorUsername(ExpectedAuthorName);
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseSubmitDate();
            BATFeather.Wrappers().Backend().Forms().FormsWrapper().VerifyResponseContentBlockAnswer(ExpectedContent);
        }