public virtual void Visit(FormSubmit formSubmit, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formSubmit.Path) : new HtmlDiv(); htmlDiv.Class.Add("formButton"); if (!string.IsNullOrWhiteSpace(formSubmit.CssClass)) { htmlDiv.Class.AddRange(formSubmit.CssClass.Split(' ').Where(s => s != string.Empty)); } if (!string.IsNullOrWhiteSpace(formSubmit.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formSubmit.Path)); } htmlDiv.Hidden.Value = formSubmit.IsHidden; htmlContainer.Add(htmlDiv); HtmlSubmit htmlSubmit = new HtmlSubmit(formSubmit.Path, verbose, formSubmit.Parameter); htmlSubmit.Disabled.Value = formSubmit.IsDisabled; htmlDiv.Add(htmlSubmit); htmlSubmit.Add(new HtmlText(formSubmit.Content)); }
public virtual void Visit(FormSubmit formSubmit, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formSubmit.Path) : new HtmlDiv(); htmlDiv.Class.Add("formButton"); if (!string.IsNullOrWhiteSpace(formSubmit.CssClass)) { htmlDiv.Class.AddRange(formSubmit.CssClass.Split(' ').Where(s => s != string.Empty)); } if (!string.IsNullOrWhiteSpace(formSubmit.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formSubmit.Path)); } htmlDiv.Hidden.Value = formSubmit.IsHidden; htmlContainer.Add(htmlDiv); HtmlSubmit htmlSubmit = new HtmlSubmit(formSubmit.Path, verbose, formSubmit.Parameter); htmlSubmit.Class.AddRange(new string[] { "btnFix", "btn", "mt-2" }); switch (formSubmit.Type) { case ButtonType.Primary: case ButtonType.Secondary: case ButtonType.Success: case ButtonType.Danger: htmlSubmit.Class.Add(string.Format("btn-{0}", formSubmit.Type.ToString().ToLower())); break; default: case ButtonType.NotSet: break; } htmlSubmit.Disabled.Value = formSubmit.IsDisabled; htmlDiv.Add(htmlSubmit); htmlSubmit.Add(new HtmlText(formSubmit.Content)); }
private new void WaitForElements() { JobSearchComponent = WaitForElementToBeInDom <HtmlControl>(JobSearchSelectors.JobSearchComponent); WaitForGivenElementToBeVisible(JobSearchComponent); JobSearchField = WaitForElementToBeInDom <HtmlTextbox>(JobSearchSelectors.JobSearchField, JobSearchComponent); JobSearchSubmit = WaitForElementToBeInDom <HtmlSubmit>(JobSearchSelectors.JobSearchSubmit, JobSearchComponent); WaitForGivenElementToBeVisible(JobSearchField); base.WaitForElements(); SearchResultsContainer = WaitForElementToBeInDom <HtmlControl>(JobSearchSelectors.SearchResultsContainer); base.WaitForElements(); NextBtn = WaitForElementToBeInDom <HtmlSubmit>(JobSearchSelectors.NextBtn); ContractTypeFilter = webDriver.FindElement(By.Name("filter_location")); SortingFilter = webDriver.FindElement(By.Name("filter_sorting")); }
public void Visit(HtmlSubmit h) { sb.Append(Tabs(h.Depth)); sb.Append(string.Format("<{0}", h.Tag)); foreach (var a in h.Attributes.Where(a => a.IsSet)) { sb.Append(a); } foreach (var e in h.Events.Where(e => e.IsSet)) { sb.Append(e); } sb.Append(">"); foreach (var c in h.Contents) { Visit(c); } sb.AppendLine(string.Format("</{0}>", h.Tag)); }
public void WaitForElements() { SearchField = WaitForElementToBeInDom <HtmlTextbox>(GoogleMainSelectors.SearchField); SearchButton = WaitForElementToBeInDom <HtmlSubmit>(GoogleMainSelectors.SearchButton); }