public void EditTagControlOfDynamicContentViaInlineEditing(string controlName, string tagName) { this.EditField(controlName); Manager.Current.Wait.For(this.WaitForEditButton, Manager.Current.Settings.ClientReadyTimeout); HtmlAnchor editButton = ActiveBrowser.Find.ByCustom <HtmlAnchor>(e => e.IsVisible() && e.CssClass.Equals("sfShowInlineEditDlgLnk")); editButton.Click(); HtmlDiv workArea = ActiveBrowser.Find .ByCustom <HtmlDiv>(w => w.IsVisible() && w.CssClass.Equals("k-widget k-multiselect k-header")) .AssertIsPresent("Edit tags dialog"); HtmlInputText tagsInput = workArea.Find.ByCssClass <HtmlInputText>("k-input").AssertIsPresent("tags input"); tagsInput.Click(); tagsInput.SimulateTextTyping(tagName); tagsInput.MouseClick(); HtmlListItem tag2 = ActiveBrowser.WaitForElementWithCssClass("k-item k-state-focused") .As <HtmlListItem>().AssertIsPresent("tag2"); tag2.Click(); BAT.Wrappers().Frontend().InlineEditing().DynamicTypes().SelectDoneButtongWhenEditingChoices(); }
/// <summary> /// Navigate to previous year in fast navigation /// </summary> public void NavigatePreviousYearInCalendarSelector() { ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitUntilReady(); var previousYearButton = EM.Events.EventsFrontend.NavigatePreviousInFastNavigation; previousYearButton.AssertIsPresent("Previous year button"); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForElementWithCssClass("k-link k-nav-prev"); previousYearButton.Click(); }
/// <summary> /// Navigate to next year in fast navigation /// </summary> public void NavigateNextYearInCalendarSelector() { ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitUntilReady(); var nextYearButton = EM.Events.EventsFrontend.NavigateNextInFastNavigation; nextYearButton.AssertIsPresent("Next year button"); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForElementWithCssClass("^k-link k-nav-next"); nextYearButton.Click(); }
/// <summary> /// Verifies the tags titles on the frontend page. /// </summary> /// <param name="tagsTitles">The tags titles.</param> /// <returns>true or false depending on tags titles presence on frontend</returns> public bool IsTagsTitlesPresentOnTheFrontendPage(string[] tagsTitles) { ActiveBrowser.WaitForElementWithCssClass("sfPublicWrapper"); HtmlDiv frontendPageMainDiv = BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent(); for (int i = 0; i < tagsTitles.Length; i++) { HtmlAnchor tagsAnchor = frontendPageMainDiv.Find.ByExpression <HtmlAnchor>("tagname=a", "InnerText=" + tagsTitles[i]); if (tagsAnchor == null || !tagsAnchor.IsVisible()) { return(false); } } return(true); }
public void EditCategoryControlOfDynamicContentViaInlineEditing(string controlName, string categoryName) { this.EditField(controlName); HtmlAnchor editButton = ActiveBrowser.Find.ByCustom <HtmlAnchor>(e => e.IsVisible() && e.CssClass.Equals("sfShowInlineEditDlgLnk")); editButton.Click(); HtmlUnorderedList allCats = ActiveBrowser.WaitForElementWithCssClass("k-group k-treeview-lines") .As <HtmlUnorderedList>() .AssertIsPresent("all categories"); HtmlListItem listItem = allCats.Find.ByExpression <HtmlListItem>("InnerText=" + categoryName); var cats = listItem.Find.ByExpression <HtmlInputCheckBox>("tagname=input"); cats.Click(); BAT.Wrappers().Frontend().InlineEditing().DynamicTypes().SelectDoneButtongWhenEditingChoices(); }
/// <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(); cb.InvokeClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitForAsyncJQueryRequests(); ActiveBrowser.WaitForElementWithCssClass("k-editor-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); }
/// <summary> /// Verifies the selected image overlay template. /// </summary> /// <param name="altText">The alt text.</param> public void VerifySelectedImageOverlayTemplate(string altText) { ActiveBrowser.WaitForElementWithCssClass("mfp-img"); ActiveBrowser.Find.ByExpression <HtmlImage>("class=mfp-img", "alt=" + altText) .AssertIsPresent("Overlay image"); }