public void NavigationWidgetAllLevelsToIncludeFoundationTemplate() { string pageTemplateName = "Foundation.default"; string navTemplateClass = "side-nav"; BAT.Macros().User().EnsureAdminLoggedIn(); BAT.Arrange(this.ArrangementClass).AddParameter("templateName", pageTemplateName).ExecuteArrangement(this.ArrangementMethod); BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().SelectLevelsToInclude(LevelsToInclude); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().SelectWidgetListTemplate(NavWidgetTemplate); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().SaveChanges(); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); string[] parentPages = new string[] { PageName }; string[] childPages = new string[] { ChildPage1, ChildPage2 }; BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); BATFeather.Wrappers().Frontend().Navigation().NavigationWrapper().VerifyNavigationOnThePageFrontend(navTemplateClass, parentPages, TemplateType.Foundation); BATFeather.Wrappers().Frontend().Navigation().NavigationWrapper().VerifyChildPagesFrontEndNavigation(navTemplateClass, childPages, TemplateType.Foundation); BAT.Wrappers().Frontend().Navigation().NavigationFrontendWrapper().SelectPageFromNavigationByText(navTemplateClass, ChildPage1); ActiveBrowser.WaitForUrl("/" + ChildPage1.ToLower(), true, 60000); }
public void SelectAllPublishedImagesWithOverlayGalleryTemplate_Bootstrap() { this.SelectListTemplateInImageGalleryDesigner(BootstrapTemplate, OverlayGalleryTemplate); foreach (var image in this.imageTitles) { string src = this.GetImageSource(false, image, ImageType); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageThumbnail(image, src); } BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); int i = 3; foreach (var image in this.imageTitles) { var src = this.GetImageSource(false, image, ImageType); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImage(ImageAltText + i, src); i--; } BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().ClickImage(ImageAltText + 2); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifySelectedImageOverlayTemplate(ImageAltText + 2); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyPreviousAndNextImageArrowsOverlayTemplate(); var scr = this.GetImageSource(false, this.imageTitles[1], string.Empty); string url = PageName.ToLower() + scr + "?itemIndex=1"; ActiveBrowser.WaitForUrl("/" + url, true, 60000); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().CloseSelectedImageOverlayTemplate(); ActiveBrowser.WaitForUrl("/" + PageName.ToLower(), true, 60000); }
/// <summary> /// Verifies pages list template on Bootstrap /// </summary> /// <param name="listTitle">list title</param> /// <param name="listItemsToVerify">list items to be verified</param> public void VerifyPagesListTemplateOnBootstrap(string listTitleToVerify, Dictionary <string, string> listItemsToVerify) { //// verify list title HtmlContainerControl listTitle = this.EM.Lists.PagesListFrontend.ListTitleLabel.AssertIsPresent("list title"); Assert.AreEqual(listTitleToVerify, listTitle.InnerText, "list title"); //// verify unordered list of links HtmlUnorderedList listItemLinks = this.EM.Lists.PagesListFrontend.ListItemsUnorderedList.AssertIsPresent("unordered list of list items"); Assert.AreEqual(listItemLinks.Items.Count(), listItemsToVerify.Count, "Expected and actual count of list items are not equal"); for (int i = 0; i < listItemsToVerify.Count; i++) { Assert.AreEqual(listItemsToVerify.Keys.ElementAt(i), listItemLinks.Items[i].InnerText, "list item title"); Assert.IsTrue(listItemLinks.Items[i].ChildNodes[0].TagName.Equals("a")); //// verify details of list item listItemLinks.Items[i].ChildNodes[0].As <HtmlAnchor>().Click(); ActiveBrowser.WaitForUrl("/lists/", true); HtmlDiv listItemDetails = this.EM.Lists.PagesListFrontend.ListItemsDivOnBootstrap.AssertIsPresent("list item details"); Assert.AreEqual(listItemsToVerify.Keys.ElementAt(i), listItemDetails.ChildNodes[0].InnerText, "list item title in details"); Assert.AreEqual(listItemsToVerify.Values.ElementAt(i), listItemDetails.ChildNodes[2].InnerText, "list item content in details"); //// go back to the main list page ActiveBrowser.GoBack(); } }
public void SelectVideosFromSelectedLibraryInSelectedPage() { BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectRadioButtonOption(WidgetDesignerRadioButtonIds.SelectedLibrariesOnly); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ClickSelectButton(); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInHierarchicalSelector(ChildVideoLibrary); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().DoneSelecting(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifySelectedItemsFromHierarchicalSelector(new string[] { LibraryName + " > " + ChildVideoLibrary }); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SwitchToSingleItemSettingsTab(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectRadioButtonOption(WidgetDesignerRadioButtonIds.ExistingPage); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ClickSelectButton(); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInHierarchicalSelector(SingleItemPage); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().DoneSelecting(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifySelectedItemsFromHierarchicalSelector(new string[] { SingleItemPage }); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges(); for (int i = 1; i <= 4; i++) { if (i <= 2) { BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageIsNotPresent(VideoBaseTitle + i); } else { string src = this.GetVideoSource(VideoBaseTitle + i, ImageType); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageThumbnail(VideoBaseTitle + i, src); } } BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); for (int i = 1; i <= 4; i++) { if (i <= 2) { BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImageIsNotPresent(VideoAltText + i); } else { var src = this.GetVideoSource(VideoBaseTitle + i, ImageType); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImage(VideoAltText + i, src); } } BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().ClickImage(VideoAltText + 3); var scr = this.GetVideoSource(VideoBaseTitle + 3, string.Empty); string url = SingleItemPage.ToLower() + scr; ActiveBrowser.WaitForUrl("/" + url, true, 60000); Assert.IsTrue(BATFeather.Wrappers().Frontend().VideoGallery().VideoGalleryWrapper().IsVideoTitlePresentOnDetailMasterPage(VideoBaseTitle + 3)); scr = this.GetVideodHref(VideoBaseTitle); BATFeather.Wrappers().Frontend().VideoGallery().VideoGalleryWrapper().VerifyVideo(scr); }
/// <summary> /// Click search link /// </summary> /// <param name="resultPageUrl">results page URL</param> public void ClickSearchLink(string resultsPageUrl) { HtmlAnchor searchButton = this.EM.Search.SearchFrontend.SearchLink.AssertIsPresent("Search link"); searchButton.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForUrl(resultsPageUrl); ActiveBrowser.WaitForAsyncJQueryRequests(); }
public void ImageWidgetInsertImageWithCustomThumbnail() { 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, 0, true); BATFeather.Wrappers().Backend().Media().MediaSelectorWrapper().PressCancelButton(); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName, 0, true); BATFeather.Wrappers().Backend().Media().MediaSelectorWrapper().WaitForContentToBeLoaded(false); BATFeather.Wrappers().Backend().Media().MediaSelectorWrapper().SelectMediaFile(ImageName); BATFeather.Wrappers().Backend().Media().MediaSelectorWrapper().ConfirmMediaFileSelectionInWidget(); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().WaitUntilImageIsLoaded(); Assert.IsTrue(BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().IsTitlePopulated(ImageName), "Image title is not populated correctly"); Assert.IsTrue(BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().IsImageAltTextPopulated(ImageAltText1), "Image alt text is not populated correctly"); string scr = this.GetImageSource(true, ImageName, ImageTypeInPropertiesDialog); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().VerifyImageThumbnailInPropertiesDialog(ImageName, scr); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().VerifySelectedOptionThumbnailSelector(ThumbnailOption); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().EnterTitle(NewImageName); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().EnterImageAltText(NewImageAltText); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().ConfirmMediaPropertiesInWidget(); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName, 0, true); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().WaitUntilImageIsLoaded(); Assert.IsTrue(BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().IsTitlePopulated(NewImageName), "Image title is not populated correctly"); Assert.IsTrue(BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().IsImageAltTextPopulated(NewImageAltText), "Image alt text is not populated correctly"); scr = this.GetImageSource(true, ImageName, ImageTypeInPropertiesDialog); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().VerifyImageThumbnailInPropertiesDialog(ImageName, scr); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().SelectOptionThumbnailSelector("Custom size..."); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().SelectResizeImageOption("Crop to area"); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().SelectResizeImageOption("Resize to area"); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().VerifyWidthIsRequiredMessage(); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().VerifyHeightIsRequiredMessage(); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().EnterWidth("111"); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().EnterHeight("111"); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().SelectQualityOption("Medium"); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().DoneResizing(); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().VerifySelectedOptionThumbnailSelector(NewThumbnailOption); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().ClickThisImageIsALink(); BATFeather.Wrappers().Backend().Media().ImagePropertiesWrapper().ConfirmMediaPropertiesInWidget(); string src = this.GetImageSource(false, ImageName, ImageType); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageThumbnail(NewImageAltText, src); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageResizingProperties(NewImageAltText, "MaxWidth=111", "MaxHeight=111", "Quality=Medium", "Method=ResizeFitToAreaArguments"); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); scr = this.GetImageSource(false, ImageName, ImageType); BATFeather.Wrappers().Frontend().MediaWidgets().MediaWidgetsWrapper().VerifyImage(NewImageName, NewImageAltText, scr); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().ClickImage(NewImageAltText); ActiveBrowser.WaitForUrl(scr + "?sfvrsn=0", true, 10000); }
/// <summary> /// Click search button /// </summary> /// <param name="resultPageUrl">results page URL</param> public void ClickSearchButton(string resultsPageUrl) { 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(); }
/// <summary> /// Click tag title on the frontend /// </summary> /// <param name="tagTitle">The tag title</param> public void ClickTagTitle(string tagTitle) { HtmlDiv frontendPageMainDiv = BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent(); HtmlAnchor tagsAnchor = frontendPageMainDiv.Find .ByExpression <HtmlAnchor>("tagname=a", "InnerText=" + tagTitle) .AssertIsPresent("Tag with this title was not found"); tagsAnchor.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForUrl(tagTitle.ToLower().Replace(" ", "%20")); }
public void SelectDocumentsFromSelectedLibraryInSelectedPage() { BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectRadioButtonOption(WidgetDesignerRadioButtonIds.selectedLibrariesOnly); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ClickSelectButton(); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInHierarchicalSelector(ChildDocumentLibrary); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().DoneSelecting(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifySelectedItemsFromHierarchicalSelector(new string[] { LibraryName + " > " + ChildDocumentLibrary }); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SwitchToSingleItemSettingsTab(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectRadioButtonOption(WidgetDesignerRadioButtonIds.existingPage); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ClickSelectButton(); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().SelectItemsInHierarchicalSelector(SingleItemPage); BATFeather.Wrappers().Backend().Widgets().SelectorsWrapper().DoneSelecting(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifySelectedItemsFromHierarchicalSelector(new string[] { SingleItemPage }); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges(); for (int i = 1; i <= 4; i++) { if (i == 1 || i == 4) { BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocumentIsNotPresent(DocumentBaseTitle + i); } else { BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocument(DocumentBaseTitle + i, this.GetDocumentHref(true, DocumentBaseTitle + i, SingleItemPage.ToLower() + "/" + ContentType)); } } BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); for (int i = 1; i <= 4; i++) { if (i == 1 || i == 4) { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentIsNotPresent(DocumentBaseTitle + i); } else { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocument(DocumentBaseTitle + i, this.GetDocumentHref(true, DocumentBaseTitle + i, SingleItemPage.ToLower() + "/" + ContentType)); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(true, DocumentBaseTitle + i, ContentType)); } } BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().ClickDocument(SelectedDocument); ActiveBrowser.WaitForUrl(this.GetDocumentHref(false, SelectedDocument, SingleItemPage.ToLower() + "/" + ContentType), true, 60000); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().IsDocumentTitlePresentOnDetailMasterPage(SelectedDocument); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(true, SelectedDocument, ContentType)); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifySizeOnHybridPage("5 KB"); }
/// <summary> /// Navigate to existing page in frontend. Search for a widget that should not be present on the screen /// </summary> /// <param name="elementTitle"></param> Title of the widget public void VerifyFrontendForNotExistingModule(string elementTitle, string pageName, string culture) { //Navigate to Frontend and verify that the news is not visible BAT.Macros().NavigateTo().CustomPage("~/" + pageName, true, culture); ActiveBrowser.WaitForUrl("/" + pageName, true); ActiveBrowser.Window.SetFocus(); ActiveBrowser.WaitUntilReady(); Manager.ActiveBrowser.RefreshDomTree(); HtmlDiv pageContainer = ActiveBrowser.Find.ByExpression <HtmlDiv>("id=PublicWrapper") .AssertIsPresent("Page Container"); Assert.IsFalse(pageContainer.InnerText.Contains(elementTitle), "The module exists and it should not"); ActiveBrowser.WaitUntilReady(); }
/// <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); }
/// <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> /// 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(); }
/// <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(); }
public void SelectAllPublishedVideosWithOverlayGalleryTemplate() { BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SwitchToListSettingsTab(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectOptionInListTemplateSelector(OverlayGalleryTemplate); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges(); foreach (var video in this.videoTitles) { string src = this.GetVideoSource(video, ImageType); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageThumbnail(video, src); } BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); int i = 3; foreach (var image in this.videoTitles) { var src = this.GetVideoSource(image, ImageType); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImage(ImageAltText + i, src); i--; } BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().ClickImage(ImageAltText + 2); var scr = this.GetVideoSource(this.videoTitles[1], VideoType); BATFeather.Wrappers().Frontend().VideoGallery().VideoGalleryWrapper().VerifySelectedVideoOverlayTemplate(scr); BATFeather.Wrappers().Frontend().VideoGallery().VideoGalleryWrapper().VerifyPreviousAndNextVideoArrowsOverlayTemplate(); scr = this.GetVideoSource(this.videoTitles[1], string.Empty); string url = PageName.ToLower() + scr; ActiveBrowser.WaitForUrl("/" + url, true, 60000); BATFeather.Wrappers().Frontend().VideoGallery().VideoGalleryWrapper().CloseSelectedVideoOverlayTemplate(); ActiveBrowser.WaitForUrl("/" + PageName.ToLower(), true, 60000); }
public void SelectAllPublishedDocuments() { BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(WidgetName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifyCheckedRadioButtonOption(WidgetDesignerRadioButtonIds.allPublished); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().ExpandNarrowSelectionByArrow(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifyCheckedRadioButtonOption(WidgetDesignerRadioButtonIds.allItems); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SwitchToListSettingsTab(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifyCheckedRadioButtonOption(WidgetDesignerRadioButtonIds.usePaging); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SwitchToSingleItemSettingsTab(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().VerifyCheckedRadioButtonOption(WidgetDesignerRadioButtonIds.samePage); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges(); foreach (var doc in this.documentTitles) { BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocument(doc, this.GetDocumentHref(true, doc, PageName + "/" + ContentType)); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocumentIconOnTemplate(DocumentType); } BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture); foreach (var doc in this.documentTitles) { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocument(doc, this.GetDocumentHref(true, doc, PageName + "/" + ContentType)); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(true, doc, ContentType)); } BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyCorrectOrderOfDocuments(this.documentTitles); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentIconOnTemplate(DocumentType); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().ClickDocument(SelectedDocument); ActiveBrowser.WaitForUrl(this.GetDocumentHref(false, SelectedDocument, PageName + "/" + ContentType), true, 60000); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().IsDocumentTitlePresentOnDetailMasterPage(SelectedDocument); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(true, SelectedDocument, ContentType)); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifySizeAndExtensionOnTemplate("5 KB", "(" + DocumentType + ")"); }
public void SelectAllPublishedImagesWithThumbnailStripTemplate_Foundation() { this.SelectListTemplateInImageGalleryDesigner(FoundationTemplate, ThumbnailStripTemplate); string src = this.GetImageSource(false, this.imageTitles[0], ImageOriginalType); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageThumbnail(this.imageTitles[0], src); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyThumbnailStripTemplateInfo("1of 3", this.imageTitles[0]); for (int j = 1; j <= 2; j++) { src = this.GetImageSource(false, this.imageTitles[j], ImageType); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyImageThumbnail(this.imageTitles[j], src); } BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyThumbnailStripTemplateInfo("1of 3", this.imageTitles[0]); src = this.GetImageSource(false, this.imageTitles[0], ImageOriginalType); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImage(ImageAltText + 3, src); for (int i = 1; i <= 2; i++) { src = this.GetImageSource(false, this.imageTitles[i], ImageType); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImage(ImageAltText + (3 - i), src); } BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().ClickImage(ImageAltText + 2); src = this.GetImageSource(false, this.imageTitles[1], ImageOriginalType); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyImage(ImageAltText + 2, src); BATFeather.Wrappers().Frontend().ImageGallery().ImageGalleryWrapper().VerifyThumbnailStripTemplateInfo("2of 3", this.imageTitles[1]); var scr = this.GetImageSource(false, this.imageTitles[1], string.Empty); string url = PageName.ToLower() + scr; ActiveBrowser.WaitForUrl("/" + url, true, 60000); }
public void NavigationWidgetAllPagesUnderCurrentlyOpenedPage() { string pageTemplateName = "Bootstrap.default"; string navTemplateClass = "nav navbar-nav"; BAT.Macros().User().EnsureAdminLoggedIn(); BAT.Arrange(this.ArrangementClass).AddParameter("templateName", pageTemplateName).ExecuteSetUp(); BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().SelectNavigationWidgetDisplayMode(NavWidgetDisplayMode); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().SaveChanges(); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); BAT.Wrappers().Frontend().Navigation().NavigationFrontendWrapper().VerifyPagesNotPresentFrontEndNavigation(navTemplateClass, this.ParentPages); BATFeather.Wrappers().Frontend().Navigation().NavigationWrapper().VerifyNavigationOnThePageFrontend(navTemplateClass, this.ChildPages); BAT.Wrappers().Frontend().Navigation().NavigationFrontendWrapper().SelectPageFromNavigationByText(navTemplateClass, ChildPage1); ActiveBrowser.WaitForUrl("/" + ChildPage1.ToLower(), true, 60000); }
/// <summary> /// Clicks on a page link from the Mvc navigation on the frontend. /// </summary> /// <param name="pageTitle">The page title.</param> public void ClickOnPageLinkFromNavigationMenu(string pageTitle, TemplateType templateType, string cssClass, bool isParentPage = true) { HtmlAnchor pageLink = null; switch (templateType) { case TemplateType.Bootstrap: pageLink = this.GetPageLinkByTitleFromBootstrapNavigation(cssClass, pageTitle); break; case TemplateType.Foundation: pageLink = this.GetPageLinkByTitleFromFoundationNavigation(cssClass, pageTitle); break; case TemplateType.Semantic: pageLink = this.GetPageLinkByTitleFromSemanticNavigation(cssClass, pageTitle, isParentPage); break; } pageLink.Click(); ActiveBrowser.WaitForUrl("/" + pageTitle.ToLower(), true, TimeOut); ActiveBrowser.WaitUntilReady(); }
public void SelectSortedDocumentsInTableView() { BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectRadioButtonOption(WidgetDesignerRadioButtonIds.CurrentlyOpenLibrary); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SwitchToListSettingsTab(); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectOptionInSortingSelector("Title ASC"); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SelectOptionInListTemplateSelector("DocumentsTable"); BATFeather.Wrappers().Backend().Widgets().WidgetDesignerWrapper().SaveChanges(); BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyCorrectOrderOfDocumentsInTableView(DocumentBaseTitle + 1, DocumentBaseTitle + 2, DocumentBaseTitle + 3); foreach (var doc in this.documentTitles) { if (doc.Equals("Document1")) { BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocumentInTableView(doc, this.GetDocumentHref(doc, PageName + "/" + ContentType, LibraryName.ToLower()), this.Culture); } else { BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocumentInTableView(doc, this.GetDocumentHref(doc, PageName + "/" + ContentType, AnotherDocumentLibraryTitle.ToLower()), this.Culture); } } BATFeather.Wrappers().Backend().Pages().PageZoneEditorMediaWrapper().VerifyDocumentIconOnTemplate(DocumentType, true); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyCorrectOrderOfDocumentsInTableView(DocumentBaseTitle + 1, DocumentBaseTitle + 2, DocumentBaseTitle + 3); foreach (var doc in this.documentTitles) { if (doc.Equals("Document1")) { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentInTableView(doc, this.GetDocumentHref(doc, PageName + "/" + ContentType, LibraryName.ToLower())); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(doc, ContentType, LibraryName)); } else { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentInTableView(doc, this.GetDocumentHref(doc, PageName + "/" + ContentType, AnotherDocumentLibraryTitle.ToLower())); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(doc, ContentType, AnotherDocumentLibraryTitle)); } } BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentIconOnTemplate(DocumentType, true); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().ClickDocument(SelectedDocument); ActiveBrowser.WaitForUrl(this.GetDocumentHref(SelectedDocument, PageName + "/" + ContentType, AnotherDocumentLibraryTitle), true, 60000); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().IsDocumentTitlePresentOnDetailMasterPage(SelectedDocument); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDownloadButton(this.GetDownloadHref(SelectedDocument, ContentType, AnotherDocumentLibraryTitle)); BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifySizeAndExtensionOnTemplate("5 KB", "(" + DocumentType + ")"); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower() + "/" + AnotherDocumentLibraryTitle.ToLower(), false, this.Culture); for (int j = 1; j <= 3; j++) { if (j == 1) { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentIsNotPresent(DocumentBaseTitle + j); } else { BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyDocumentInTableView(DocumentBaseTitle + j, this.GetDocumentHref(DocumentBaseTitle + j, PageName + "/" + ContentType, AnotherDocumentLibraryTitle.ToLower())); } } BATFeather.Wrappers().Frontend().DocumentsList().DocumentsListWrapper().VerifyCorrectOrderOfDocumentsInTableView(DocumentBaseTitle + 2, DocumentBaseTitle + 3); }