/// <summary> /// Includes the java script where the widget is dropped. /// </summary> public void IncludeJavaScriptWhereTheWidgetIsDropped() { HtmlInputRadioButton includeJavaScriptWhereTheWidgetIsDropped = EM.ScriptsAndStyles.JavaScriptEditScreen.IncludeJavaScriptWhereTheWidgetIsDropped .AssertIsPresent("Include JavaScript Where The Widget Is Dropped radio button"); includeJavaScriptWhereTheWidgetIsDropped.Click(); }
/// <summary> /// Selects the radio button option. /// </summary> /// <param name="optionId">The option id.</param> public void SelectRadioButtonOption(TagsRadioButtonIds optionId) { HtmlInputRadioButton radioButton = ActiveBrowser.Find.ByExpression <HtmlInputRadioButton>("tagname=input", "id=" + optionId) .AssertIsPresent("radio button"); radioButton.Click(); }
/// <summary> /// Selects the redirect to a page in form widget. /// </summary> public void SelectRedirectToAPageInFormWidget() { ActiveBrowser.RefreshDomTree(); HtmlInputRadioButton redirectToAPage = this.EM.Forms.FormsBackend.RedirectToPage.AssertIsPresent("Redirect to a page"); redirectToAPage.Click(); }
/// <summary> /// Includes the java script in tag header. /// </summary> public void IncludeJavaScriptInTagHeader() { HtmlInputRadioButton includeJavaScriptInTagHeader = EM.ScriptsAndStyles.JavaScriptEditScreen.IncludeJavaScriptInHeadTag .AssertIsPresent("Include JavaScript In Head Tag radio button"); includeJavaScriptInTagHeader.Click(); }
/// <summary> /// Selects which items to display in the widget designer /// </summary> /// <param name="mode">Which items to display</param> public void SelectWhichItemsToDisplay(string mode) { int position; HtmlDiv optionsDiv = EM.Widgets .WidgetDesignerContentScreen .WhichItemsToDisplayList .AssertIsPresent("Which items to display options list"); List <HtmlDiv> itemsDivs = optionsDiv.Find.AllByExpression <HtmlDiv>("tagname=div", "class=radio").ToList <HtmlDiv>(); if (mode.Contains("Selected")) { position = 1; } else if (mode.Contains("Narrow")) { position = 2; } else { position = 0; } HtmlInputRadioButton optionButton = itemsDivs[position].Find.ByExpression <HtmlInputRadioButton>("tagname=input") .AssertIsPresent("Which items to display option radio button"); optionButton.Click(); }
/// <summary> /// Selects display items published in /// </summary> /// <param name="option">Selects display items published in</param> public void SelectDisplayItemsPublishedIn(string option, string divClass = "radio") { int position; HtmlForm optionsForm = EM.Widgets .WidgetDesignerContentScreen .DisplayItemsPublishedIn .AssertIsPresent("Selects display items published in"); List <HtmlDiv> itemsDivs = optionsForm.Find.AllByExpression <HtmlDiv>("tagname=div", "class=~" + divClass).ToList <HtmlDiv>(); switch (option) { case "Any time": position = 0; break; case "Last": position = 1; break; case "Custom range...": position = 2; break; default: position = 0; break; } HtmlInputRadioButton optionButton = itemsDivs[position].Find.ByExpression <HtmlInputRadioButton>("tagname=input") .AssertIsPresent("Display itesm published in radio button"); optionButton.Click(); }
/// <summary> /// Select weeks starts on "Sunday" /// </summary> public void SelectWeekStartsOnSunday() { HtmlInputRadioButton selectWeekStartsOnSunday = this.EM.Widgets.WidgetDesignerCalendarScreen.WeekStartsOnSunday .AssertIsPresent("Weeks starts on Sunday"); selectWeekStartsOnSunday.Click(); }
/// <summary> /// Includes the java script before the closing body tag. /// </summary> public void IncludeJavaScriptBeforeTheClosingBodyTag() { HtmlInputRadioButton includeJavaScriptBeforeTheClosingBodyTag = EM.ScriptsAndStyles.JavaScriptEditScreen.IncludeJavaScriptBeforeTheClosingBodyTag .AssertIsPresent("Include JavaScript Before The Closing Body Tag radio button"); includeJavaScriptBeforeTheClosingBodyTag.Click(); }
/// <summary> /// Selects the radio button option. /// </summary> /// <param name="optionId">The option id.</param> public void SelectRadioButtonOption(CategoriesRadioButtonIds optionId) { ActiveBrowser.WaitForElement(new HtmlFindExpression("tagname=input", "id=" + optionId)); HtmlInputRadioButton radioButton = ActiveBrowser.Find.ByExpression <HtmlInputRadioButton>("tagname=input", "id=" + optionId) .AssertIsPresent("radio button"); radioButton.Click(); }
/// <summary> /// Select email address /// </summary> public void SelectEmailAddress() { HtmlInputRadioButton emailAddress = this.EM.EmailCampaigns.UnsubscribeEditScreen.EmailAddress.AssertIsPresent("Email address"); emailAddress.Click(); ActiveBrowser.RefreshDomTree(); ActiveBrowser.WaitUntilReady(); }
/// <summary> /// Switch to Both mode only /// </summary> public void SwitchToBothMode() { HtmlInputRadioButton bothMode = EM.Identity.ProfileEditScreen.BothReadModeCanBeEditedMode .AssertIsPresent("Both mode only button"); bothMode.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Switch to Read mode only /// </summary> public void SwitchToReadMode() { HtmlInputRadioButton readMode = EM.Identity.ProfileEditScreen.ReadModeOnly .AssertIsPresent("Read mode only button"); readMode.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Switches to link file option. /// </summary> public void SwitchToLinkFileOption() { HtmlInputRadioButton linkToCssFile = EM.ScriptsAndStyles.ScriptsAndStylesEditScreen.LinkToFile .AssertIsPresent("Link to css file button"); linkToCssFile.Click(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncJQueryRequests(); }
/// <summary> /// Selects the radio button option. /// </summary> /// <param name="optionId">The option id.</param> public void SelectRadioButtonOption(WidgetDesignerRadioButtonIds optionId) { HtmlFindExpression expression = new HtmlFindExpression("tagname=input", "id=" + optionId); ActiveBrowser.WaitForElement(expression, 60000, false); HtmlInputRadioButton radioButton = ActiveBrowser.Find.ByExpression <HtmlInputRadioButton>("tagname=input", "id=" + optionId) .AssertIsPresent("radio button"); radioButton.Click(); }
/// <summary> /// Selects which items to display in the widget designer /// </summary> /// <param name="position">Position of the checkbox defining which items to display</param> public void SelectWhichItemsToDisplay(int position) { HtmlDiv optionsDiv = EM.Widgets .WidgetDesignerContentScreen .WhichItemsToDisplayList .AssertIsPresent("Which items to display options list"); List <HtmlDiv> itemsDivs = optionsDiv.Find.AllByExpression <HtmlDiv>("tagname=div", "class=radio").ToList <HtmlDiv>(); HtmlInputRadioButton optionButton = itemsDivs[position].Find.ByExpression <HtmlInputRadioButton>("tagname=input") .AssertIsPresent("Which items to display option radio button"); optionButton.Click(); }
/// <summary> /// Selects another tab from the link selector options. /// </summary> /// <param name="tabName">The name of the tab.</param> public void SwitchToSelectedTab(string tabName) { HtmlDiv tabs = EM.GenericContent .ContentBlockLinkSelector .TabsNavigation .AssertIsPresent("Navigation tabs"); HtmlControl tabLabel = tabs.ChildNodes.Where(n => n.InnerText.Contains(tabName)).FirstOrDefault().As <HtmlControl>(); Assert.IsNotNull(tabLabel, "The tab label " + tabName + " was not found"); HtmlInputRadioButton option = tabLabel.Find.ByExpression <HtmlInputRadioButton>("tagName=input", "type=radio"); option.AssertIsPresent(tabName); option.Click(); ActiveBrowser.WaitForAsyncRequests(); ActiveBrowser.RefreshDomTree(); }
/// <summary> /// Selects navigation widget display mode in the widget designer /// </summary> /// <param name="mode">Navigation display mode</param> public void SelectNavigationWidgetDisplayMode(string mode) { HtmlDiv optionsDiv = EM.Navigation.NavigationWidgetEditScreen.DislayModeList .AssertIsPresent("Navigation div"); List <HtmlDiv> navDivs = optionsDiv.Find.AllByExpression <HtmlDiv>("tagname=div", "class=radio").ToList <HtmlDiv>(); foreach (var div in navDivs) { if (div.InnerText.Contains(mode)) { HtmlInputRadioButton optionButton = div.Find.ByExpression <HtmlInputRadioButton>("tagname=input", "type=radio"); if (optionButton != null && optionButton.IsVisible()) { optionButton.Click(); } } } }
/// <summary> /// Selects profile widget display mode in the widget designer /// </summary> /// <param name="mode">Profile display mode</param> public void SelectDisplayModeWhenChangesAreSaved(string mode) { HtmlDiv optionsDiv = EM.Identity.ProfileEditScreen.WhenChangesAreSavedDiv .AssertIsPresent("Profile div"); List <HtmlDiv> profileDivs = optionsDiv.Find.AllByExpression <HtmlDiv>("tagname=div", "class=radio").ToList <HtmlDiv>(); foreach (var div in profileDivs) { if (div.InnerText.Contains(mode)) { HtmlInputRadioButton optionButton = div.Find.ByExpression <HtmlInputRadioButton>("tagname=input", "type=radio"); if (optionButton != null && optionButton.IsVisible()) { optionButton.Click(); } } } }
/// <summary> /// Selects radio button from multiplechoice field /// </summary> public void SelectRadioButton(string choice) { HtmlInputRadioButton checkbox = ActiveBrowser.Find.ByExpression <HtmlInputRadioButton>("tagname=input", "data-sf-role=multiple-choice-field-input", "value=" + choice); checkbox.Click(); }
/// <summary> /// Selects Right alignment option /// </summary> public void SelectRightAlignmentOption() { HtmlInputRadioButton alignmentOption = this.EM.Media.ImagePropertiesScreen.AlignmentRight.AssertIsPresent("Right alignment"); alignmentOption.Click(); }
/// <summary> /// Select auto-generated page for single item /// </summary> public void SelectAutoGeneratedPage() { HtmlInputRadioButton autoGeneratedPageRadioButton = this.EM.Widgets.WidgetDesignerContentScreen.AutoGeneratedPage.AssertIsPresent("Auto-generated page"); autoGeneratedPageRadioButton.Click(); }
/// <summary> /// Select existing page for single item /// </summary> public void SelectExistingPage() { HtmlInputRadioButton selectExistingPage = this.EM.Widgets.WidgetDesignerContentScreen.SelectedExistingPage.AssertIsPresent("Selected existing page"); selectExistingPage.Click(); }
/// <summary> /// Select existing page for single item /// </summary> public void SelectExistingPage() { HtmlInputRadioButton selectExistingPage = this.EM.EmailCampaigns.SubscribeFormEditScreen.SelectedExistingPage.AssertIsPresent("Selected existing page"); selectExistingPage.Click(); }