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(); }
/// <summary> /// Enable social share buttons /// </summary> /// <param name="isEnabled">Is social share buttons enabled</param> public void EnableSocialShareButtons(string isEnabled) { HtmlInputText input = EM.GenericContent .ContentBlockWidget .EnableSocialSharing .AssertIsPresent("Social share field"); input.Wait.ForExists(); input.ScrollToVisible(); input.Focus(); input.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); ActiveBrowser.WaitForAsyncOperations(); Manager.Current.Desktop.KeyBoard.TypeText(isEnabled); }
public void AddWidgetToPageBasedOnLayoutWithMultiplePlaceholders() { RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/sitefinity/pages", true, null, new HtmlFindExpression("class=~sfMain"))); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageTitle); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().DragAndDropWidgetToPlaceholder(WidgetCaption, FirstPlaceHolderId); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().DragAndDropWidgetToPlaceholder(WidgetCaption, SecondPlaceHolderId); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetCaption, dropZoneIndex: 0); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().SetTextDummyWidget(FirstWidgetText); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().ClickSaveButton(); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetCaption, dropZoneIndex: 1); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().SetTextDummyWidget(SecondWidgetText); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().ClickSaveButton(); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageTitle.ToLower(), false); Assert.IsTrue(ActiveBrowser.ContainsText(FirstWidgetText)); Assert.IsTrue(ActiveBrowser.ContainsText(SecondWidgetText)); }
public void AddWidgetToPageBasedOnLayoutWithMultiplePlaceholders() { BAT.Macros().NavigateTo().Pages(); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageTitle); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().DragAndDropWidgetToPlaceholder(WidgetCaption, FirstPlaceHolderId); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().DragAndDropWidgetToPlaceholder(WidgetCaption, SecondPlaceHolderId); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetCaption, dropZoneIndex: 0); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().SetTextDummyWidget(FirstWidgetText); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().ClickSaveButton(); BATFrontend.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetCaption, dropZoneIndex: 1); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().SetTextDummyWidget(SecondWidgetText); BATFrontend.Wrappers().Backend().Widgets().WidgetsWrapper().ClickSaveButton(); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().PublishPage(); BAT.Macros().NavigateTo().CustomPage("~/" + PageTitle.ToLower(), false); Assert.IsTrue(ActiveBrowser.ContainsText(FirstWidgetText)); Assert.IsTrue(ActiveBrowser.ContainsText(SecondWidgetText)); }
/// <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); }
public void GoToStu() { String bbaseUrl = Settings.Current.Web.BaseUrl.ToString(); if ((bbaseUrl.Contains("dade.acceliqc.com"))) { Utility.currentDomain = "qc"; } else if (bbaseUrl.Contains("miami-demo.accelidemo.com")) { Utility.currentDomain = "demo"; } else if (bbaseUrl.Contains("dade-pilot.acceliplan.com")) { Utility.currentDomain = "pilot"; } else if (bbaseUrl.Contains("dade-training.acceliplan.com")) { Utility.currentDomain = "training"; } else if (bbaseUrl.Contains("dadematrix.acceliplan.com")) { Utility.currentDomain = "dade_matrix"; } else if (bbaseUrl.Contains("daderesearch.acceliplan.com")) { Utility.currentDomain = "research"; } else if (bbaseUrl.Contains("dade.acceliplan.com")) { Utility.currentDomain = "prod"; } String address = ("/Plan/Students"); Console.Out.WriteLine(address); ActiveBrowser.NavigateTo(Settings.Current.Web.BaseUrl + address, true); }
public void CommonBrowserMethods() { Manager.LaunchNewBrowser(); ActiveBrowser.NavigateTo(Path.Combine(TestContext.TestDeploymentDir, TESTPAGE)); // NOTE: // // The default settings for Browser.AutoDomRefresh & // Browser.AutoWaitUntilReady is True. This means that the Browser object // will wait for the browser to be ready after each action (AutoWaitUntilReady) // and will ensure that the Browser.DomTree is up to date after // each action on the page (AutoDomRefresh) by calling Browser.RefreshDomTree(). // The only exception to this are action performed using the Desktop object against // the browser. In this case, if these actions change the page DOM then you need // explicitly call Browser.WaitUntilReady() and Browser.RefreshDomTree() if needed too. // Get the element before any changes are made to the DOM. Element h1 = this.Elements.GetHtml("label"); Assert.IsTrue(h1.InnerText.Contains("EMPTY")); // Make sure the browser window has focus ActiveBrowser.Window.SetFocus(); // Invoke a hover over action using pure mouse move. Desktop.Mouse.HoverOver(h1.GetRectangle()); // Wait for the change to be complete. ActiveBrowser.WaitUntilReady(); // Refresh the DomTree with the latest changes. ActiveBrowser.RefreshDomTree(); // Update this Element object with the latest DOM changes. h1.Refresh(); Assert.IsTrue(h1.InnerText.Contains("FULL")); // Close this browser window. ActiveBrowser.Close(); }
public void ChangeAdvancedSettingsOfCaptchaFieldAndSetCssClass() { 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(Captcha); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncOperations(); ActiveBrowser.RefreshDomTree(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ApplyCssClasses(CssClassesToApply); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncOperations(); ActiveBrowser.RefreshDomTree(); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); Assert.IsTrue(ActiveBrowser.ContainsText(CssClassesToApply), "Css class was not found on the page"); 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(Captcha); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncOperations(); ActiveBrowser.RefreshDomTree(); BATFeather.Wrappers().Backend().ModuleBuilder().DynamicWidgetAdvancedSettingsWrapper().ClickAdvancedSettingsButton(); BATFeather.Wrappers().Backend().ModuleBuilder().DynamicWidgetAdvancedSettingsWrapper().ClickModelButton(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ChangeCssClassInAdvancedSettings(CssClassesToApplyNew); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncOperations(); ActiveBrowser.RefreshDomTree(); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); Assert.IsTrue(ActiveBrowser.ContainsText(CssClassesToApplyNew), "Css class was not found on the page"); }
public void Slider_DataBinding() { string minimumValue = TestContext.DataRow["MinimumValue"].ToString(); string maximumValue = TestContext.DataRow["MaximumValue"].ToString(); string selectionStart = TestContext.DataRow["SelectionStart"].ToString(); string selectionEnd = TestContext.DataRow["SelectionEnd"].ToString(); string expectedSliderStart = TestContext.DataRow["ExpectedSliderStart"].ToString(); string expectedSliderEnd = TestContext.DataRow["ExpectedSliderEnd"].ToString(); string configuratorId = "ctl00_ConfiguratorPlaceholder_ConfigurationPanel1"; Manager.LaunchNewBrowser(); Manager.ActiveBrowser.Window.Maximize(); ActiveBrowser.NavigateTo("http://demos.telerik.com/aspnet-ajax/slider/examples/clientsideapi/defaultcs.aspx"); HtmlDiv configurator = Find.ByAttributes <HtmlDiv>("class=panel configurator"); //Find.ByAttributes<HtmlDiv>("class=demo-containers").ScrollToVisible(); Manager.ActiveBrowser.ScrollBy(0, 150); Find.ById <HtmlInputText>(configuratorId + "_SmallChangeNtb").MouseClick(); Find.ById <HtmlInputText>(configuratorId + "_SmallChangeNtb").Value = "1"; Find.ById <HtmlInputText>(configuratorId + "_MinValueNtb").MouseClick(); Find.ById <HtmlInputText>(configuratorId + "_MinValueNtb").Value = minimumValue; Find.ById <HtmlInputText>(configuratorId + "_MaxValueNtb").MouseClick(); Find.ById <HtmlInputText>(configuratorId + "_MaxValueNtb").Value = maximumValue; Find.ById <HtmlInputText>(configuratorId + "_SelectionStartNtb").MouseClick(); Find.ById <HtmlInputText>(configuratorId + "_SelectionStartNtb").Value = selectionStart; Find.ById <HtmlInputText>(configuratorId + "_SelectionEndNtb").MouseClick(); Find.ById <HtmlInputText>(configuratorId + "_SelectionEndNtb").Value = selectionEnd; Find.ById <HtmlInputText>(configuratorId + "_SelectionStartNtb").MouseClick(); RadSlider slider = Find.ById <RadSlider>("RadSliderWrapper_ctl00_ContentPlaceholder1_RadSlider1"); Assert.AreEqual(expectedSliderStart, slider.SelectionStart.ToString()); Assert.AreEqual(expectedSliderEnd, slider.SelectionEnd.ToString()); }
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); }
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 Step_1_Random_Word_Extract_and_write_to_Excel_CodedStep() { string dataSourcePath = this.ExecutionContext.DeploymentDirectory + @"\Data\domainResults.xlsx"; string myPath = "C:\\My Documents\\Test Studio Projects\\Data Dancing\\Data\\domainResults.xlsx"; if (!System.IO.File.Exists(myPath)) { System.IO.File.Copy(dataSourcePath, myPath); } Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel.Workbook workbook = excelApp.Workbooks.Open(myPath); System.Threading.Thread.Sleep(1000); ActiveBrowser.RefreshDomTree(); //if (ActiveBrowser.ContainsText("Unavailable")) { excelApp.Cells[Data.IterationIndex + 3, 3] = Data["RandomWord1"]; // excelApp.Cells[Data.IterationIndex + 2 , 3] = Data["RandomWord1"]; //excelApp.Cells[2 , 1] = "Registered"; } //if (ActiveBrowser.ContainsText("is available")) //{ // excelApp.Cells[Data.IterationIndex + 2 , 1] = "Available"; //excelApp.Cells[2 , 1] = "Available"; //} excelApp.Visible = true; excelApp.ActiveWorkbook.Save(); workbook.Close(false, Type.Missing, Type.Missing); excelApp.Workbooks.Close(); System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook); excelApp.Quit(); GC.Collect(); System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp); }
/// <summary> /// Gets the widget by name /// </summary> /// <param name="widgetLabelName">The widget label name</param> /// <returns>Returns the widget div</returns> public HtmlDiv GetWidgetByName(string widgetLabelName) { ActiveBrowser.RefreshDomTree(); RadPanelBar toolbox = Manager.Current.ActiveBrowser.Find.ByExpression <RadPanelBar>("id=~ControlToolboxContainer"); foreach (var item in toolbox.AllItems) { var dockZone = item.Find.ByCustom <RadDockZone>(zone => zone.CssClass.Contains("RadDockZone")); var widgetLabel = dockZone.Find.ByContent(widgetLabelName); if (widgetLabel != null) { if (!item.Expanded) { item.Expand(); } return(new HtmlDiv(widgetLabel.Parent)); } } Assert.IsNotNull(null, "The widget with name: " + widgetLabelName); return(null); }
public void UsingBaseUrl() { string testServerPath = @"TestServer\"; string deploymentServerPath = @"DeploymentServer\"; // NOTE: In typical test environments this setting should be set in config. We are setting // it here in the code for the sake of illustrating this feature. Manager.LaunchNewBrowser(); // Set the BaseUrl to be test server Manager.Settings.Web.BaseUrl = Path.Combine(TestContext.TestDeploymentDir, testServerPath); ActiveBrowser.NavigateTo("/default.html"); Assert.IsTrue(ActiveBrowser.ViewSourceString.Contains("TestServer")); // Switch to the deployment server Manager.Settings.Web.BaseUrl = Path.Combine(TestContext.TestDeploymentDir, deploymentServerPath); ActiveBrowser.NavigateTo("/default.html"); Assert.IsTrue(ActiveBrowser.ViewSourceString.Contains("deployment")); }
/// <summary> /// Edit content block /// </summary> public void EditContentBlock() { HtmlDiv cb = ActiveBrowser.Find.ByCustom <HtmlDiv>(x => x.CssClass.Contains("sfFieldEditable")) .AssertIsPresent("ContentBlock"); cb.Focus(); cb.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.RefreshDomTree(); cb.MouseClick(); ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.Find.ByCustom <HtmlUnorderedList>(e => e.CssClass.Contains("k-editor-toolbar") && e.IsVisible() == true) .AssertIsPresent("toolbar"); Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.LControlKey); Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.LControlKey); Manager.Desktop.KeyBoard.TypeText("edited content block", 20); }
private bool IsCountOfMediaFilesCorrect(int expectedCount, string mediaType) { ActiveBrowser.RefreshDomTree(); int divsCount = 0; switch (mediaType) { case "images": divsCount = this.EM.Media.MediaSelectorScreen.ImageFileDivs.Count; break; case "docs": divsCount = this.EM.Media.MediaSelectorScreen.DocFileDivs.Count; break; case "videos": divsCount = this.EM.Media.MediaSelectorScreen.VideoFileDivs.Count; break; } return(expectedCount == divsCount); }
public void UsingFindExpressionAttributeWithTestRegions() { Manager.LaunchNewBrowser(); ActiveBrowser.NavigateTo(Path.Combine(TestContext.TestDeploymentDir, TESTPAGE)); // FindExpression attributes can be associated to a specific TestRegion. // When a TestRegionId is specified, only the Find object off that region // object can be used to access that element. The search will be scoped // to that region also. // Two FindExpression attribues are defined on this method. Both point to the // same element on the page. // The first is generic can be accessed using the ActiveBrowser.Find object. // The second can be accessed only using the ProgramsTable.Find object. TestRegion ProgramsTable = ActiveBrowser.Regions["ProgramsTable"]; // Contains only the element defined and scoped to "ProgramsTable"; Assert.IsTrue(this.Elements.GetHtml("progtbl").Equals(this.Elements.GetHtml("progtbltr"))); // Note: You can also use the FindAttribute(fileName) and scope all // the elements contained in file to a specific testregion. }
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); }
/// <summary> /// Gets the feather Mvc widget. /// </summary> /// <param name="mvcWidgetName">feather mvc widget name</param> /// <returns>The Mvc widget div element.</returns> public HtmlDiv GetMvcWidget(string mvcWidgetName) { ActiveBrowser.RefreshDomTree(); RadPanelBar toolbox = Manager.Current.ActiveBrowser.Find.ById <RadPanelBar>("~ControlToolboxContainer"); foreach (var item in toolbox.AllItems) { var dockZone = item.Find.ByCustom <RadDockZone>(zone => zone.CssClass.Contains("RadDockZone")); var mvcWidgetLabel = dockZone.Find.ByExpression("class=~sfMvcIcn", "InnerText=" + mvcWidgetName); if (mvcWidgetLabel != null) { if (!item.Expanded) { item.Expand(); } return(new HtmlDiv(mvcWidgetLabel.Parent)); } } return(null); }
public void ControllingBrowserInstance() { Manager.LaunchNewBrowser(); ActiveBrowser.NavigateTo(Path.Combine(TestContext.TestDeploymentDir, TESTPAGE)); Assert.IsTrue(ActiveBrowser.Url.Contains("Browser.htm")); // Now navigate to www.google.com ActiveBrowser.NavigateTo("http://www.bing.com"); Assert.IsTrue(ActiveBrowser.Url.Contains("bing.com")); // Now go back. ActiveBrowser.GoBack(); Assert.IsTrue(ActiveBrowser.Url.Contains("Browser.htm")); // Now go forward ActiveBrowser.GoForward(); Assert.IsTrue(ActiveBrowser.Url.Contains("bing.com")); // Do a Refresh() ActiveBrowser.Refresh(); Assert.IsTrue(ActiveBrowser.Url.Contains("bing.com")); }
/// <summary> /// Click select button /// </summary> /// <param name="selectButtonNumber">select button number among all select buttons starting from 0</param> public void ClickSelectButton(int selectButtonNumber) { Manager.Wait.For(() => { ActiveBrowser.RefreshDomTree(); var buttons = EM.Widgets.WidgetDesignerContentScreen.SelectButtons; return(buttons.Count > selectButtonNumber && buttons.ElementAt(selectButtonNumber).IsVisible()); }, 10000); var selectButtons = EM.Widgets.WidgetDesignerContentScreen.SelectButtons; Assert.IsNotNull(selectButtons); Assert.IsTrue(selectButtons.Count != 0, "no select numbers found"); Assert.IsTrue(selectButtonNumber < selectButtons.Count, "number is higher than the length of buttons list"); var selectButton = selectButtons.ElementAt(selectButtonNumber); Assert.IsTrue(selectButton.IsVisible()); selectButton.Click(); ActiveBrowser.WaitForAsyncOperations(); }
public void AddContentBlockWidgetToTemplateBasedOnLayoutFile() { RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/sitefinity/design/pagetemplates", false, this.Culture)); RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().User().EnsureAdminLoggedIn()); BAT.Macros().NavigateTo().Design().PageTemplates(this.Culture); BAT.Wrappers().Backend().PageTemplates().PageTemplateMainScreen().OpenTemplateEditor(TemplateTitle); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().SwitchEditorLayoutMode(EditorLayoutMode.Layout); BAT.Wrappers().Backend().Pages().PageLayoutEditorWrapper().SelectAnotherTemplate(); BAT.Wrappers().Backend().Pages().SelectTemplateWrapper().SelectATemplate("Bootstrap.default"); BAT.Wrappers().Backend().Pages().SelectTemplateWrapper().ClickDoneButton(); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().AddWidgetToPlaceHolderPureMvcMode(WidgetName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(WidgetName); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().FillContentToContentBlockWidget(ContentBlockContent); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BAT.Wrappers().Backend().PageTemplates().PageTemplateModifyScreen().PublishTemplate(); BAT.Arrange(this.TestName).ExecuteArrangement("GetTemplateId"); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), false, this.Culture); Assert.IsFalse(ActiveBrowser.ContainsText(ServerErrorMessage), "Server error was found on the page"); Assert.IsTrue(ActiveBrowser.ContainsText(ContentBlockContent), "Content block content was not found on the page"); }
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 ChooseUrl_IEP() { String bbaseUrl = Settings.Current.Web.BaseUrl.ToString(); String studentID = "0"; if ((bbaseUrl.Contains("miami.acceliqc.com"))) { studentID = "4891384"; } else if (bbaseUrl.Contains("miami-demo.accelidemo.com")) { studentID = "14"; } else if (bbaseUrl.Contains("dade-pilot.acceliplan.com")) { studentID = "786907"; } String address = "/Plan/Students/ViewStudent?CommonStudentId=" + studentID + "&studentViewType=Events&programType=MiamiIEP"; ActiveBrowser.NavigateTo(Settings.Current.Web.BaseUrl + address, true); }
public void VerifyHeaderAndFooter() { BAT.Macros().NavigateTo().Modules().Forms(this.Culture); BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FormName); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().AddField(ContentBlock, Header); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(ContentBlock); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().FillContentToContentBlockWidget(Header); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().AddField(ContentBlock, Footer); ActiveBrowser.WaitUntilReady(); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(ContentBlock, 1); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().FillContentToContentBlockWidget(Footer); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyContentBlockFieldTextIsVisible(Header); BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyContentBlockFieldTextIsVisible(Footer); BATFeather.Wrappers().Frontend().Forms().FormsWrapper().ClickNextButton(); BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyContentBlockFieldTextIsVisible(Header); BATFeather.Wrappers().Frontend().Forms().FormsWrapper().VerifyContentBlockFieldTextIsVisible(Footer); }
public void VerifyRegistrationWidgetAndProfileWidgetOnPreviewHybridPage() { RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().User().EnsureAdminLoggedIn()); RuntimeSettingsModificator.ExecuteWithClientTimeout(800000, () => BAT.Macros().NavigateTo().CustomPage("~/sitefinity/pages", false)); BAT.Macros().NavigateTo().Pages(this.Culture); BAT.Wrappers().Backend().Pages().PagesWrapper().OpenPageZoneEditor(PageTitle); BAT.Wrappers().Backend().Pages().PagesWrapper().PreviewPage(PageTitle, isEditMode: true); ////Verify save changes message for Profile widget in Preview mode BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().ClickButtonByValue("Save changes"); Assert.IsTrue(ActiveBrowser.ContainsText(MessageSaveChangesProfileWidget), "Message was not found on the page"); ////Verify all required fields message for Registration widget in Preview mode BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().ClickButtonByValue("Register"); BATFeather.Wrappers().Frontend().Identity().RegistrationWrapper().AssertEmptyEmailFieldMessage(); BATFeather.Wrappers().Frontend().Identity().RegistrationWrapper().AssertEmptyPasswordFieldMessage(); ////Verify successful message for Registration widget in Preview mode BATFeather.Wrappers().Frontend().Identity().RegistrationWrapper().FillEmail(Email); BATFeather.Wrappers().Frontend().Identity().RegistrationWrapper().FillPassword(Password); BATFeather.Wrappers().Frontend().Identity().RegistrationWrapper().FillRetypePassword(Password); BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().ClickButtonByValue("Register"); ActiveBrowser.WaitForElement("TextContent=~Thank you!"); BATFeather.Wrappers().Frontend().Identity().RegistrationWrapper().VerifySuccessfullyMessage(); }
public void ChangeSubmitButtonTemplate() { 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(SubmitButtonController); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().MoreOptions(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().SelectNewTemplate(TemplateNameFile); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().WaitForFieldContent(TemplateContentFile, SubmitButtonController); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().CheckWidgetContent(SubmitButtonController, TemplateContentFile); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); Assert.IsTrue(BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent().InnerText.Contains(TemplateContentFile), "Template is not presented"); BAT.Macros().NavigateTo().Design().WidgetTemplates(); BATFeather.Wrappers().Backend().WidgetTemplates().WidgetTemplatesWrapper().CreateTemplate(); BATFeather.Wrappers().Backend().WidgetTemplates().WidgetTemplatesCreateScreenFrameWrapper().SelectTemplate("SubmitButton (MVC)"); BATFeather.Wrappers().Backend().WidgetTemplates().WidgetTemplatesCreateScreenFrameWrapper().EnterTextInTextArea(TemplateContent); BATFeather.Wrappers().Backend().WidgetTemplates().WidgetTemplatesCreateScreenFrameWrapper().EnterWidgetTemplateName(TemplateName); BATFeather.Wrappers().Backend().WidgetTemplates().WidgetTemplatesCreateScreenFrameWrapper().CreateThisTemplate(); 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(SubmitButtonController); BATFeather.Wrappers().Backend().Navigation().NavigationWidgetEditWrapper().MoreOptions(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().SelectNewTemplate(TemplateNameNew); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().WaitForFieldContent(TemplateContent, SubmitButtonController); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().CheckWidgetContent(SubmitButtonController, TemplateContent); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); Assert.IsTrue(BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent().InnerText.Contains(TemplateContent), "Template is not presented"); }
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); }
public void DuplicateAndDeleteOfParagraphTextboxField() { BAT.Macros().NavigateTo().Modules().Forms(this.Culture); BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FormName); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(ParagraphTextField); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ApplyCssClasses(CssClassesToApply); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().SelectExtraOptionForWidget(OperationNameDuplicate); BATFeather.Wrappers().Backend().Pages().PageZoneEditorWrapper().EditWidget(ParagraphTextField); BATFeather.Wrappers().Backend().Forms().FormsContentScreenWrapper().ApplyCssClasses(CssClassesToApplyNew); BATFeather.Wrappers().Backend().ContentBlocks().ContentBlocksWrapper().SaveChanges(); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); Assert.IsTrue(ActiveBrowser.ContainsText(CssClassesToApply), "Css class was not found on the page"); Assert.IsTrue(ActiveBrowser.ContainsText(CssClassesToApplyNew), "Css class was not found on the page"); BAT.Macros().NavigateTo().Modules().Forms(this.Culture); BAT.Wrappers().Backend().Forms().FormsDashboard().OpenFormFromTheGrid(FormName); BAT.Wrappers().Backend().Pages().PageZoneEditorWrapper().SelectExtraOptionForWidget(OperationNameDelete); BAT.Wrappers().Backend().Forms().FormsContentScreen().PublishForm(); BAT.Macros().NavigateTo().CustomPage("~/" + PageName.ToLower(), true, this.Culture); Assert.IsTrue(ActiveBrowser.ContainsText(CssClassesToApply), "Css class was not found on the page"); }