Permalink
Browse files

Added InputWithClass method

  • Loading branch information...
1 parent d3e3706 commit f3243c62f9052447e23c4556706ac71ca2de9050 @shashankshetty shashankshetty committed Nov 25, 2013
@@ -49,6 +49,7 @@ public interface IBrowserContext
IEnumerable<ButtonWrapper> ImageButtons();
ImageWrapper ImageWithId([NotNull] string id);
IAmInputThatCanBeChanged InputWithId([NotNull] string id);
+ IAmInputThatCanBeChanged InputWithClassName([NotNull] string className);
IAmInputThatCanBeChanged InputWithLabel([NotNull] string label);
IAmInputThatCanBeChanged InputWithValue([NotNull] string value);
LabelWrapper LabelWithId([NotNull] string id);
@@ -316,6 +317,12 @@ public IAmInputThatCanBeChanged InputWithId(string id)
_browserManager.Trace("Getting input with id '" + id + "'");
return SetterFor.InputWithId(this, id);
}
+
+ public IAmInputThatCanBeChanged InputWithClassName(string className)
+ {
+ _browserManager.Trace("Getting input with class name '" + className + "'");
+ return SetterFor.InputWithClassName(this, className);
+ }
public IAmInputThatCanBeChanged InputWithLabel(string label)
{
@@ -45,6 +45,13 @@ public static IAmInputThatCanBeChanged InputWithId(this IBrowserContext browserC
return GetInputElement(browserContext, control, howFound);
}
+ public static IAmInputThatCanBeChanged InputWithClassName(this IBrowserContext browserContext, string className)
+ {
+ var control = browserContext.Browser.FindElements(By.ClassName(className)).FirstOrDefault();
+ var howFound = String.Format("Input with class '{0}'", className);
+ return GetInputElement(browserContext, control, howFound);
+ }
+
public static IAmInputThatCanBeChanged InputWithLabel(this IBrowserContext browserContext, string labelText)
{
var labels = browserContext.Labels();

0 comments on commit f3243c6

Please sign in to comment.