Skip to content

Commit

Permalink
added a text property to INavigationControl
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank Shetty committed May 10, 2013
1 parent 8f16910 commit 405c1bc
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/FluentBrowserAutomation/Controls/BasicInfoWrapper.cs
Expand Up @@ -22,6 +22,16 @@ public string Id
return Element.GetAttribute("id");
}
}

public string Name
{
get
{
this.Exists().ShouldBeTrue();
return Element.GetAttribute("name");
}
}

public string HowFound { get; private set; }
}
}
6 changes: 6 additions & 0 deletions src/FluentBrowserAutomation/Controls/ButtonWrapper.cs
@@ -1,3 +1,4 @@
using FluentBrowserAutomation.Accessors;
using OpenQA.Selenium;

namespace FluentBrowserAutomation.Controls
Expand All @@ -8,5 +9,10 @@ public ButtonWrapper(IWebElement button, string howFound, IBrowserContext browse
: base(button, howFound, browser)
{
}

public string Text
{
get { return new ReadOnlyText("value of " + HowFound, Element.GetAttribute("value")); }
}
}
}
3 changes: 3 additions & 0 deletions src/FluentBrowserAutomation/Controls/INavigationControl.cs
@@ -1,6 +1,9 @@
using FluentBrowserAutomation.Accessors;

namespace FluentBrowserAutomation.Controls
{
public interface INavigationControl : ICanBeClicked, IAmVisualElement, ICouldBeDisabled
{
string Text { get; }
}
}
6 changes: 6 additions & 0 deletions src/FluentBrowserAutomation/Controls/ImageWrapper.cs
@@ -1,3 +1,4 @@
using FluentBrowserAutomation.Accessors;
using OpenQA.Selenium;

namespace FluentBrowserAutomation.Controls
Expand All @@ -8,5 +9,10 @@ public ImageWrapper(IWebElement webElement, string howFound, IBrowserContext bro
: base(webElement, howFound, browser)
{
}

public string Text
{
get { return new ReadOnlyText("alt of " + HowFound, Element.GetAttribute("alt")); }
}
}
}
6 changes: 6 additions & 0 deletions src/FluentBrowserAutomation/Controls/LinkWrapper.cs
@@ -1,3 +1,4 @@
using FluentBrowserAutomation.Accessors;
using OpenQA.Selenium;

namespace FluentBrowserAutomation.Controls
Expand All @@ -8,5 +9,10 @@ public LinkWrapper(IWebElement link, string howFound, IBrowserContext browserCon
: base(link, howFound, browserContext)
{
}

public string Text
{
get { return new ReadOnlyText("text of " + HowFound, Element.GetAttribute("text")); }
}
}
}
Expand Up @@ -18,6 +18,7 @@ public interface IHaveBasicInfo
IWebElement Element { get; }
string HowFound { get; }
string Id { get; }
string Name { get; }
}

public static class IBasicInfoExtensions
Expand Down

0 comments on commit 405c1bc

Please sign in to comment.