From 7f3a2e4aadc55a2d8277edc18e16d523372876b2 Mon Sep 17 00:00:00 2001 From: Sergey Tikhomirov Date: Thu, 30 Jul 2015 22:44:35 +0300 Subject: [PATCH] The Class target was added to PageObject attributes This change change provides to end user some additional options. For example User needs to develop page object like that: ```csharp //[FindsBySequence] [FindsBy(How = How.Id, Using = "SomeId", Priority = 1)] [FindsBy(How = How.ClassName, Using = "SomeClass", Priority = 2)] //and so on //the construction above describes how to find the root element class PageObject { [FindsBy(How = How.TagName, Using = "SomeTag")] IWebElement e; //this is the nested element } ``` At this case they only need to develop their own customized [IPageObjectMemberDecorator](https://github.com/SeleniumHQ/selenium/blob/master/dotnet/src/support/PageObjects/IPageObjectMemberDecorator.cs) implementation that can handle classes/members like above --- dotnet/src/support/PageObjects/FindsByAllAttribute.cs | 2 +- dotnet/src/support/PageObjects/FindsByAttribute.cs | 2 +- dotnet/src/support/PageObjects/FindsBySequenceAttribute.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dotnet/src/support/PageObjects/FindsByAllAttribute.cs b/dotnet/src/support/PageObjects/FindsByAllAttribute.cs index 7cf9d9cb97ecd..1ee0b498b0669 100644 --- a/dotnet/src/support/PageObjects/FindsByAllAttribute.cs +++ b/dotnet/src/support/PageObjects/FindsByAllAttribute.cs @@ -44,7 +44,7 @@ namespace OpenQA.Selenium.Support.PageObjects /// /// /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class)] public sealed class FindsByAllAttribute : Attribute { } diff --git a/dotnet/src/support/PageObjects/FindsByAttribute.cs b/dotnet/src/support/PageObjects/FindsByAttribute.cs index 7fadc86d3b95f..d3cea0ac7531e 100644 --- a/dotnet/src/support/PageObjects/FindsByAttribute.cs +++ b/dotnet/src/support/PageObjects/FindsByAttribute.cs @@ -56,7 +56,7 @@ namespace OpenQA.Selenium.Support.PageObjects /// /// /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class, AllowMultiple = true)] public sealed class FindsByAttribute : Attribute, IComparable { private By finder = null; diff --git a/dotnet/src/support/PageObjects/FindsBySequenceAttribute.cs b/dotnet/src/support/PageObjects/FindsBySequenceAttribute.cs index a1d7ca2c78cd3..15d0bd69c4344 100644 --- a/dotnet/src/support/PageObjects/FindsBySequenceAttribute.cs +++ b/dotnet/src/support/PageObjects/FindsBySequenceAttribute.cs @@ -43,7 +43,7 @@ namespace OpenQA.Selenium.Support.PageObjects /// /// /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class)] public sealed class FindsBySequenceAttribute : Attribute { }